@mavenagi/apps 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as e}from"module";var t={3220:(e,t,r)=>{const n=r(5317);const o=r(8291);const i=r(2691);function spawn(e,t,r){const u=o(e,t,r);const s=n.spawn(u.command,u.args,u.options);i.hookChildProcess(s,u);return s}function spawnSync(e,t,r){const u=o(e,t,r);const s=n.spawnSync(u.command,u.args,u.options);s.error=s.error||i.verifyENOENTSync(s.status,u);return s}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=o;e.exports._enoent=i},2691:e=>{const t=process.platform==="win32";function notFoundError(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,r){if(!t){return}const n=e.emit;e.emit=function(t,o){if(t==="exit"){const t=verifyENOENT(o,r);if(t){return n.call(e,"error",t)}}return n.apply(e,arguments)}}function verifyENOENT(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawn")}return null}function verifyENOENTSync(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawnSync")}return null}e.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},8291:(e,t,r)=>{const n=r(6928);const o=r(8032);const i=r(6878);const u=r(2537);const s=process.platform==="win32";const a=/\.(?:com|exe)$/i;const c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(e){e.file=o(e);const t=e.file&&u(e.file);if(t){e.args.unshift(e.file);e.command=t;return o(e)}return e.file}function parseNonShell(e){if(!s){return e}const t=detectShebang(e);const r=!a.test(t);if(e.options.forceShell||r){const r=c.test(t);e.command=n.normalize(e.command);e.command=i.command(e.command);e.args=e.args.map((e=>i.argument(e,r)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`];e.command=process.env.comspec||"cmd.exe";e.options.windowsVerbatimArguments=true}return e}function parse(e,t,r){if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=Object.assign({},r);const n={command:e,args:t,options:r,file:undefined,original:{command:e,args:t}};return r.shell?n:parseNonShell(n)}e.exports=parse},6878:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){e=e.replace(t,"^$1");return e}function escapeArgument(e,r){e=`${e}`;e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');e=e.replace(/(?=(\\+?)?)\1$/,"$1$1");e=`"${e}"`;e=e.replace(t,"^$1");if(r){e=e.replace(t,"^$1")}return e}e.exports.command=escapeCommand;e.exports.argument=escapeArgument},2537:(e,t,r)=>{const n=r(9896);const o=r(934);function readShebang(e){const t=150;const r=Buffer.alloc(t);let i;try{i=n.openSync(e,"r");n.readSync(i,r,0,t,0);n.closeSync(i)}catch(e){}return o(r.toString())}e.exports=readShebang},8032:(e,t,r)=>{const n=r(6928);const o=r(20);const i=r(8251);function resolveCommandAttempt(e,t){const r=e.options.env||process.env;const u=process.cwd();const s=e.options.cwd!=null;const a=s&&process.chdir!==undefined&&!process.chdir.disabled;if(a){try{process.chdir(e.options.cwd)}catch(e){}}let c;try{c=o.sync(e.command,{path:r[i({env:r})],pathExt:t?n.delimiter:undefined})}catch(e){}finally{if(a){process.chdir(u)}}if(c){c=n.resolve(s?e.options.cwd:"",c)}return c}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,true)}e.exports=resolveCommand},20:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const o=r(6928);const i=n?";":":";const u=r(7210);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||i;const o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const u=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const s=n?u.split(r):[""];if(n){if(e.indexOf(".")!==-1&&s[0]!=="")s.unshift("")}return{pathEnv:o,pathExt:s,pathExtExe:u}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:i,pathExtExe:s}=getPathInfo(e,t);const a=[];const step=r=>new Promise(((i,u)=>{if(r===n.length)return t.all&&a.length?i(a):u(getNotFoundError(e));const s=n[r];const c=/^".*"$/.test(s)?s.slice(1,-1):s;const l=o.join(c,e);const D=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;i(subStep(D,r,0))}));const subStep=(e,r,n)=>new Promise(((o,c)=>{if(n===i.length)return o(step(r+1));const l=i[n];u(e+l,{pathExt:s},((i,u)=>{if(!i&&u){if(t.all)a.push(e+l);else return o(e+l)}return o(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:i}=getPathInfo(e,t);const s=[];for(let a=0;a<r.length;a++){const c=r[a];const l=/^".*"$/.test(c)?c.slice(1,-1):c;const D=o.join(l,e);const f=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+D:D;for(let e=0;e<n.length;e++){const r=f+n[e];try{const e=u.sync(r,{pathExt:i});if(e){if(t.all)s.push(r);else return r}}catch(e){}}}if(t.all&&s.length)return s;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},5426:(e,t,r)=>{const n=r(6928);const o=r(5317);const i=r(3220);const u=r(4588);const s=r(7221);const a=r(163);const c=r(8244);const l=r(9487);const{spawnedKill:D,spawnedCancel:f,setupTimeout:d,validateTimeout:p,setExitHandler:h}=r(5676);const{handleInput:g,getSpawnedResult:m,makeAllStream:y,validateInputSync:F}=r(7828);const{mergePromise:b,getSpawnedPromise:E}=r(6163);const{joinCommand:C,parseCommand:v,getEscapedCommand:w}=r(4835);const A=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const i=t?{...process.env,...e}:e;if(r){return s.env({env:i,cwd:n,execPath:o})}return i};const handleArguments=(e,t,r={})=>{const o=i._parse(e,t,r);e=o.command;t=o.args;r=o.options;r={maxBuffer:A,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=l(r);if(process.platform==="win32"&&n.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:o}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return u(t)}return t};const execa=(e,t,r)=>{const n=handleArguments(e,t,r);const i=C(e,t);const u=w(e,t);p(n.options);let s;try{s=o.spawn(n.file,n.args,n.options)}catch(e){const t=new o.ChildProcess;const r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:u,parsed:n,timedOut:false,isCanceled:false,killed:false}));return b(t,r)}const l=E(s);const F=d(s,n.options,l);const v=h(s,n.options,F);const A={isCanceled:false};s.kill=D.bind(null,s.kill.bind(s));s.cancel=f.bind(null,s,A);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},a,l,D]=await m(s,n.options,v);const f=handleOutput(n.options,a);const d=handleOutput(n.options,l);const p=handleOutput(n.options,D);if(e||t!==0||r!==null){const a=c({error:e,exitCode:t,signal:r,stdout:f,stderr:d,all:p,command:i,escapedCommand:u,parsed:n,timedOut:o,isCanceled:A.isCanceled,killed:s.killed});if(!n.options.reject){return a}throw a}return{command:i,escapedCommand:u,exitCode:0,stdout:f,stderr:d,all:p,failed:false,timedOut:false,isCanceled:false,killed:false}};const O=a(handlePromise);g(s,n.options.input);s.all=y(s,n.options);return b(s,O)};e.exports=execa;e.exports.sync=(e,t,r)=>{const n=handleArguments(e,t,r);const i=C(e,t);const u=w(e,t);F(n.options);let s;try{s=o.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:u,parsed:n,timedOut:false,isCanceled:false,killed:false})}const a=handleOutput(n.options,s.stdout,s.error);const l=handleOutput(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){const e=c({stdout:a,stderr:l,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:u,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:false,killed:s.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:u,exitCode:0,stdout:a,stderr:l,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[r,...n]=v(e);return execa(r,n,t)};e.exports.commandSync=(e,t)=>{const[r,...n]=v(e);return execa.sync(r,n,t)};e.exports.node=(e,t,r={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=l.node(r);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:u=o}=r;return execa(i,[...u,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},4835:e=>{const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const r=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(r,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const n=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},8244:(e,t,r)=>{const{signalsByName:n}=r(9280);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:u})=>{if(e){return`timed out after ${t} milliseconds`}if(u){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:o,signal:i,exitCode:u,command:s,escapedCommand:a,timedOut:c,isCanceled:l,killed:D,parsed:{options:{timeout:f}}})=>{u=u===null?undefined:u;i=i===null?undefined:i;const d=i===undefined?undefined:n[i].description;const p=o&&o.code;const h=getErrorPrefix({timedOut:c,timeout:f,errorCode:p,signal:i,signalDescription:d,exitCode:u,isCanceled:l});const g=`Command ${h}: ${s}`;const m=Object.prototype.toString.call(o)==="[object Error]";const y=m?`${g}\n${o.message}`:g;const F=[y,t,e].filter(Boolean).join("\n");if(m){o.originalMessage=o.message;o.message=F}else{o=new Error(F)}o.shortMessage=y;o.command=s;o.escapedCommand=a;o.exitCode=u;o.signal=i;o.signalDescription=d;o.stdout=e;o.stderr=t;if(r!==undefined){o.all=r}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(c);o.isCanceled=l;o.killed=D&&!c;return o};e.exports=makeError},5676:(e,t,r)=>{const n=r(857);const o=r(1521);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const o=getForceKillAfterTimeout(r);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===n.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}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};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let o;const i=new Promise(((n,i)=>{o=setTimeout((()=>{timeoutKill(e,r,i)}),t)}));const u=n.finally((()=>{clearTimeout(o)}));return Promise.race([i,u])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=o((()=>{e.kill()}));return n.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},6163:e=>{const t=(async()=>{})().constructor.prototype;const r=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[n,o]of r){const r=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,n,{...o,value:r})}return e};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},9487:e=>{const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:r}=e;if(r===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).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}\``)}const n=Math.max(r.length,t.length);return Array.from({length:n},((e,t)=>r[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},7828:(e,t,r)=>{const n=r(7277);const o=r(3221);const i=r(2993);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(n(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=i();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t){return o(e,{encoding:t,maxBuffer:n})}return o.buffer(e,{maxBuffer:n})};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},u)=>{const s=getStreamPromise(e,{encoding:n,buffer:o,maxBuffer:i});const a=getStreamPromise(t,{encoding:n,buffer:o,maxBuffer:i});const c=getStreamPromise(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([u,s,a,c])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,s),getBufferedData(t,a),getBufferedData(r,c)])}};const validateInputSync=({input:e})=>{if(n(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},1521:(e,t,r)=>{var n=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(n)){e.exports=function(){return function(){}}}else{var o=r(2613);var i=r(2280);var u=/^win/i.test(n.platform);var s=r(4434);if(typeof s!=="function"){s=s.EventEmitter}var a;if(n.__signal_exit_emitter__){a=n.__signal_exit_emitter__}else{a=n.__signal_exit_emitter__=new s;a.count=0;a.emitted={}}if(!a.infinite){a.setMaxListeners(Infinity);a.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(f===false){d()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){a.removeListener(r,e);if(a.listeners("exit").length===0&&a.listeners("afterexit").length===0){c()}};a.on(r,e);return remove};var c=function unload(){if(!f||!processOk(global.process)){return}f=false;i.forEach((function(e){try{n.removeListener(e,D[e])}catch(e){}}));n.emit=g;n.reallyExit=p;a.count-=1};e.exports.unload=c;var l=function emit(e,t,r){if(a.emitted[e]){return}a.emitted[e]=true;a.emit(e,t,r)};var D={};i.forEach((function(e){D[e]=function listener(){if(!processOk(global.process)){return}var t=n.listeners(e);if(t.length===a.count){c();l("exit",null,e);l("afterexit",null,e);if(u&&e==="SIGHUP"){e="SIGINT"}n.kill(n.pid,e)}}}));e.exports.signals=function(){return i};var f=false;var d=function load(){if(f||!processOk(global.process)){return}f=true;a.count+=1;i=i.filter((function(e){try{n.on(e,D[e]);return true}catch(e){return false}}));n.emit=m;n.reallyExit=h};e.exports.load=d;var p=n.reallyExit;var h=function processReallyExit(e){if(!processOk(global.process)){return}n.exitCode=e||0;l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);p.call(n,n.exitCode)};var g=n.emit;var m=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){n.exitCode=t}var r=g.apply(this,arguments);l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);return r}else{return g.apply(this,arguments)}}}},2280:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},9103:e=>{e.exports=function getCallerFile(e){if(e===void 0){e=2}if(e>=Error.stackTraceLimit){throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`")}var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var r=(new Error).stack;Error.prepareStackTrace=t;if(r!==null&&typeof r==="object"){return r[e]?r[e].getFileName():undefined}}},324:(e,t,r)=>{const{PassThrough:n}=r(2203);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const o=r==="buffer";let i=false;if(t){i=!(r||o)}else{r=r||"utf8"}if(o){r=null}const u=new n({objectMode:i});if(r){u.setEncoding(r)}let s=0;const a=[];u.on("data",(e=>{a.push(e);if(i){s=a.length}else{s+=e.length}}));u.getBufferedValue=()=>{if(t){return a}return o?Buffer.concat(a,s):a.join("")};u.getBufferedLength=()=>s;return u}},3221:(e,t,r)=>{const{constants:n}=r(181);const o=r(2203);const{promisify:i}=r(9023);const u=r(324);const s=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;const o=u(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=n.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await s(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},8534:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const r=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=r},9280:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var n=r(857);var o=r(6280);var i=r(576);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:r,description:n,supported:o,action:i,forced:u,standard:s}){return{...e,[t]:{name:t,number:r,description:n,supported:o,action:i,forced:u,standard:s}}};const u=getSignalsByName();t.signalsByName=u;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=function(e,t){const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:o,supported:i,action:u,forced:s,standard:a}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:u,forced:s,standard:a}}};const findSignalByNumber=function(e,t){const r=t.find((({name:t})=>n.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const s=getSignalsByNumber();t.signalsByNumber=s},576:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=n-r+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:r+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const r=34;const n=64;t.SIGRTMAX=n},6280:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var n=r(857);var o=r(8534);var i=r(576);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:r,action:o,forced:i=false,standard:u}){const{signals:{[e]:s}}=n.constants;const a=s!==undefined;const c=a?s:t;return{name:e,number:c,description:r,supported:a,action:o,forced:i,standard:u}}},7277:e=>{const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},7210:(e,t,r)=>{var n=r(9896);var o;if(process.platform==="win32"||global.TESTING_WINDOWS){o=r(6431)}else{o=r(2891)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{r(t)}}))}))}o(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}r(e,n)}))}function sync(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},2891:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(9896);function isexe(e,t,r){n.stat(e,(function(e,n){r(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var n=e.uid;var o=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var u=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var s=parseInt("100",8);var a=parseInt("010",8);var c=parseInt("001",8);var l=s|a;var D=r&c||r&a&&o===u||r&s&&n===i||r&l&&i===0;return D}},6431:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(9896);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){n.stat(e,(function(n,o){r(n,n?false:checkStat(o,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},2993:(e,t,r)=>{const{PassThrough:n}=r(2203);e.exports=function(){var e=[];var t=new n({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},1098:e=>{const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},7221:(e,t,r)=>{const n=r(6928);const o=r(8251);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let r=n.resolve(e.cwd);const i=[];while(t!==r){i.push(n.join(r,"node_modules/.bin"));t=r;r=n.resolve(r,"..")}const u=n.resolve(e.cwd,e.execPath,"..");i.push(u);return i.concat(e.path).join(n.delimiter)};e.exports=npmRunPath;e.exports["default"]=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const n=o({env:r});t.path=r[n];r[n]=e.exports(t);return r}},163:(e,t,r)=>{const n=r(1098);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let i=0;const u=e.displayName||e.name||"<anonymous>";const onetime=function(...n){o.set(onetime,++i);if(i===1){r=e.apply(this,n);e=null}else if(t.throw===true){throw new Error(`Function \`${u}\` can only be called once`)}return r};n(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},8251:e=>{const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},934:(e,t,r)=>{const n=r(1368);e.exports=(e="")=>{const t=e.match(n);if(!t){return null}const[r,o]=t[0].replace(/#! ?/,"").split(" ");const i=r.split("/").pop();if(i==="env"){return o}return o?`${i} ${o}`:i}},1368:e=>{e.exports=/^#!(.*)/},4588:e=>{e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},5470:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},2732:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},1719:(e,t,r)=>{r.a(e,(async(e,t)=>{try{var n=r(5317);var o=r.n(n);var i=r(1943);var u=r.n(i);var s=r(9309);var a=r(8745);var c=r(2142);const prepare=async()=>{await u().access("src").catch((()=>{throw new Error("src directory not found. Make sure all your source code is in the src directory.")}));await u().access("src/pages").then((()=>{throw new Error("pages directory found. Only NextJS App Router is supported. Convert your app to use App Router and delete the pages directory.")})).catch((()=>{}));await u().rm("src/app/mavenagi-cgi",{recursive:true,force:true});await u().mkdir("src/app/mavenagi-cgi",{recursive:true});await Promise.all([u().writeFile("src/app/mavenagi-cgi/next.ts",`// @ts-nocheck\n${c.S}`),...Object.entries({"pre-install":"preInstall","post-install":"postInstall",uninstall:"uninstall",feedbacks:"feedbackCreatedOrUpdated",conversations:"conversationCreatedOrUpdated","inbox-items":"inboxItemCreatedOrUpdated",events:"eventCreatedOrUpdated","execute-action":"executeAction","knowledge-base-refreshed":"knowledgeBaseRefreshed","handle-message":"handleMessage"}).map((async([e,t])=>{await u().mkdir(`src/app/mavenagi-cgi/v1/${e}`,{recursive:true});const r=await u().readFile(`src/index.ts`,"utf8");const n=r.includes("export const runtime = 'edge'")||r.includes('export const runtime = "edge"');if(n){throw new Error("Edge runtime is no longer supported. Remove the runtime export from index.ts.")}await u().writeFile(`src/app/mavenagi-cgi/v1/${e}/route.ts`,`// @ts-nocheck\nimport {${t}} from '../../next'\nimport userWorker from '../../../..'\n\nexport const POST = ${t}\n`)}))])};await(0,a.A)(process.argv.slice(2)).scriptName("mavenagi").usage("$0 <cmd> [args]").command("build","build",(async()=>{await prepare();(0,n.execFileSync)(await(0,s.o0)(),["run","build"],{stdio:"inherit"});process.exit(0)})).command("dev","dev",(async()=>{await prepare();(0,n.execFileSync)(await(0,s.o0)(),["run","dev"],{stdio:"inherit"});process.exit(0)})).help().argv;t()}catch(e){t(e)}}),1)},2142:(e,t,r)=>{r.d(t,{S:()=>n});const n=`var Zn=Object.defineProperty;var ei=(e,r)=>{for(var t in r)Zn(e,t,{get:r[t],enumerable:!0})};var Y=new TextEncoder,V=new TextDecoder,vs=2**32;function Zr(...e){let r=e.reduce((i,{length:a})=>i+a,0),t=new Uint8Array(r),n=0;for(let i of e)t.set(i,n),n+=i.length;return t}function et(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let r=atob(e),t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}function F(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:V.decode(e),{alphabet:"base64url"});let r=e;r instanceof Uint8Array&&(r=V.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/").replace(/\\s/g,"");try{return et(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}var T=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(r,t){super(r,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},N=class extends T{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},fe=class extends T{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},Ae=class extends T{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},z=class extends T{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var w=class extends T{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Q=class extends T{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var le=class extends T{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Z=class extends T{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(r="no applicable key found in the JSON Web Key Set",t){super(r,t)}},ze=class extends T{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(r="multiple matching keys found in the JSON Web Key Set",t){super(r,t)}},Pe=class extends T{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(r="request timed out",t){super(r,t)}},Te=class extends T{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(r="signature verification failed",t){super(r,t)}};function B(e,r="algorithm.name"){return new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`)}function ee(e,r){return e.name===r}function hr(e){return parseInt(e.name.slice(4),10)}function oi(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function ni(e,r){if(r&&!e.usages.includes(r))throw new TypeError(\`CryptoKey does not support this operation, its usages must include \${r}.\`)}function rt(e,r,t){switch(r){case"HS256":case"HS384":case"HS512":{if(!ee(e.algorithm,"HMAC"))throw B("HMAC");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!ee(e.algorithm,"RSASSA-PKCS1-v1_5"))throw B("RSASSA-PKCS1-v1_5");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!ee(e.algorithm,"RSA-PSS"))throw B("RSA-PSS");let n=parseInt(r.slice(2),10);if(hr(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!ee(e.algorithm,"Ed25519"))throw B("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!ee(e.algorithm,r))throw B(r);break}case"ES256":case"ES384":case"ES512":{if(!ee(e.algorithm,"ECDSA"))throw B("ECDSA");let n=oi(r);if(e.algorithm.namedCurve!==n)throw B(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}ni(e,t)}function tt(e,r,...t){if(t=t.filter(Boolean),t.length>2){let n=t.pop();e+=\`one of type \${t.join(", ")}, or \${n}.\`}else t.length===2?e+=\`one of type \${t[0]} or \${t[1]}.\`:e+=\`of type \${t[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var ot=(e,...r)=>tt("Key must be ",e,...r);function vr(e,r,...t){return tt(\`Key for the \${e} algorithm must be \`,r,...t)}function xr(e){return e?.[Symbol.toStringTag]==="CryptoKey"}function _r(e){return e?.[Symbol.toStringTag]==="KeyObject"}var Sr=e=>xr(e)||_r(e);var nt=(...e)=>{let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let t;for(let n of r){let i=Object.keys(n);if(!t||t.size===0){t=new Set(i);continue}for(let a of i){if(t.has(a))return!1;t.add(a)}}return!0};function ii(e){return typeof e=="object"&&e!==null}var j=e=>{if(!ii(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r};var it=(e,r)=>{if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:t}=r.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}};function ai(e){let r,t;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":r={name:e.alg},t=e.priv?["sign"]:["verify"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},t=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},t=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},t=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new z('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:t}}var re=async e=>{if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:t}=ai(e),n={...e};return n.kty!=="AKP"&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,r,e.ext??!(e.d||e.priv),e.key_ops??t)};async function at(e,r,t){if(!j(e))throw new TypeError("JWK must be an object");let n;switch(r??=e.alg,n??=t?.extractable??e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return F(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new z('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return re({...e,alg:r,ext:n});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(r!==void 0&&r!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return re({...e,ext:n})}case"EC":case"OKP":return re({...e,alg:r,ext:n});default:throw new z('Unsupported "kty" (Key Type) Parameter value')}}var st=(e,r,t,n,i)=>{if(i.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(c=>typeof c!="string"||c.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;t!==void 0?a=new Map([...Object.entries(t),...r.entries()]):a=r;for(let c of n.crit){if(!a.has(c))throw new z(\`Extension Header Parameter "\${c}" is not recognized\`);if(i[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" is missing\`);if(a.get(c)&&n[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" MUST be integrity protected\`)}return new Set(n.crit)};var ct=(e,r)=>{if(r!==void 0&&(!Array.isArray(r)||r.some(t=>typeof t!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)};function pe(e){return j(e)&&typeof e.kty=="string"}function ut(e){return e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string")}function ft(e){return e.kty!=="oct"&&typeof e.d>"u"&&typeof e.priv>"u"}function lt(e){return e.kty==="oct"&&typeof e.k=="string"}var te,pt=async(e,r,t,n=!1)=>{te||=new WeakMap;let i=te.get(e);if(i?.[t])return i[t];let a=await re({...r,alg:t});return n&&Object.freeze(e),i?i[t]=a:te.set(e,{[t]:a}),a},ci=(e,r)=>{te||=new WeakMap;let t=te.get(e);if(t?.[r])return t[r];let n=e.type==="public",i=!!n,a;if(e.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}a=e.toCryptoKey(e.asymmetricKeyType,i,n?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(r!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let c;switch(r){case"RSA-OAEP":c="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":c="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":c="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":c="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:c},i,n?["encrypt"]:["decrypt"]);a=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:c},i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){let u=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!u)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&u==="P-256"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES384"&&u==="P-384"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES512"&&u==="P-521"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r.startsWith("ECDH-ES")&&(a=e.toCryptoKey({name:"ECDH",namedCurve:u},i,n?[]:["deriveBits"]))}if(!a)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return t?t[r]=a:te.set(e,{[r]:a}),a},mt=async(e,r)=>{if(e instanceof Uint8Array||xr(e))return e;if(_r(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return ci(e,r)}catch(n){if(n instanceof TypeError)throw n}let t=e.export({format:"jwk"});return pt(e,t,r)}if(pe(e))return e.k?F(e.k):pt(e,e,r,!0);throw new Error("unreachable")};var oe=e=>e?.[Symbol.toStringTag],wr=(e,r,t)=>{if(r.use!==void 0){let n;switch(t){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(r.use!==n)throw new TypeError(\`Invalid key for this operation, its "use" must be "\${n}" when present\`)}if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, its "alg" must be "\${e}" when present\`);if(Array.isArray(r.key_ops)){let n;switch(!0){case(t==="sign"||t==="verify"):case e==="dir":case e.includes("CBC-HS"):n=t;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n=t==="encrypt"?"wrapKey":"unwrapKey":n=t;break;case(t==="encrypt"&&e.startsWith("RSA")):n="wrapKey";break;case t==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&r.key_ops?.includes?.(n)===!1)throw new TypeError(\`Invalid key for this operation, its "key_ops" must include "\${n}" when present\`)}return!0},ui=(e,r,t)=>{if(!(r instanceof Uint8Array)){if(pe(r)){if(lt(r)&&wr(e,r,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Sr(r))throw new TypeError(vr(e,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError(\`\${oe(r)} instances for symmetric algorithms must be of type "secret"\`)}},fi=(e,r,t)=>{if(pe(r))switch(t){case"decrypt":case"sign":if(ut(r)&&wr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a private JWK");case"encrypt":case"verify":if(ft(r)&&wr(e,r,t))return;throw new TypeError("JSON Web Key for this operation be a public JWK")}if(!Sr(r))throw new TypeError(vr(e,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError(\`\${oe(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(r.type==="public")switch(t){case"sign":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm signing must be of type "private"\`);case"decrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm decryption must be of type "private"\`);default:break}if(r.type==="private")switch(t){case"verify":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm verifying must be of type "public"\`);case"encrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm encryption must be of type "public"\`);default:break}},dt=(e,r,t)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A(?:128|192|256)(?:GCM)?(?:KW)?$/.test(e)||/^A(?:128|192|256)CBC-HS(?:256|384|512)$/.test(e)?ui(e,r,t):fi(e,r,t)};var yt=(e,r)=>{let t=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new z(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}};var bt=async(e,r,t)=>{if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(ot(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[t])}return rt(r,e,t),r};var gt=async(e,r,t,n)=>{let i=await bt(e,r,"verify");it(e,i);let a=yt(e,i.algorithm);try{return await crypto.subtle.verify(a,i,t,n)}catch{return!1}};async function ht(e,r,t){if(!j(e))throw new w("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new w('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new w("JWS Protected Header incorrect type");if(e.payload===void 0)throw new w("JWS Payload missing");if(typeof e.signature!="string")throw new w("JWS Signature missing or incorrect type");if(e.header!==void 0&&!j(e.header))throw new w("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{let I=F(e.protected);n=JSON.parse(V.decode(I))}catch{throw new w("JWS Protected Header is invalid")}if(!nt(n,e.header))throw new w("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...e.header},a=st(w,new Map([["b64",!0]]),t?.crit,n,i),c=!0;if(a.has("b64")&&(c=n.b64,typeof c!="boolean"))throw new w('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=i;if(typeof u!="string"||!u)throw new w('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=t&&ct("algorithms",t.algorithms);if(l&&!l.has(u))throw new Ae('"alg" (Algorithm) Header Parameter value not allowed');if(c){if(typeof e.payload!="string")throw new w("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new w("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof r=="function"&&(r=await r(n,e),f=!0),dt(u,r,"verify");let p=Zr(Y.encode(e.protected??""),Y.encode("."),typeof e.payload=="string"?Y.encode(e.payload):e.payload),y;try{y=F(e.signature)}catch{throw new w("Failed to base64url decode the signature")}let _=await mt(r,u);if(!await gt(u,_,y,p))throw new Te;let b;if(c)try{b=F(e.payload)}catch{throw new w("Failed to base64url decode the payload")}else typeof e.payload=="string"?b=Y.encode(e.payload):b=e.payload;let h={payload:b};return e.protected!==void 0&&(h.protectedHeader=n),e.header!==void 0&&(h.unprotectedHeader=e.header),f?{...h,key:_}:h}async function vt(e,r,t){if(e instanceof Uint8Array&&(e=V.decode(e)),typeof e!="string")throw new w("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:c}=e.split(".");if(c!==3)throw new w("Invalid Compact JWS");let u=await ht({payload:i,protected:n,signature:a},r,t),l={payload:u.payload,protectedHeader:u.protectedHeader};return typeof r=="function"?{...l,key:u.key}:l}var xt=e=>Math.floor(e.getTime()/1e3);var li=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,Er=e=>{let r=li.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let t=parseFloat(r[2]),n=r[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(t*60);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(t*3600);break;case"day":case"days":case"d":i=Math.round(t*86400);break;case"week":case"weeks":case"w":i=Math.round(t*604800);break;default:i=Math.round(t*31557600);break}return r[1]==="-"||r[4]==="ago"?-i:i};var _t=e=>e.includes("/")?e.toLowerCase():\`application/\${e.toLowerCase()}\`,pi=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1;function St(e,r,t={}){let n;try{n=JSON.parse(V.decode(r))}catch{}if(!j(n))throw new Q("JWT Claims Set must be a top-level JSON object");let{typ:i}=t;if(i&&(typeof e.typ!="string"||_t(e.typ)!==_t(i)))throw new N('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:c,subject:u,audience:l,maxTokenAge:f}=t,p=[...a];f!==void 0&&p.push("iat"),l!==void 0&&p.push("aud"),u!==void 0&&p.push("sub"),c!==void 0&&p.push("iss");for(let b of new Set(p.reverse()))if(!(b in n))throw new N(\`missing required "\${b}" claim\`,n,b,"missing");if(c&&!(Array.isArray(c)?c:[c]).includes(n.iss))throw new N('unexpected "iss" claim value',n,"iss","check_failed");if(u&&n.sub!==u)throw new N('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!pi(n.aud,typeof l=="string"?[l]:l))throw new N('unexpected "aud" claim value',n,"aud","check_failed");let y;switch(typeof t.clockTolerance){case"string":y=Er(t.clockTolerance);break;case"number":y=t.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:_}=t,g=xt(_||new Date);if((n.iat!==void 0||f)&&typeof n.iat!="number")throw new N('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new N('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>g+y)throw new N('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new N('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=g-y)throw new fe('"exp" claim timestamp check failed',n,"exp","check_failed")}if(f){let b=g-n.iat,h=typeof f=="number"?f:Er(f);if(b-y>h)throw new fe('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(b<0-y)throw new N('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function Re(e,r,t){let n=await vt(e,r,t);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new Q("JWTs MUST NOT use unencoded payload");let a={payload:St(n.protectedHeader,n.payload,t),protectedHeader:n.protectedHeader};return typeof r=="function"?{...a,key:n.key}:a}function mi(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new z('Unsupported "alg" value for a JSON Web Key Set')}}function di(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(yi)}function yi(e){return j(e)}var Or=class{#t;#a=new WeakMap;constructor(r){if(!di(r))throw new le("JSON Web Key Set malformed");this.#t=structuredClone(r)}jwks(){return this.#t}async getKey(r,t){let{alg:n,kid:i}={...r,...t?.header},a=mi(n),c=this.#t.keys.filter(f=>{let p=a===f.kty;if(p&&typeof i=="string"&&(p=i===f.kid),p&&(typeof f.alg=="string"||a==="AKP")&&(p=n===f.alg),p&&typeof f.use=="string"&&(p=f.use==="sig"),p&&Array.isArray(f.key_ops)&&(p=f.key_ops.includes("verify")),p)switch(n){case"ES256":p=f.crv==="P-256";break;case"ES384":p=f.crv==="P-384";break;case"ES512":p=f.crv==="P-521";break;case"Ed25519":case"EdDSA":p=f.crv==="Ed25519";break}return p}),{0:u,length:l}=c;if(l===0)throw new Z;if(l!==1){let f=new ze,p=this.#a;throw f[Symbol.asyncIterator]=async function*(){for(let y of c)try{yield await wt(p,y,n)}catch{}},f}return wt(this.#a,u,n)}};async function wt(e,r,t){let n=e.get(r)||e.set(r,{}).get(r);if(n[t]===void 0){let i=await at({...r,ext:!0},t);if(i instanceof Uint8Array||i.type!=="public")throw new le("JSON Web Key Set members must be public keys");n[t]=i}return n[t]}function Ir(e){let r=new Or(e),t=async(n,i)=>r.getKey(n,i);return Object.defineProperties(t,{jwks:{value:()=>structuredClone(r.jwks()),enumerable:!1,configurable:!1,writable:!1}}),t}function bi(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var Ar;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(Ar="jose/v6.1.0");var Et=Symbol();async function gi(e,r,t,n=fetch){let i=await n(e,{method:"GET",signal:t,redirect:"manual",headers:r}).catch(a=>{throw a.name==="TimeoutError"?new Pe:a});if(i.status!==200)throw new T("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new T("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var je=Symbol();function hi(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!j(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,j))}var zr=class{#t;#a;#c;#s;#o;#e;#r;#u;#n;#i;constructor(r,t){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this.#t=new URL(r.href),this.#a=typeof t?.timeoutDuration=="number"?t?.timeoutDuration:5e3,this.#c=typeof t?.cooldownDuration=="number"?t?.cooldownDuration:3e4,this.#s=typeof t?.cacheMaxAge=="number"?t?.cacheMaxAge:6e5,this.#r=new Headers(t?.headers),Ar&&!this.#r.has("User-Agent")&&this.#r.set("User-Agent",Ar),this.#r.has("accept")||(this.#r.set("accept","application/json"),this.#r.append("accept","application/jwk-set+json")),this.#u=t?.[Et],t?.[je]!==void 0&&(this.#i=t?.[je],hi(t?.[je],this.#s)&&(this.#o=this.#i.uat,this.#n=Ir(this.#i.jwks)))}pendingFetch(){return!!this.#e}coolingDown(){return typeof this.#o=="number"?Date.now()<this.#o+this.#c:!1}fresh(){return typeof this.#o=="number"?Date.now()<this.#o+this.#s:!1}jwks(){return this.#n?.jwks()}async getKey(r,t){(!this.#n||!this.fresh())&&await this.reload();try{return await this.#n(r,t)}catch(n){if(n instanceof Z&&this.coolingDown()===!1)return await this.reload(),this.#n(r,t);throw n}}async reload(){this.#e&&bi()&&(this.#e=void 0),this.#e||=gi(this.#t.href,this.#r,AbortSignal.timeout(this.#a),this.#u).then(r=>{this.#n=Ir(r),this.#i&&(this.#i.uat=Date.now(),this.#i.jwks=r),this.#o=Date.now(),this.#e=void 0}).catch(r=>{throw this.#e=void 0,r}),await this.#e}};function Pr(e,r){let t=new zr(e,r),n=async(i,a)=>t.getKey(i,a);return Object.defineProperties(n,{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>t.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>t.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function vi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Tr=xi();function xi(){var e,r,t,n,i,a,c,u,l=typeof window<"u"&&typeof window.document<"u";if(l)return{type:"browser",version:window.navigator.userAgent};var f=typeof globalThis<"u"&&((r=globalThis)===null||r===void 0||(e=r.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers";if(f)return{type:"workerd"};var p=typeof EdgeRuntime=="string";if(p)return{type:"edge-runtime"};var y=(typeof self>"u"?"undefined":vi(self))==="object"&&typeof((t=self)===null||t===void 0?void 0:t.importScripts)=="function"&&(((n=self.constructor)===null||n===void 0?void 0:n.name)==="DedicatedWorkerGlobalScope"||((i=self.constructor)===null||i===void 0?void 0:i.name)==="ServiceWorkerGlobalScope"||((a=self.constructor)===null||a===void 0?void 0:a.name)==="SharedWorkerGlobalScope");if(y)return{type:"web-worker"};var _=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";if(_)return{type:"deno",version:Deno.version.deno};var g=typeof Bun<"u"&&typeof Bun.version<"u";if(g)return{type:"bun",version:Bun.version};var b=typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((c=process.versions)===null||c===void 0)&&c.node);if(b)return{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])};var h=typeof navigator<"u"&&((u=navigator)===null||u===void 0?void 0:u.product)==="ReactNative";return h?{type:"react-native"}:{type:"unknown"}}var o={};ei(o,{JsonError:()=>De,ParseError:()=>ke,any:()=>Gt,bigint:()=>zt,boolean:()=>qt,booleanLiteral:()=>Ht,date:()=>Pt,discriminant:()=>so,enum_:()=>Me,getObjectLikeUtils:()=>K,getObjectUtils:()=>$,getSchemaUtils:()=>x,isProperty:()=>G,lazy:()=>Tt,lazyObject:()=>Wt,list:()=>Le,number:()=>$t,object:()=>Be,objectWithoutOptionalProperties:()=>Bt,optional:()=>Cr,property:()=>Dt,record:()=>ro,set:()=>to,string:()=>Xt,stringLiteral:()=>Ft,transform:()=>kr,undiscriminatedUnion:()=>ao,union:()=>uo,unknown:()=>Yt,withParsedProperties:()=>Br});var m={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function Si(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Ot(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function v(e,r){return"Expected ".concat(r,". Received ").concat(wi(e),".")}function wi(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(Si(e,BigInt))return"BigInt";switch(typeof e>"u"?"undefined":Ot(e)){case"string":return'"'.concat(e,'"');case"bigint":case"number":case"boolean":case"undefined":return"".concat(e)}return typeof e>"u"?"undefined":Ot(e)}function Rr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ei(e){if(Array.isArray(e))return Rr(e)}function Oi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ii(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ai(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function zi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Oi(e,i,t[i])})}return e}function Pi(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ti(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pi(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ri(e){return Ei(e)||Ii(e)||ji(e)||Ai()}function ji(e,r){if(e){if(typeof e=="string")return Rr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rr(e,r)}}function A(e){return Ti(zi({},e),{json:It(e.json),parse:It(e.parse)})}function It(e){return function(r,t){var n=e(r,t),i=t??{},a=i.skipValidation,c=a===void 0?!1:a;return!n.ok&&c?(console.warn(["Failed to validate."].concat(Ri(n.errors.map(function(u){return" - "+(u.path.length>0?"".concat(u.path.join("."),": ").concat(u.message):u.message)}))).join(\`\n\`)),{ok:!0,value:r}):n}}function Ue(e){return e.path.length===0?e.message:"".concat(e.path.join(" -> "),": ").concat(e.message)}function Ui(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ni(e,r,t){return r=me(r),Mi(e,Ur()?Reflect.construct(r,t||[],me(e).constructor):r.apply(e,t))}function Di(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ne(e,r,t){return Ur()?Ne=Reflect.construct:Ne=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&de(f,c.prototype),f},Ne.apply(null,arguments)}function Ci(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function me(e){return me=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},me(e)}function ki(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&de(e,r)}function Ki(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Mi(e,r){return r&&(Bi(r)==="object"||typeof r=="function")?r:Ui(e)}function de(e,r){return de=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},de(e,r)}function Bi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function jr(e){var r=typeof Map=="function"?new Map:void 0;return jr=function(n){if(n===null||!Ki(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ne(n,arguments,me(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),de(i,n)},jr(e)}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ur=function(){return!!e})()}var De=function(e){"use strict";ki(r,e);function r(t){Di(this,r);var n;return n=Ni(this,r,[t.map(Ue).join("; ")]),Ci(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(jr(Error));function Li(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Wi(e,r,t){return r=ye(r),Gi(e,Dr()?Reflect.construct(r,t||[],ye(e).constructor):r.apply(e,t))}function Ji(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ce(e,r,t){return Dr()?Ce=Reflect.construct:Ce=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&be(f,c.prototype),f},Ce.apply(null,arguments)}function Vi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ye(e){return ye=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ye(e)}function Fi(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&be(e,r)}function Hi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Gi(e,r){return r&&(qi(r)==="object"||typeof r=="function")?r:Li(e)}function be(e,r){return be=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},be(e,r)}function qi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Nr(e){var r=typeof Map=="function"?new Map:void 0;return Nr=function(n){if(n===null||!Hi(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ce(n,arguments,ye(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),be(i,n)},Nr(e)}function Dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Dr=function(){return!!e})()}var ke=function(e){"use strict";Fi(r,e);function r(t){Ji(this,r);var n;return n=Wi(this,r,[t.map(Ue).join("; ")]),Vi(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r}(Nr(Error));function $i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ke(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){$i(e,i,t[i])})}return e}function x(e){return{nullable:function(){return Xi(e)},optional:function(){return Cr(e)},optionalNullable:function(){return Yi(e)},transform:function(r){return kr(e,r)},parseOrThrow:function(r,t){var n=e.parse(r,t);if(n.ok)return n.value;throw new ke(n.errors)},jsonOrThrow:function(r,t){var n=e.json(r,t);if(n.ok)return n.value;throw new De(n.errors)}}}function Xi(e){var r={parse:function(t,n){return t==null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.NULLABLE}};return Ke({},r,x(r))}function Cr(e){var r={parse:function(t,n){return t==null?{ok:!0,value:void 0}:e.parse(t,n)},json:function(t,n){return n?.omitUndefined&&t===void 0?{ok:!0,value:void 0}:t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL}};return Ke({},r,x(r))}function Yi(e){var r={parse:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return m.OPTIONAL_NULLABLE}};return Ke({},r,x(r))}function kr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);return a.ok?{ok:!0,value:r.transform(a.value)}:a},json:function(n,i){var a=r.untransform(n);return e.json(a,i)},getType:function(){return e.getType()}};return Ke({},t,x(t))}function Qi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Zi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Qi(e,i,t[i])})}return e}function At(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function zt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":At(r))==="bigint"?{ok:!0,value:r}:typeof r=="number"?{ok:!0,value:BigInt(r)}:{ok:!1,errors:[{path:i,message:v(r,"bigint | number")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":At(r))!=="bigint"?{ok:!1,errors:[{path:i,message:v(r,"bigint")}]}:{ok:!0,value:r}},getType:function(){return m.BIGINT}};return Zi({},A(e),x(e))}function ea(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ra(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function ta(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ea(e,i,t[i])})}return e}var oa=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;function Pt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return typeof r!="string"?{ok:!1,errors:[{path:i,message:v(r,"string")}]}:oa.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:i,message:v(r,"ISO 8601 date string")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return ra(r,Date)?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:i,message:v(r,"Date object")}]}},getType:function(){return m.DATE}};return ta({},A(e),x(e))}function na(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ia(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){na(e,i,t[i])})}return e}function R(e,r){return function(){var t={parse:r,json:r,getType:function(){return e}};return ia({},A(t),x(t))}}function Me(e){var r=new Set(e),t=R(m.ENUM,function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.allowUnrecognizedEnumValues,c=i.breadcrumbsPrefix,u=c===void 0?[]:c;return typeof n!="string"?{ok:!1,errors:[{path:u,message:v(n,"string")}]}:!r.has(n)&&!a?{ok:!1,errors:[{path:u,message:v(n,"enum")}]}:{ok:!0,value:n}});return t()}function aa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function sa(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){aa(e,i,t[i])})}return e}function Tt(e){var r=Kr(e);return sa({},r,x(r))}function Kr(e){return{parse:function(r,t){return ne(e).parse(r,t)},json:function(r,t){return ne(e).json(r,t)},getType:function(){return ne(e).getType()}}}function ne(e){var r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function ge(e){return Object.entries(e)}function Rt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ca(e){if(Array.isArray(e))return e}function ua(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function fa(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function la(e,r){return ca(e)||ua(e,r)||pa(e,r)||fa()}function pa(e,r){if(e){if(typeof e=="string")return Rt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Rt(e,r)}}function he(e,r){var t=new Set(r);return Object.entries(e).reduce(function(n,i){var a=la(i,2),c=a[0],u=a[1];return t.has(c)&&(n[c]=u),n},{})}function ma(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function H(e){if((typeof e>"u"?"undefined":ma(e))!=="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function ve(e){return Object.keys(e)}function jt(e,r){var t=[],n=[],i=!0,a=!1,c=void 0;try{for(var u=e[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=l.value;r(f)?t.push(f):n.push(f)}}catch(p){a=!0,c=p}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return[t,n]}function Ut(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function da(e){if(Array.isArray(e))return e}function Nt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ya(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function ba(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Mr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Nt(e,i,t[i])})}return e}function ga(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ha(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ga(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function va(e,r){return da(e)||ya(e,r)||xa(e,r)||ba()}function xa(e,r){if(e){if(typeof e=="string")return Ut(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ut(e,r)}}function K(e){return{withParsedProperties:function(r){return Br(e,r)}}}function Br(e,r){var t={parse:function(n,i){var a=e.parse(n,i);if(!a.ok)return a;var c=Object.entries(r).reduce(function(u,l){var f=va(l,2),p=f[0],y=f[1];return ha(Mr({},u),Nt({},p,typeof y=="function"?y(a.value):y))},{});return{ok:!0,value:Mr({},a.value,c)}},json:function(n,i){if(!H(n)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"object")}]}}var c=new Set(Object.keys(r)),u=he(n,Object.keys(n).filter(function(l){return!c.has(l)}));return e.json(u,i)},getType:function(){return e.getType()}};return Mr({},t,x(t),K(t))}function Dt(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function G(e){return e.isProperty}function Lr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _a(e){if(Array.isArray(e))return e}function Sa(e){if(Array.isArray(e))return Lr(e)}function wa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ea(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Oa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Ia(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Aa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){wa(e,i,t[i])})}return e}function za(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function xe(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):za(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function _e(e,r){return _a(e)||Oa(e,r)||Mt(e,r)||Ia()}function C(e){return Sa(e)||Ea(e)||Mt(e)||Aa()}function Mt(e,r){if(e){if(typeof e=="string")return Lr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lr(e,r)}}function Be(e){var r={_getRawProperties:function(){return Object.entries(e).map(function(t){var n=_e(t,2),i=n[0],a=n[1];return G(a)?a.rawKey:i})},_getParsedProperties:function(){return ve(e)},parse:function(t,n){var i={},a=[],c=!0,u=!1,l=void 0;try{for(var f=ge(e)[Symbol.iterator](),p;!(c=(p=f.next()).done);c=!0){var y=_e(p.value,2),_=y[0],g=y[1],b=G(g)?g.rawKey:_,h=G(g)?g.valueSchema:g,I={rawKey:b,parsedKey:_,valueSchema:h};i[b]=I,Kt(h)&&a.push(b)}}catch(S){u=!0,l=S}finally{try{!c&&f.return!=null&&f.return()}finally{if(u)throw l}}return Ct({value:t,requiredKeys:a,getProperty:function(S){var D=i[S];if(D!=null)return{transformedKey:D.parsedKey,transform:function(k){var U;return D.valueSchema.parse(k,xe(M({},n),{breadcrumbsPrefix:C((U=n?.breadcrumbsPrefix)!==null&&U!==void 0?U:[]).concat([S])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:function(t,n){var i=[],a=!0,c=!1,u=void 0;try{for(var l=ge(e)[Symbol.iterator](),f;!(a=(f=l.next()).done);a=!0){var p=_e(f.value,2),y=p[0],_=p[1],g=G(_)?_.valueSchema:_;Kt(g)&&i.push(y)}}catch(b){c=!0,u=b}finally{try{!a&&l.return!=null&&l.return()}finally{if(c)throw u}}return Ct({value:t,requiredKeys:i,getProperty:function(b){var h=e[b];if(h!=null)return G(h)?{transformedKey:h.rawKey,transform:function(I){var S;return h.valueSchema.json(I,xe(M({},n),{breadcrumbsPrefix:C((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}:{transformedKey:b,transform:function(I){var S;return h.json(I,xe(M({},n),{breadcrumbsPrefix:C((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:function(){return m.OBJECT}};return M({},A(r),x(r),K(r),$(r))}function Ct(e){var r=e.value,t=e.requiredKeys,n=e.getProperty,i=e.unrecognizedObjectKeys,a=i===void 0?"fail":i,c=e.skipValidation,u=c===void 0?!1:c,l=e.breadcrumbsPrefix,f=l===void 0?[]:l,p;if(!H(r))return{ok:!1,errors:[{path:f,message:v(r,"object")}]};var y=new Set(t),_=[],g={},b=!0,h=!1,I=void 0;try{for(var S=Object.entries(r)[Symbol.iterator](),D;!(b=(D=S.next()).done);b=!0){var k=_e(D.value,2),U=k[0],yr=k[1],br=n(U);if(br!=null){y.delete(U);var gr=br.transform(yr);if(gr.ok)g[br.transformedKey]=gr.value;else{var Qr;g[U]=yr,(Qr=_).push.apply(Qr,C(gr.errors))}}else switch(a){case"fail":_.push({path:C(f).concat([U]),message:'Unexpected key "'.concat(U,'"')});break;case"strip":break;case"passthrough":g[U]=yr;break}}}catch(ue){h=!0,I=ue}finally{try{!b&&S.return!=null&&S.return()}finally{if(h)throw I}}return(p=_).push.apply(p,C(t.filter(function(ue){return y.has(ue)}).map(function(ue){return{path:f,message:'Missing required key "'.concat(ue,'"')}}))),_.length===0||u?{ok:!0,value:g}:{ok:!1,errors:_}}function $(e){return{extend:function(r){var t={_getParsedProperties:function(){return C(e._getParsedProperties()).concat(C(r._getParsedProperties()))},_getRawProperties:function(){return C(e._getRawProperties()).concat(C(r._getRawProperties()))},parse:function(n,i){return kt({extensionKeys:r._getRawProperties(),value:n,transformBase:function(a){return e.parse(a,i)},transformExtension:function(a){return r.parse(a,i)}})},json:function(n,i){return kt({extensionKeys:r._getParsedProperties(),value:n,transformBase:function(a){return e.json(a,i)},transformExtension:function(a){return r.json(a,i)}})},getType:function(){return m.OBJECT}};return M({},t,x(t),K(t),$(t))},passthrough:function(){var r={_getParsedProperties:function(){return e._getParsedProperties()},_getRawProperties:function(){return e._getRawProperties()},parse:function(t,n){var i=e.parse(t,xe(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},json:function(t,n){var i=e.json(t,xe(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},getType:function(){return m.OBJECT}};return M({},r,x(r),K(r),$(r))}}}function kt(e){var r=e.extensionKeys,t=e.value,n=e.transformBase,i=e.transformExtension,a=new Set(r),c=_e(jt(ve(t),function(y){return a.has(y)}),2),u=c[0],l=c[1],f=n(he(t,l)),p=i(he(t,u));return f.ok&&p.ok?{ok:!0,value:M({},f.value,p.value)}:{ok:!1,errors:C(f.ok?[]:f.errors).concat(C(p.ok?[]:p.errors))}}function Kt(e){return!Pa(e)}function Pa(e){switch(e.getType()){case m.ANY:case m.UNKNOWN:case m.OPTIONAL:case m.OPTIONAL_NULLABLE:return!0;default:return!1}}function Bt(e){return Be(e)}function Ta(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Lt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ta(e,i,t[i])})}return e}function Ra(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function ja(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ra(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Wt(e){var r=ja(Lt({},Kr(e)),{_getRawProperties:function(){return ne(e)._getRawProperties()},_getParsedProperties:function(){return ne(e)._getParsedProperties()}});return Lt({},r,x(r),K(r),$(r))}function Jr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ua(e){if(Array.isArray(e))return Jr(e)}function Na(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Da(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ca(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Wr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Na(e,i,t[i])})}return e}function ka(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Jt(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Se(e){return Ua(e)||Da(e)||Ka(e)||Ca()}function Ka(e,r){if(e){if(typeof e=="string")return Jr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jr(e,r)}}function Le(e){var r={parse:function(t,n){return Vt(t,function(i,a){var c;return e.parse(i,Jt(Wr({},n),{breadcrumbsPrefix:Se((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},json:function(t,n){return Vt(t,function(i,a){var c;return e.json(i,Jt(Wr({},n),{breadcrumbsPrefix:Se((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},getType:function(){return m.LIST}};return Wr({},A(r),x(r))}function Vt(e,r){if(!Array.isArray(e))return{ok:!1,errors:[{message:v(e,"list"),path:[]}]};var t=e.map(function(n,i){return r(n,i)});return t.reduce(function(n,i){if(n.ok&&i.ok)return{ok:!0,value:Se(n.value).concat([i.value])};var a=[];if(!n.ok){var c;(c=a).push.apply(c,Se(n.errors))}if(!i.ok){var u;(u=a).push.apply(u,Se(i.errors))}return{ok:!1,errors:a}},{ok:!0,value:[]})}function Ft(e){var r=R(m.STRING_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,'"'.concat(e,'"'))}]}});return r()}function Ht(e){var r=R(m.BOOLEAN_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,"".concat(e.toString()))}]}});return r()}var Gt=R(m.ANY,function(e){return{ok:!0,value:e}});var qt=R(m.BOOLEAN,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"boolean")}]}});var $t=R(m.NUMBER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"number")}]}});var Xt=R(m.STRING,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"string")}]}});var Yt=R(m.UNKNOWN,function(e){return{ok:!0,value:e}});function Vr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ma(e){if(Array.isArray(e))return e}function Ba(e){if(Array.isArray(e))return Vr(e)}function Zt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function La(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Wa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Ja(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Va(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Zt(e,i,t[i])})}return e}function Fa(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function we(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ha(e,r){return Ma(e)||Wa(e,r)||eo(e,r)||Ja()}function X(e){return Ba(e)||La(e)||eo(e)||Va()}function eo(e,r){if(e){if(typeof e=="string")return Vr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Vr(e,r)}}function ro(e,r){var t={parse:function(n,i){return Qt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.parse(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.parse(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},json:function(n,i){return Qt({value:n,isKeyNumeric:e.getType()===m.NUMBER,transformKey:function(a){var c;return e.json(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.json(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},getType:function(){return m.RECORD}};return ie({},A(t),x(t))}function Qt(e){var r=e.value,t=e.isKeyNumeric,n=e.transformKey,i=e.transformValue,a=e.breadcrumbsPrefix,c=a===void 0?[]:a;return H(r)?ge(r).reduce(function(u,l){var f=Ha(l,2),p=f[0],y=f[1];if(y===void 0)return u;var _=u,g=p;if(t){var b=p.length>0?Number(p):NaN;isNaN(b)||(g=b)}var h=n(g),I=i(y,g);if(_.ok&&h.ok&&I.ok)return{ok:!0,value:we(ie({},_.value),Zt({},h.value,I.value))};var S=[];if(!_.ok){var D;(D=S).push.apply(D,X(_.errors))}if(!h.ok){var k;(k=S).push.apply(k,X(h.errors))}if(!I.ok){var U;(U=S).push.apply(U,X(I.errors))}return{ok:!1,errors:S}},{ok:!0,value:{}}):{ok:!1,errors:[{path:c,message:v(r,"object")}]}}function Fr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Ga(e){if(Array.isArray(e))return Fr(e)}function qa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function $a(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function Xa(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ya(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Qa(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){qa(e,i,t[i])})}return e}function Za(e){return Ga(e)||Xa(e)||es(e)||Ya()}function es(e,r){if(e){if(typeof e=="string")return Fr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Fr(e,r)}}function to(e){var r=Le(e),t={parse:function(n,i){var a=r.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:function(n,i){if(!$a(n,Set)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"Set")}]}}var c=r.json(Za(n),i);return c},getType:function(){return m.SET}};return Qa({},A(t),x(t))}function oo(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function rs(e){if(Array.isArray(e))return e}function ts(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function os(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function ns(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function io(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ts(e,i,t[i])})}return e}function is(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function as(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):is(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ss(e,r){return rs(e)||os(e,r)||cs(e,r)||ns()}function cs(e,r){if(e){if(typeof e=="string")return oo(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return oo(e,r)}}function ao(e){var r={parse:function(t,n){return no(function(i,a){return i.parse(t,a)},e,n)},json:function(t,n){return no(function(i,a){return i.json(t,a)},e,n)},getType:function(){return m.UNDISCRIMINATED_UNION}};return io({},A(r),x(r))}function no(e,r,t){var n=[],i=!0,a=!1,c=void 0;try{for(var u=r.entries()[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=ss(l.value,2),p=f[0],y=f[1],_=e(y,as(io({},t),{skipValidation:!1}));if(_.ok)return _;var g=!0,b=!1,h=void 0;try{for(var I=_.errors[Symbol.iterator](),S;!(g=(S=I.next()).done);g=!0){var D=S.value;n.push({path:D.path,message:"[Variant ".concat(p,"] ").concat(D.message)})}}catch(k){b=!0,h=k}finally{try{!g&&I.return!=null&&I.return()}finally{if(b)throw h}}}}catch(k){a=!0,c=k}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return{ok:!1,errors:n}}function so(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}function Hr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function us(e){if(Array.isArray(e))return Hr(e)}function Gr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function fs(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ls(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function qr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Gr(e,i,t[i])})}return e}function ps(e,r){if(e==null)return{};var t=ms(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function ms(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function $r(e){return us(e)||fs(e)||bs(e)||ls()}function ds(e,r){if(Xr(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(Xr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function ys(e){var r=ds(e,"string");return Xr(r)==="symbol"?r:String(r)}function Xr(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function bs(e,r){if(e){if(typeof e=="string")return Hr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Hr(e,r)}}function uo(e,r){var t=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=Me(ve(r)),a={parse:function(c,u){return co({value:c,discriminant:t,transformedDiscriminant:n,transformDiscriminantValue:function(l){var f;return i.parse(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:$r((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([t])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.parse(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},json:function(c,u){return co({value:c,discriminant:n,transformedDiscriminant:t,transformDiscriminantValue:function(l){var f;return i.json(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:$r((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([n])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.json(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},getType:function(){return m.UNION}};return qr({},A(a),x(a),K(a))}function co(e){var r=e.value,t=e.discriminant,n=e.transformedDiscriminant,i=e.transformDiscriminantValue,a=e.getAdditionalPropertiesSchema,c=e.allowUnrecognizedUnionMembers,u=c===void 0?!1:c,l=e.transformAdditionalProperties,f=e.breadcrumbsPrefix,p=f===void 0?[]:f;if(!H(r))return{ok:!1,errors:[{path:p,message:v(r,"object")}]};var y=r[t],_=ps(r,[t].map(ys));if(y==null)return{ok:!1,errors:[{path:p,message:'Missing discriminant ("'.concat(t,'")')}]};var g=i(y);if(!g.ok)return{ok:!1,errors:g.errors};var b=a(g.value);if(b==null)return u?{ok:!0,value:qr(Gr({},n,g.value),_)}:{ok:!1,errors:[{path:$r(p).concat([t]),message:"Unexpected discriminant value"}]};var h=l(_,b);return h.ok?{ok:!0,value:qr(Gr({},n,y),h.value)}:h}var E=o.object({organizationId:o.string(),agentId:o.string(),settings:o.record(o.string(),o.unknown())});var fo=o.object({}).extend(E);var lo=o.object({}).extend(E);var po=o.object({}).extend(E);var mo=o.enum_(["AGENT","CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_BASE_VERSION","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK","INBOX_ITEM","INBOX_ITEM_FIX","SEGMENT","CUSTOMER"]);var O=o.object({referenceId:o.string()});var P=o.object({type:mo,appId:o.string()}).extend(O);var d=o.object({organizationId:o.string(),agentId:o.string()}).extend(P);var We=o.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var yo=o.object({type:We,text:o.string().optional()});var bo=o.object({feedbackId:d,conversationId:d,conversationMessageId:d,userId:d.optional(),createdAt:o.date().optional()}).extend(yo);var go=o.object({feedbacks:o.list(bo)}).extend(E);var q=o.enum_(["BUTTON_CLICKED","LINK_CLICKED","CHAT_OPENED","CHAT_CLOSED","TEXT_INSERTED"]);var ho=o.object({id:d.optional(),userDisplayName:o.string().optional()});var vo=o.object({surveyQuestion:o.string().optional(),surveyAnswer:o.string().optional()});var Je=o.object({rating:o.number().optional(),thumbUp:o.boolean().optional(),survey:vo.optional()});var Ve=o.object({pageName:o.string().optional(),pageUrl:o.string().optional(),pageTitle:o.string().optional(),linkUrl:o.string().optional(),elementId:o.string().optional()});var ae=o.object({entityId:d,scopeEntityId:d.optional()});var xo=o.enum_(["WEB","API","SYSTEM"]);var _o=o.enum_(["DESKTOP","MOBILE","TABLET","OTHER"]);var So=o.enum_(["WINDOWS","MACOS","LINUX","ANDROID","IOS","OTHER"]);var wo=o.object({type:So.optional(),name:o.string().optional(),version:o.string().optional()});var Eo=o.object({type:_o,name:o.string().optional(),version:o.string().optional(),osInfo:wo.optional()});var Oo=o.enum_(["CHROME","FIREFOX","SAFARI","OPERA","EDGE","OTHER"]);var Io=o.object({type:Oo,name:o.string().optional(),version:o.string().optional(),userAgent:o.string().optional()});var Ao=o.object({city:o.string().optional(),state:o.string().optional(),country:o.string().optional(),region:o.string().optional(),latitude:o.number().optional(),longitude:o.number().optional()});var zo=o.object({ip:o.string().optional()});var Po=o.object({code:o.string().optional()});var To=o.object({type:xo,deviceInfo:Eo.optional(),browserInfo:Io.optional(),geoInfo:Ao.optional(),ipInfo:zo.optional(),languageInfo:Po.optional()});var Ro=o.object({id:o.string(),start:o.date().optional(),end:o.date().optional(),duration:o.number().optional()});var jo=o.object({additionalData:o.record(o.string(),o.string())});var se=o.object({timestamp:o.date().optional(),references:o.list(ae).optional(),sourceInfo:To.optional(),sessionInfo:Ro.optional(),contextInfo:jo.optional()});var Uo=o.object({id:d,eventName:q,userInfo:ho,feedbackInfo:o.list(Je).optional(),pageInfo:Ve.optional()}).extend(se);var Fe=o.enum_(["APP_INSTALLED","APP_UNINSTALLED","APP_UPDATED"]);var He=o.object({eventName:Fe}).extend(se);var No=o.object({id:d}).extend(He);var Ge=o.union("eventType",{userEvent:Uo,systemEvent:No}).transform({transform:function(e){return e},untransform:function(e){return e}});var Do=o.object({events:o.list(Ge)}).extend(E);var Co=o.object({conversations:o.list(d)}).extend(E);var ko=o.object({inboxItemIds:o.list(d)}).extend(E);var Ko=o.enum_(["EMAIL","PHONE_NUMBER"]);var qe=o.object({value:o.string(),type:Ko});var Mo=o.object({userId:O.optional(),userIdentifiers:o.list(qe),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())});var Bo=o.object({actionId:o.string(),conversationId:d.optional(),conversationMetadata:o.record(o.string(),o.string()),parameters:o.record(o.string(),o.unknown()),user:Mo,transientData:o.record(o.string(),o.string()).optional()}).extend(E);var kd=o.object({response:o.string()});var Lo=o.object({knowledgeBaseId:O}).extend(E);var Wo=o.enum_(["PENDING","PROCESSING","ACCEPTED","REJECTED"]);var $e=o.object({type:o.string(),name:o.string().optional()});var ce=o.object({url:o.string().optional(),sizeBytes:o.number().optional(),status:Wo}).extend($e);var Xe=o.enum_(["SENDING","SENT","REJECTED","CANCELED","FAILED","UNKNOWN"]);var Jo=o.enum_(["NOT_ASKED","LLM_ENABLED","LLM_DISABLED"]);var Vo=o.enum_(["USER","HUMAN_AGENT","EXTERNAL_SYSTEM"]);var Ye=o.object({createdAt:o.date().optional(),updatedAt:o.date().optional()});var Fo=o.object({userId:O,text:o.string(),userMessageType:Vo}).extend(Ye);var Ho=o.object({conversationMessageId:d,language:o.string().optional(),attachments:o.list(ce),agentUserId:o.string().optional(),userDisplayName:o.string().optional(),status:Xe,responseState:Jo.optional()}).extend(Fo);var Go=o.enum_(["BOT_RESPONSE","BOT_SUGGESTION"]);var qo=o.object({text:o.string()});var Qe=o.enum_(["STRING","MULTILINE","BOOLEAN","NUMBER","DATETIME","DATE","TIME","EMAIL","SCHEMA","FILE","OAUTH"]);var Ze=o.object({label:o.string(),value:o.unknown()});var $o=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),suggestion:o.unknown().optional(),type:Qe,enumOptions:o.list(Ze).optional()});var Xo=o.object({id:o.string(),actionId:P,formLabel:o.string(),fields:o.list($o),submitLabel:o.string()});var Yo=o.object({buttonName:o.string(),url:o.string().optional()});var Qo=o.enum_(["HIGHCHARTS_TS"]);var Zo=o.object({label:o.string(),specSchema:Qo,spec:o.string()});var en=o.object({label:o.string().optional(),object:o.unknown()});var rn=o.union("type",{text:qo,actionForm:Xo,oauthButton:Yo,chart:Zo,object:en}).transform({transform:function(e){return e},untransform:function(e){return e}});var tn=o.object({title:o.string(),url:o.string()});var on=o.object({followupQuestions:o.list(o.string()),sources:o.list(tn),language:o.string().optional()});var Yr=o.object({knowledgeBaseId:P,documentId:P,documentName:o.string(),documentExcerpt:o.string()});var nn=o.object({knowledgeReviewed:o.list(Yr),knowledgeUtilized:o.list(Yr)});var er=o.object({actionId:P,actionName:o.string()});var an=o.union("valueType",{primitive:o.object({value:o.unknown()}),attachment:ce}).transform({transform:function(e){return e},untransform:function(e){return e}});var rr=o.object({actionParameters:o.record(o.string(),an),executionResult:o.string().optional(),executionError:o.string().optional()}).extend(er);var sn=o.object({actionsReviewed:o.list(er),actionsExecuted:o.list(rr)});var cn=o.object({}).extend(rr);var un=o.object({safetyCheckPassed:o.boolean()});var fn=o.object({userData:o.record(o.string(),o.string())});var ln=o.object({matchingSegmentIds:o.list(d)});var pn=o.union("type",{knowledge:nn,actions:sn,form:cn,safety:un,user:fn,segments:ln}).transform({transform:function(e){return e},untransform:function(e){return e}});var mn=o.object({items:o.list(pn)});var dn=o.object({conversationMessageId:d,botMessageType:Go,responses:o.list(rn),metadata:on,status:Xe,logic:mn.optional()}).extend(Ye);var tr=o.union("type",{user:Ho,bot:dn}).transform({transform:function(e){return e},untransform:function(e){return e}});var yn=o.object({conversationId:d,message:tr}).extend(E);var Nb=o.object({message:o.string().optional()});var bn=o.object({referenceId:o.string(),appId:o.string()});var Kb=o.object({name:o.string().optional()}).extend(bn);var or=o.enum_(["USER","SYSTEM"]);var nr=o.object({id:O});var qb=o.object({id:O,eventName:q,eventType:or,userInfo:nr.optional(),timestamp:o.date().optional(),reference:ae.optional()});var gn=o.object({id:O,eventName:q,userInfo:nr,feedbackInfo:o.list(Je).optional(),pageInfo:Ve.optional()}).extend(se);var hn=o.object({id:O}).extend(He);var cg=o.union("eventType",{userEvent:gn,systemEvent:hn}).transform({transform:function(e){return e},untransform:function(e){return e}});var vn=o.enum_(["CREATED_AT"]);var xn=o.object({search:o.string().optional(),createdAfter:o.date().optional(),createdBefore:o.date().optional(),references:o.list(ae).optional(),eventTypes:o.list(or).optional(),userEventNames:o.list(q).optional(),systemEventNames:o.list(Fe).optional(),agentUserIds:o.list(o.string()).optional(),legacyFeedbackTypes:o.list(We).optional(),hasEventText:o.boolean().optional()});var ir=o.object({page:o.number().optional(),size:o.number().optional(),sortDesc:o.boolean().optional()});var _g=o.object({sort:vn.optional(),filter:xn.optional()}).extend(ir);var _n=o.object({number:o.number(),size:o.number(),totalElements:o.number(),totalPages:o.number()});var Ig=o.object({events:o.list(Ge)}).extend(_n);var Sn=o.enum_(["text","array","complexarray","color","image","multiline","checkbox","dropdown","section","oauth"]);var ar=o.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var wn=o.object({pattern:o.string(),errorMessage:o.string()});var En=o.object({key:o.string(),displayName:o.string(),description:o.string().optional(),type:Sn,visibility:ar.optional(),required:o.boolean().optional(),defaultValue:o.unknown().optional(),validation:wn.optional(),fields:o.lazy(function(){return On}).optional(),dropdownOptions:o.list(o.string()).optional(),oauthProvider:o.string().optional(),oauthScopes:o.list(o.string()).optional(),oauthRedirectUri:o.string().optional(),oauthClientId:o.string().optional(),oauthServiceDesired:o.string().optional(),oauthAuthorizationUrl:o.string().optional(),oauthClientSecret:o.string().optional(),oauthTokenUrl:o.string().optional(),oauthAccountUrl:o.string().optional()});var On=o.list(o.lazyObject(function(){return En}));var In=o.object({value:o.string(),visibility:ar});var sr=o.object({identifiers:o.list(qe),data:o.record(o.string(),In)});var Jg=o.object({userId:O}).extend(sr);var Gg=o.object({userId:d,agentUserId:o.string(),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string())}).extend(sr);var Xg=o.object({sortId:o.string().optional()}).extend(ir);var An=o.enum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var zn=o.enum_(["GOOD","NEEDS_IMPROVEMENT","UNKNOWN"]);var Pn=o.enum_(["MISSING_KNOWLEDGE","MISSING_USER_INFORMATION","MISSING_ACTION","NEEDS_USER_CLARIFICATION","UNSUPPORTED_FORMAT","INTERRUPTED","UNSUPPORTED_USER_BEHAVIOR","UNKNOWN","NO_BOT_REPLIES"]);var Tn=o.object({actionIds:o.list(P),incompleteActionIds:o.list(P),insertCount:o.number(),thumbsUpCount:o.number(),thumbsDownCount:o.number(),userMessageCount:o.number(),handleTime:o.number().optional(),humanAgentResponseDelay:o.number().optional(),humanAgents:o.list(o.string()),humanAgentsWithInserts:o.list(o.string()),users:o.list(o.string())});var Rn=o.object({userRequest:o.string().optional(),agentResponse:o.string().optional(),resolutionStatus:o.string().optional(),category:o.string().optional(),sentiment:An.optional(),quality:zn.optional(),qualityReason:Pn.optional(),resolvedByMaven:o.boolean().optional(),primaryLanguage:o.string().optional(),predictedNps:o.number().optional()});var jn=o.object({conversationId:P});var cr=o.enum_(["SHORT","MEDIUM","LONG"]);var Un=o.enum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS","ASYNC","OAUTH_BUTTONS"]);var Nn=o.object({capabilities:o.list(Un),isCopilot:o.boolean(),responseLength:cr});var Dn=o.enum_(["CASUAL_BUDDY","EMPATHETIC_SUPPORTER","FORMAL_PROFESSIONAL","CONCISE_EXPERT","ENTHUSIASTIC_HELPER","PATIENT_EDUCATOR","PIRATE"]);var Cn=o.object({persona:Dn.optional(),availableKnowledgeBases:o.list(d).optional()});var ur=o.object({responseConfig:Nn.optional(),subject:o.string().optional(),url:o.string().optional(),createdAt:o.date().optional(),updatedAt:o.date().optional(),tags:o.set(o.string()).optional(),metadata:o.record(o.string(),o.string()).optional(),allMetadata:o.record(o.string(),o.record(o.string(),o.string())),conversationId:d,analysis:Rn,summary:Tn,deleted:o.boolean(),open:o.boolean(),llmEnabled:o.boolean(),simulationContext:Cn.optional()});var Ah=o.object({messages:o.list(tr),attachments:o.list(ce)}).extend(ur);var Th=o.object({}).extend(ur);var Nh=o.object({content:o.string().optional(),assetId:O.optional()}).extend($e);var kn=o.object({authorizationUrl:o.string(),tokenUrl:o.string(),clientId:o.string(),clientSecret:o.string(),scopes:o.list(o.string()),extraAuthParams:o.record(o.string(),o.string()).optional(),extraTokenParams:o.record(o.string(),o.string()).optional()});var Kn=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),hidden:o.boolean().optional(),type:Qe.optional(),enumOptions:o.list(Ze).optional(),schema:o.string().optional(),oauthConfiguration:kn.optional()});var Mn=o.object({name:o.string(),description:o.string(),userInteractionRequired:o.boolean(),buttonName:o.string().optional(),precondition:o.lazy(function(){return fr}).optional(),userFormParameters:o.list(Kn),language:o.string().optional()});var Bn=o.enum_(["ALWAYS","WHEN_RELEVANT","NEVER"]);var Gh=o.object({actionId:d,instructions:o.string().optional(),llmInclusionStatus:Bn,segmentId:d.optional(),preconditionExplanation:o.string().optional(),deleted:o.boolean()}).extend(Mn);var Ln=o.enum_(["NOT"]);var L=o.object({operator:Ln.optional()});var lr=o.object({key:o.string(),value:o.string().optional()}).extend(L);var Wn=o.object({tags:o.set(o.string())}).extend(L);var Jn=o.object({actionId:o.string(),appId:o.string().optional()}).extend(L);var Vn=o.object({useMarkdown:o.boolean().optional(),useForms:o.boolean().optional(),useImages:o.boolean().optional(),isCopilot:o.boolean().optional(),responseLength:cr.optional()}).extend(L);var Fn=o.object({appId:o.string()}).extend(L);var Hn=o.union("conversationPreconditionType",{tags:Wn,metadata:lr,actionExecuted:Jn,responseConfig:Vn,app:Fn}).transform({transform:function(e){return e},untransform:function(e){return e}});var fr=o.union("preconditionType",{user:lr,conversation:o.object({value:Hn}),group:o.lazyObject(function(){return Gn})}).transform({transform:function(e){return e},untransform:function(e){return e}});var qn=o.enum_(["AND","OR"]);var Gn=o.object({operator:qn,preconditions:o.list(o.lazy(function(){return fr}))});var Oe=o.object({knowledgeBaseId:P,documentId:P,title:o.string().optional(),snippet:o.string().optional()});var $n=o.enum_(["OPEN","USER_RESOLVED","SYSTEM_RESOLVED","REGRESSED","IGNORED"]);var Ev=o.enum_(["DUPLICATE_DOCUMENT","MISSING_KNOWLEDGE"]);var Xn=o.enum_(["LOW","MEDIUM","HIGH"]);var pr=o.object({id:d});var Ie=o.object({documentInformation:Oe}).extend(pr);var mr=o.object({id:d,createdAt:o.date(),updatedAt:o.date(),status:$n,severity:Xn});var Yn=o.object({recommendedFixes:o.list(Ie),otherFixes:o.list(Ie),sourceDocument:Oe,documents:o.list(Oe)}).extend(mr);var dr=o.object({suggestedTextTitle:o.string(),suggestedText:o.string()}).extend(pr);var Qn=o.object({fix:dr,conversations:o.list(jn)}).extend(mr);var qv=o.union("type",{duplicateDocuments:Yn,missingKnowledge:Qn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Qv=o.union("type",{addDocument:dr,deactivateDocument:Ie}).transform({transform:function(e){return e},untransform:function(e){return e}});var ex=o.object({greaterThanOrEqual:o.number().optional(),lessThan:o.number().optional()});import W from"../..";async function J(e){let r=e.headers.get("authorization").replace("Bearer ","");if(process.env.MAVENAGI_WEBHOOK_SECRET){let a=await crypto.subtle.importKey("raw",Buffer.from(process.env.MAVENAGI_WEBHOOK_SECRET,"base64"),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);await Re(r,a,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID});return}let n=\`https://developers\${process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`}.mavenagi-apis.com/.well-known/jwks\`,i=Pr(new URL(n));await Re(r,i,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function JS(e){await J(e);let{organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f}=Bo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let p=await W.executeAction?.({organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f});return new Response(JSON.stringify({response:p}),{status:200,headers:{"Content-Type":"application/json"}})}catch(p){return console.error(p),p instanceof Error?new Response(p.message,{status:500}):new Response("No result returned",{status:204})}}async function VS(e){await J(e);let{organizationId:r,agentId:t,settings:n,feedbacks:i}=go.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.feedbackCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,feedbacks:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function FS(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversations:i}=Co.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.conversationCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,conversations:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function HS(e){await J(e);let{organizationId:r,agentId:t,settings:n,inboxItemIds:i}=ko.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.inboxItemCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,inboxItemIds:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function GS(e){await J(e);let{organizationId:r,agentId:t,settings:n,events:i}=Do.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.eventCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,events:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function qS(e){await J(e);let{organizationId:r,agentId:t,settings:n,knowledgeBaseId:i}=Lo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.knowledgeBaseRefreshed?.({organizationId:r,agentId:t,knowledgeBaseId:i,settings:n}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function $S(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversationId:i,message:a}=yn.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.handleMessage?.({organizationId:r,agentId:t,conversationId:i,message:a,settings:n}),new Response(null)}catch(c){return console.error(c),c instanceof Error?new Response(c.message,{status:500}):new Response("Unknown error",{status:500})}}async function XS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=lo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.postInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function YS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=fo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.preInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function QS(e){await J(e);let{organizationId:r,agentId:t,settings:n}=po.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.uninstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}export{FS as conversationCreatedOrUpdated,GS as eventCreatedOrUpdated,JS as executeAction,VS as feedbackCreatedOrUpdated,$S as handleMessage,HS as inboxItemCreatedOrUpdated,qS as knowledgeBaseRefreshed,XS as postInstall,YS as preInstall,QS as uninstall};\n`},2613:t=>{t.exports=e(import.meta.url)("assert")},181:t=>{t.exports=e(import.meta.url)("buffer")},5317:t=>{t.exports=e(import.meta.url)("child_process")},4434:t=>{t.exports=e(import.meta.url)("events")},9896:t=>{t.exports=e(import.meta.url)("fs")},1943:t=>{t.exports=e(import.meta.url)("fs/promises")},857:t=>{t.exports=e(import.meta.url)("os")},6928:t=>{t.exports=e(import.meta.url)("path")},2203:t=>{t.exports=e(import.meta.url)("stream")},9023:t=>{t.exports=e(import.meta.url)("util")},9309:(e,t,r)=>{r.d(t,{o0:()=>detect});var n=r(9896);var o=r(6928);var i=r(5426);async function pathExists(e){try{await n.promises.access(e);return true}catch{return false}}var u=new Map;function hasGlobalInstallation(e){const t=`has_global_${e}`;if(u.has(t)){return Promise.resolve(u.get(t))}return i(e,["--version"]).then((e=>/^\d+.\d+.\d+$/.test(e.stdout))).then((e=>{u.set(t,e);return e})).catch((()=>false))}function getTypeofLockFile(e="."){const t=`lockfile_${e}`;if(u.has(t)){return Promise.resolve(u.get(t))}return Promise.all([pathExists((0,o.resolve)(e,"yarn.lock")),pathExists((0,o.resolve)(e,"package-lock.json")),pathExists((0,o.resolve)(e,"pnpm-lock.yaml")),pathExists((0,o.resolve)(e,"bun.lockb"))]).then((([e,r,n,o])=>{let i=null;if(e){i="yarn"}else if(n){i="pnpm"}else if(o){i="bun"}else if(r){i="npm"}u.set(t,i);return i}))}var detect=async({cwd:e,includeGlobalBun:t}={})=>{const r=await getTypeofLockFile(e);if(r){return r}const[n,o,i]=await Promise.all([hasGlobalInstallation("yarn"),hasGlobalInstallation("pnpm"),t&&hasGlobalInstallation("bun")]);if(n){return"yarn"}if(o){return"pnpm"}if(i){return"bun"}return"npm"};function getNpmVersion(e){return execa(e||"npm",["--version"]).then((e=>e.stdout))}function clearCache(){return u.clear()}},8745:(t,r,n)=>{n.d(r,{A:()=>It});var o=n(2613);const i={right:alignRight,center:alignCenter};const u=0;const s=1;const a=2;const c=3;class UI{constructor(e){var t;this.width=e.width;this.wrap=(t=e.wrap)!==null&&t!==void 0?t:true;this.rows=[]}span(...e){const t=this.div(...e);t.span=true}resetOutput(){this.rows=[]}div(...e){if(e.length===0){this.div("")}if(this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==="string"){return this.applyLayoutDSL(e[0])}const t=e.map((e=>{if(typeof e==="string"){return this.colFromString(e)}return e}));this.rows.push(t);return t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split("\n").map((e=>e.split("\t")));let r=0;t.forEach((e=>{if(e.length>1&&l.stringWidth(e[0])>r){r=Math.min(Math.floor(this.width*.5),l.stringWidth(e[0]))}}));t.forEach((e=>{this.div(...e.map(((t,n)=>({text:t.trim(),padding:this.measurePadding(t),width:n===0&&e.length>1?r:undefined}))))}));return this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=l.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];this.rows.forEach((t=>{this.rowToString(t,e)}));return e.filter((e=>!e.hidden)).map((e=>e.text)).join("\n")}rowToString(e,t){this.rasterize(e).forEach(((r,n)=>{let o="";r.forEach(((r,u)=>{const{width:a}=e[u];const D=this.negatePadding(e[u]);let f=r;if(D>l.stringWidth(r)){f+=" ".repeat(D-l.stringWidth(r))}if(e[u].align&&e[u].align!=="left"&&this.wrap){const t=i[e[u].align];f=t(f,D);if(l.stringWidth(f)<D){f+=" ".repeat((a||0)-l.stringWidth(f)-1)}}const d=e[u].padding||[0,0,0,0];if(d[c]){o+=" ".repeat(d[c])}o+=addBorder(e[u],f,"| ");o+=f;o+=addBorder(e[u],f," |");if(d[s]){o+=" ".repeat(d[s])}if(n===0&&t.length>0){o=this.renderInline(o,t[t.length-1])}}));t.push({text:o.replace(/ +$/,""),span:e.span})}));return t}renderInline(e,t){const r=e.match(/^ */);const n=r?r[0].length:0;const o=t.text;const i=l.stringWidth(o.trimRight());if(!t.span){return e}if(!this.wrap){t.hidden=true;return o+e}if(n<i){return e}t.hidden=true;return o.trimRight()+" ".repeat(n-i)+e.trimLeft()}rasterize(e){const t=[];const r=this.columnWidths(e);let n;e.forEach(((e,o)=>{e.width=r[o];if(this.wrap){n=l.wrap(e.text,this.negatePadding(e),{hard:true}).split("\n")}else{n=e.text.split("\n")}if(e.border){n.unshift("."+"-".repeat(this.negatePadding(e)+2)+".");n.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")}if(e.padding){n.unshift(...new Array(e.padding[u]||0).fill(""));n.push(...new Array(e.padding[a]||0).fill(""))}n.forEach(((e,r)=>{if(!t[r]){t.push([])}const n=t[r];for(let e=0;e<o;e++){if(n[e]===undefined){n.push("")}}n.push(e)}))}));return t}negatePadding(e){let t=e.width||0;if(e.padding){t-=(e.padding[c]||0)+(e.padding[s]||0)}if(e.border){t-=4}return t}columnWidths(e){if(!this.wrap){return e.map((e=>e.width||l.stringWidth(e.text)))}let t=e.length;let r=this.width;const n=e.map((e=>{if(e.width){t--;r-=e.width;return e.width}return undefined}));const o=t?Math.floor(r/t):0;return n.map(((t,r)=>{if(t===undefined){return Math.max(o,_minWidth(e[r]))}return t}))}}function addBorder(e,t,r){if(e.border){if(/[.']-+[.']/.test(t)){return""}if(t.trim().length!==0){return r}return" "}return""}function _minWidth(e){const t=e.padding||[];const r=1+(t[c]||0)+(t[s]||0);if(e.border){return r+4}return r}function getWindowWidth(){if(typeof process==="object"&&process.stdout&&process.stdout.columns){return process.stdout.columns}return 80}function alignRight(e,t){e=e.trim();const r=l.stringWidth(e);if(r<t){return" ".repeat(t-r)+e}return e}function alignCenter(e,t){e=e.trim();const r=l.stringWidth(e);if(r>=t){return e}return" ".repeat(t-r>>1)+e}let l;function cliui(e,t){l=t;return new UI({width:(e===null||e===void 0?void 0:e.width)||getWindowWidth(),wrap:e===null||e===void 0?void 0:e.wrap})}function ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${t})`,"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?undefined:"g")}const D=ansiRegex();function stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(D,"")}function isAmbiguous(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function lookup_isFullWidth(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function lookup_isWide(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e===94192||e===94193||e>=94208&&e<=100343||e>=100352&&e<=101589||e>=101631&&e<=101640||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128727||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129673||e>=129679&&e<=129734||e>=129742&&e<=129756||e>=129759&&e<=129769||e>=129776&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function lookup_getCategory(e){if(isAmbiguous(e))return"ambiguous";if(lookup_isFullWidth(e))return"fullwidth";if(e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518){return"halfwidth"}if(e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630){return"narrow"}if(lookup_isWide(e))return"wide";return"neutral"}function validate(e){if(!Number.isSafeInteger(e)){throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}}function eastAsianWidthType(e){validate(e);return getCategory(e)}function eastAsianWidth(e,{ambiguousAsWide:t=false}={}){validate(e);if(lookup_isFullWidth(e)||lookup_isWide(e)||t&&isAmbiguous(e)){return 2}return 1}const _isNarrowWidth=e=>!(isFullWidth(e)||isWide(e));var f=n(2732);const d=new Intl.Segmenter;const p=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of d.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(p.test(t)){continue}if(f().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}function ansi_regex_ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=[`[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?${t})`,"(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(r,e?undefined:"g")}const h=ansi_regex_ansiRegex();function strip_ansi_stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(h,"")}var g=n(5470);const m=new Intl.Segmenter;const y=/^\p{Default_Ignorable_Code_Point}$/u;function string_width_stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=strip_ansi_stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of m.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(y.test(t)){continue}if(g().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}const F=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const b={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const E=Object.keys(b.modifier);const C=Object.keys(b.color);const v=Object.keys(b.bgColor);const w=[...C,...v];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(b)){for(const[t,n]of Object.entries(r)){b[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=b[t];e.set(n[0],n[1])}Object.defineProperty(b,t,{value:r,enumerable:false})}Object.defineProperty(b,"codes",{value:e,enumerable:false});b.color.close="[39m";b.bgColor.close="[49m";b.color.ansi=wrapAnsi16();b.color.ansi256=wrapAnsi256();b.color.ansi16m=wrapAnsi16m();b.bgColor.ansi=wrapAnsi16(F);b.bgColor.ansi256=wrapAnsi256(F);b.bgColor.ansi16m=wrapAnsi16m(F);Object.defineProperties(b,{rgbToAnsi256:{value:(e,t,r)=>{if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value:e=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>b.rgbToAnsi256(...b.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value:e=>{if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const o=e%36;t=Math.floor(e/36)/5;r=Math.floor(o/6)/5;n=o%6/5}const o=Math.max(t,r,n)*2;if(o===0){return 30}let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(o===2){i+=60}return i},enumerable:false},rgbToAnsi:{value:(e,t,r)=>b.ansi256ToAnsi(b.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>b.ansi256ToAnsi(b.hexToAnsi256(e)),enumerable:false}});return b}const A=assembleStyles();const O=A;const S=new Set(["",""]);const B=39;const j="";const k="[";const x="]";const P="m";const _=`${x}8;;`;const wrapAnsiCode=e=>`${S.values().next().value}${k}${e}${P}`;const wrapAnsiHyperlink=e=>`${S.values().next().value}${_}${e}${j}`;const wordLengths=e=>e.split(" ").map((e=>string_width_stringWidth(e)));const wrapWord=(e,t,r)=>{const n=[...t];let o=false;let i=false;let u=string_width_stringWidth(strip_ansi_stripAnsi(e.at(-1)));for(const[t,s]of n.entries()){const a=string_width_stringWidth(s);if(u+a<=r){e[e.length-1]+=s}else{e.push(s);u=0}if(S.has(s)){o=true;const e=n.slice(t+1,t+1+_.length).join("");i=e===_}if(o){if(i){if(s===j){o=false;i=false}}else if(s===P){o=false}continue}u+=a;if(u===r&&t<n.length-1){e.push("");u=0}}if(!u&&e.at(-1).length>0&&e.length>1){e[e.length-2]+=e.pop()}};const stringVisibleTrimSpacesRight=e=>{const t=e.split(" ");let r=t.length;while(r>0){if(string_width_stringWidth(t[r-1])>0){break}r--}if(r===t.length){return e}return t.slice(0,r).join(" ")+t.slice(r).join("")};const exec=(e,t,r={})=>{if(r.trim!==false&&e.trim()===""){return""}let n="";let o;let i;const u=wordLengths(e);let s=[""];for(const[n,o]of e.split(" ").entries()){if(r.trim!==false){s[s.length-1]=s.at(-1).trimStart()}let e=string_width_stringWidth(s.at(-1));if(n!==0){if(e>=t&&(r.wordWrap===false||r.trim===false)){s.push("");e=0}if(e>0||r.trim===false){s[s.length-1]+=" ";e++}}if(r.hard&&u[n]>t){const r=t-e;const i=1+Math.floor((u[n]-r-1)/t);const a=Math.floor((u[n]-1)/t);if(a<i){s.push("")}wrapWord(s,o,t);continue}if(e+u[n]>t&&e>0&&u[n]>0){if(r.wordWrap===false&&e<t){wrapWord(s,o,t);continue}s.push("")}if(e+u[n]>t&&r.wordWrap===false){wrapWord(s,o,t);continue}s[s.length-1]+=o}if(r.trim!==false){s=s.map((e=>stringVisibleTrimSpacesRight(e)))}const a=s.join("\n");const c=[...a];let l=0;for(const[e,t]of c.entries()){n+=t;if(S.has(t)){const{groups:e}=new RegExp(`(?:\\${k}(?<code>\\d+)m|\\${_}(?<uri>.*)${j})`).exec(a.slice(l))||{groups:{}};if(e.code!==undefined){const t=Number.parseFloat(e.code);o=t===B?undefined:t}else if(e.uri!==undefined){i=e.uri.length===0?undefined:e.uri}}const r=O.codes.get(Number(o));if(c[e+1]==="\n"){if(i){n+=wrapAnsiHyperlink("")}if(o&&r){n+=wrapAnsiCode(r)}}else if(t==="\n"){if(o&&r){n+=wrapAnsiCode(o)}if(i){n+=wrapAnsiHyperlink(i)}}l+=t.length}return n};function wrapAnsi(e,t,r){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map((e=>exec(e,t,r))).join("\n")}function ui(e){return cliui(e,{stringWidth:stringWidth,stripAnsi:stripAnsi,wrap:wrapAnsi})}var I=n(6928);var T=n(9896);function sync(e,t){let r=(0,I.resolve)(".",e);let n,o=(0,T.statSync)(r);if(!o.isDirectory()){r=(0,I.dirname)(r)}while(true){n=t(r,(0,T.readdirSync)(r));if(n)return(0,I.resolve)(r,n);r=(0,I.dirname)(n=r);if(n===r)break}}var N=n(9023);const M=e(import.meta.url)("url");
|
|
2
|
+
import{createRequire as e}from"module";var t={220:(e,t,r)=>{const n=r(317);const o=r(291);const i=r(691);function spawn(e,t,r){const s=o(e,t,r);const a=n.spawn(s.command,s.args,s.options);i.hookChildProcess(a,s);return a}function spawnSync(e,t,r){const s=o(e,t,r);const a=n.spawnSync(s.command,s.args,s.options);a.error=a.error||i.verifyENOENTSync(a.status,s);return a}e.exports=spawn;e.exports.spawn=spawn;e.exports.sync=spawnSync;e.exports._parse=o;e.exports._enoent=i},691:e=>{const t=process.platform==="win32";function notFoundError(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function hookChildProcess(e,r){if(!t){return}const n=e.emit;e.emit=function(t,o){if(t==="exit"){const t=verifyENOENT(o,r);if(t){return n.call(e,"error",t)}}return n.apply(e,arguments)}}function verifyENOENT(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawn")}return null}function verifyENOENTSync(e,r){if(t&&e===1&&!r.file){return notFoundError(r.original,"spawnSync")}return null}e.exports={hookChildProcess:hookChildProcess,verifyENOENT:verifyENOENT,verifyENOENTSync:verifyENOENTSync,notFoundError:notFoundError}},291:(e,t,r)=>{const n=r(928);const o=r(32);const i=r(878);const s=r(537);const a=process.platform==="win32";const u=/\.(?:com|exe)$/i;const c=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function detectShebang(e){e.file=o(e);const t=e.file&&s(e.file);if(t){e.args.unshift(e.file);e.command=t;return o(e)}return e.file}function parseNonShell(e){if(!a){return e}const t=detectShebang(e);const r=!u.test(t);if(e.options.forceShell||r){const r=c.test(t);e.command=n.normalize(e.command);e.command=i.command(e.command);e.args=e.args.map((e=>i.argument(e,r)));const o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`];e.command=process.env.comspec||"cmd.exe";e.options.windowsVerbatimArguments=true}return e}function parse(e,t,r){if(t&&!Array.isArray(t)){r=t;t=null}t=t?t.slice(0):[];r=Object.assign({},r);const n={command:e,args:t,options:r,file:undefined,original:{command:e,args:t}};return r.shell?n:parseNonShell(n)}e.exports=parse},878:e=>{const t=/([()\][%!^"`<>&|;, *?])/g;function escapeCommand(e){e=e.replace(t,"^$1");return e}function escapeArgument(e,r){e=`${e}`;e=e.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"');e=e.replace(/(?=(\\+?)?)\1$/,"$1$1");e=`"${e}"`;e=e.replace(t,"^$1");if(r){e=e.replace(t,"^$1")}return e}e.exports.command=escapeCommand;e.exports.argument=escapeArgument},537:(e,t,r)=>{const n=r(896);const o=r(934);function readShebang(e){const t=150;const r=Buffer.alloc(t);let i;try{i=n.openSync(e,"r");n.readSync(i,r,0,t,0);n.closeSync(i)}catch(e){}return o(r.toString())}e.exports=readShebang},32:(e,t,r)=>{const n=r(928);const o=r(20);const i=r(251);function resolveCommandAttempt(e,t){const r=e.options.env||process.env;const s=process.cwd();const a=e.options.cwd!=null;const u=a&&process.chdir!==undefined&&!process.chdir.disabled;if(u){try{process.chdir(e.options.cwd)}catch(e){}}let c;try{c=o.sync(e.command,{path:r[i({env:r})],pathExt:t?n.delimiter:undefined})}catch(e){}finally{if(u){process.chdir(s)}}if(c){c=n.resolve(a?e.options.cwd:"",c)}return c}function resolveCommand(e){return resolveCommandAttempt(e)||resolveCommandAttempt(e,true)}e.exports=resolveCommand},20:(e,t,r)=>{const n=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys";const o=r(928);const i=n?";":":";const s=r(210);const getNotFoundError=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"});const getPathInfo=(e,t)=>{const r=t.colon||i;const o=e.match(/\//)||n&&e.match(/\\/)?[""]:[...n?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)];const s=n?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"";const a=n?s.split(r):[""];if(n){if(e.indexOf(".")!==-1&&a[0]!=="")a.unshift("")}return{pathEnv:o,pathExt:a,pathExtExe:s}};const which=(e,t,r)=>{if(typeof t==="function"){r=t;t={}}if(!t)t={};const{pathEnv:n,pathExt:i,pathExtExe:a}=getPathInfo(e,t);const u=[];const step=r=>new Promise(((i,s)=>{if(r===n.length)return t.all&&u.length?i(u):s(getNotFoundError(e));const a=n[r];const c=/^".*"$/.test(a)?a.slice(1,-1):a;const l=o.join(c,e);const f=!c&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;i(subStep(f,r,0))}));const subStep=(e,r,n)=>new Promise(((o,c)=>{if(n===i.length)return o(step(r+1));const l=i[n];s(e+l,{pathExt:a},((i,s)=>{if(!i&&s){if(t.all)u.push(e+l);else return o(e+l)}return o(subStep(e,r,n+1))}))}));return r?step(0).then((e=>r(null,e)),r):step(0)};const whichSync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:n,pathExtExe:i}=getPathInfo(e,t);const a=[];for(let u=0;u<r.length;u++){const c=r[u];const l=/^".*"$/.test(c)?c.slice(1,-1):c;const f=o.join(l,e);const d=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+f:f;for(let e=0;e<n.length;e++){const r=d+n[e];try{const e=s.sync(r,{pathExt:i});if(e){if(t.all)a.push(r);else return r}}catch(e){}}}if(t.all&&a.length)return a;if(t.nothrow)return null;throw getNotFoundError(e)};e.exports=which;which.sync=whichSync},946:e=>{e.exports=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE89\uDE8F-\uDEC2\uDEC6\uDECE-\uDEDC\uDEDF-\uDEE9]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g},426:(e,t,r)=>{const n=r(928);const o=r(317);const i=r(220);const s=r(588);const a=r(221);const u=r(163);const c=r(244);const l=r(487);const{spawnedKill:f,spawnedCancel:d,setupTimeout:p,validateTimeout:h,setExitHandler:m}=r(676);const{handleInput:g,getSpawnedResult:D,makeAllStream:y,validateInputSync:b}=r(828);const{mergePromise:E,getSpawnedPromise:v}=r(544);const{joinCommand:w,parseCommand:F,getEscapedCommand:C}=r(835);const A=1e3*1e3*100;const getEnv=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{const i=t?{...process.env,...e}:e;if(r){return a.env({env:i,cwd:n,execPath:o})}return i};const handleArguments=(e,t,r={})=>{const o=i._parse(e,t,r);e=o.command;t=o.args;r=o.options;r={maxBuffer:A,buffer:true,stripFinalNewline:true,extendEnv:true,preferLocal:false,localDir:r.cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:true,cleanup:true,all:false,windowsHide:true,...r};r.env=getEnv(r);r.stdio=l(r);if(process.platform==="win32"&&n.basename(e,".exe")==="cmd"){t.unshift("/q")}return{file:e,args:t,options:r,parsed:o}};const handleOutput=(e,t,r)=>{if(typeof t!=="string"&&!Buffer.isBuffer(t)){return r===undefined?undefined:""}if(e.stripFinalNewline){return s(t)}return t};const execa=(e,t,r)=>{const n=handleArguments(e,t,r);const i=w(e,t);const s=C(e,t);h(n.options);let a;try{a=o.spawn(n.file,n.args,n.options)}catch(e){const t=new o.ChildProcess;const r=Promise.reject(c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:false,isCanceled:false,killed:false}));return E(t,r)}const l=v(a);const b=p(a,n.options,l);const F=m(a,n.options,b);const A={isCanceled:false};a.kill=f.bind(null,a.kill.bind(a));a.cancel=d.bind(null,a,A);const handlePromise=async()=>{const[{error:e,exitCode:t,signal:r,timedOut:o},u,l,f]=await D(a,n.options,F);const d=handleOutput(n.options,u);const p=handleOutput(n.options,l);const h=handleOutput(n.options,f);if(e||t!==0||r!==null){const u=c({error:e,exitCode:t,signal:r,stdout:d,stderr:p,all:h,command:i,escapedCommand:s,parsed:n,timedOut:o,isCanceled:A.isCanceled,killed:a.killed});if(!n.options.reject){return u}throw u}return{command:i,escapedCommand:s,exitCode:0,stdout:d,stderr:p,all:h,failed:false,timedOut:false,isCanceled:false,killed:false}};const O=u(handlePromise);g(a,n.options.input);a.all=y(a,n.options);return E(a,O)};e.exports=execa;e.exports.sync=(e,t,r)=>{const n=handleArguments(e,t,r);const i=w(e,t);const s=C(e,t);b(n.options);let a;try{a=o.spawnSync(n.file,n.args,n.options)}catch(e){throw c({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:n,timedOut:false,isCanceled:false,killed:false})}const u=handleOutput(n.options,a.stdout,a.error);const l=handleOutput(n.options,a.stderr,a.error);if(a.error||a.status!==0||a.signal!==null){const e=c({stdout:u,stderr:l,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:n,timedOut:a.error&&a.error.code==="ETIMEDOUT",isCanceled:false,killed:a.signal!==null});if(!n.options.reject){return e}throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:u,stderr:l,failed:false,timedOut:false,isCanceled:false,killed:false}};e.exports.command=(e,t)=>{const[r,...n]=F(e);return execa(r,n,t)};e.exports.commandSync=(e,t)=>{const[r,...n]=F(e);return execa.sync(r,n,t)};e.exports.node=(e,t,r={})=>{if(t&&!Array.isArray(t)&&typeof t==="object"){r=t;t=[]}const n=l.node(r);const o=process.execArgv.filter((e=>!e.startsWith("--inspect")));const{nodePath:i=process.execPath,nodeOptions:s=o}=r;return execa(i,[...s,e,...Array.isArray(t)?t:[]],{...r,stdin:undefined,stdout:undefined,stderr:undefined,stdio:n,shell:false})}},835:e=>{const normalizeArgs=(e,t=[])=>{if(!Array.isArray(t)){return[e]}return[e,...t]};const t=/^[\w.-]+$/;const r=/"/g;const escapeArg=e=>{if(typeof e!=="string"||t.test(e)){return e}return`"${e.replace(r,'\\"')}"`};const joinCommand=(e,t)=>normalizeArgs(e,t).join(" ");const getEscapedCommand=(e,t)=>normalizeArgs(e,t).map((e=>escapeArg(e))).join(" ");const n=/ +/g;const parseCommand=e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];if(e&&e.endsWith("\\")){t[t.length-1]=`${e.slice(0,-1)} ${r}`}else{t.push(r)}}return t};e.exports={joinCommand:joinCommand,getEscapedCommand:getEscapedCommand,parseCommand:parseCommand}},244:(e,t,r)=>{const{signalsByName:n}=r(280);const getErrorPrefix=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:s})=>{if(e){return`timed out after ${t} milliseconds`}if(s){return"was canceled"}if(r!==undefined){return`failed with ${r}`}if(n!==undefined){return`was killed with ${n} (${o})`}if(i!==undefined){return`failed with exit code ${i}`}return"failed"};const makeError=({stdout:e,stderr:t,all:r,error:o,signal:i,exitCode:s,command:a,escapedCommand:u,timedOut:c,isCanceled:l,killed:f,parsed:{options:{timeout:d}}})=>{s=s===null?undefined:s;i=i===null?undefined:i;const p=i===undefined?undefined:n[i].description;const h=o&&o.code;const m=getErrorPrefix({timedOut:c,timeout:d,errorCode:h,signal:i,signalDescription:p,exitCode:s,isCanceled:l});const g=`Command ${m}: ${a}`;const D=Object.prototype.toString.call(o)==="[object Error]";const y=D?`${g}\n${o.message}`:g;const b=[y,t,e].filter(Boolean).join("\n");if(D){o.originalMessage=o.message;o.message=b}else{o=new Error(b)}o.shortMessage=y;o.command=a;o.escapedCommand=u;o.exitCode=s;o.signal=i;o.signalDescription=p;o.stdout=e;o.stderr=t;if(r!==undefined){o.all=r}if("bufferedData"in o){delete o.bufferedData}o.failed=true;o.timedOut=Boolean(c);o.isCanceled=l;o.killed=f&&!c;return o};e.exports=makeError},676:(e,t,r)=>{const n=r(857);const o=r(521);const i=1e3*5;const spawnedKill=(e,t="SIGTERM",r={})=>{const n=e(t);setKillTimeout(e,t,r,n);return n};const setKillTimeout=(e,t,r,n)=>{if(!shouldForceKill(t,r,n)){return}const o=getForceKillAfterTimeout(r);const i=setTimeout((()=>{e("SIGKILL")}),o);if(i.unref){i.unref()}};const shouldForceKill=(e,{forceKillAfterTimeout:t},r)=>isSigterm(e)&&t!==false&&r;const isSigterm=e=>e===n.constants.signals.SIGTERM||typeof e==="string"&&e.toUpperCase()==="SIGTERM";const getForceKillAfterTimeout=({forceKillAfterTimeout:e=true})=>{if(e===true){return i}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};const spawnedCancel=(e,t)=>{const r=e.kill();if(r){t.isCanceled=true}};const timeoutKill=(e,t,r)=>{e.kill(t);r(Object.assign(new Error("Timed out"),{timedOut:true,signal:t}))};const setupTimeout=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===undefined){return n}let o;const i=new Promise(((n,i)=>{o=setTimeout((()=>{timeoutKill(e,r,i)}),t)}));const s=n.finally((()=>{clearTimeout(o)}));return Promise.race([i,s])};const validateTimeout=({timeout:e})=>{if(e!==undefined&&(!Number.isFinite(e)||e<0)){throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)}};const setExitHandler=async(e,{cleanup:t,detached:r},n)=>{if(!t||r){return n}const i=o((()=>{e.kill()}));return n.finally((()=>{i()}))};e.exports={spawnedKill:spawnedKill,spawnedCancel:spawnedCancel,setupTimeout:setupTimeout,validateTimeout:validateTimeout,setExitHandler:setExitHandler}},544:e=>{const t=(async()=>{})().constructor.prototype;const r=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));const mergePromise=(e,t)=>{for(const[n,o]of r){const r=typeof t==="function"?(...e)=>Reflect.apply(o.value,t(),e):o.value.bind(t);Reflect.defineProperty(e,n,{...o,value:r})}return e};const getSpawnedPromise=e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})}));e.on("error",(e=>{r(e)}));if(e.stdin){e.stdin.on("error",(e=>{r(e)}))}}));e.exports={mergePromise:mergePromise,getSpawnedPromise:getSpawnedPromise}},487:e=>{const t=["stdin","stdout","stderr"];const hasAlias=e=>t.some((t=>e[t]!==undefined));const normalizeStdio=e=>{if(!e){return}const{stdio:r}=e;if(r===undefined){return t.map((t=>e[t]))}if(hasAlias(e)){throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).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}\``)}const n=Math.max(r.length,t.length);return Array.from({length:n},((e,t)=>r[t]))};e.exports=normalizeStdio;e.exports.node=e=>{const t=normalizeStdio(e);if(t==="ipc"){return"ipc"}if(t===undefined||typeof t==="string"){return[t,t,t,"ipc"]}if(t.includes("ipc")){return t}return[...t,"ipc"]}},828:(e,t,r)=>{const n=r(277);const o=r(602);const i=r(993);const handleInput=(e,t)=>{if(t===undefined||e.stdin===undefined){return}if(n(t)){t.pipe(e.stdin)}else{e.stdin.end(t)}};const makeAllStream=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr){return}const r=i();if(e.stdout){r.add(e.stdout)}if(e.stderr){r.add(e.stderr)}return r};const getBufferedData=async(e,t)=>{if(!e){return}e.destroy();try{return await t}catch(e){return e.bufferedData}};const getStreamPromise=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!e||!r){return}if(t){return o(e,{encoding:t,maxBuffer:n})}return o.buffer(e,{maxBuffer:n})};const getSpawnedResult=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},s)=>{const a=getStreamPromise(e,{encoding:n,buffer:o,maxBuffer:i});const u=getStreamPromise(t,{encoding:n,buffer:o,maxBuffer:i});const c=getStreamPromise(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,u,c])}catch(n){return Promise.all([{error:n,signal:n.signal,timedOut:n.timedOut},getBufferedData(e,a),getBufferedData(t,u),getBufferedData(r,c)])}};const validateInputSync=({input:e})=>{if(n(e)){throw new TypeError("The `input` option cannot be a stream in sync mode")}};e.exports={handleInput:handleInput,makeAllStream:makeAllStream,getSpawnedResult:getSpawnedResult,validateInputSync:validateInputSync}},521:(e,t,r)=>{var n=global.process;const processOk=function(e){return e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function"};if(!processOk(n)){e.exports=function(){return function(){}}}else{var o=r(613);var i=r(518);var s=/^win/i.test(n.platform);var a=r(434);if(typeof a!=="function"){a=a.EventEmitter}var u;if(n.__signal_exit_emitter__){u=n.__signal_exit_emitter__}else{u=n.__signal_exit_emitter__=new a;u.count=0;u.emitted={}}if(!u.infinite){u.setMaxListeners(Infinity);u.infinite=true}e.exports=function(e,t){if(!processOk(global.process)){return function(){}}o.equal(typeof e,"function","a callback must be provided for exit handler");if(d===false){p()}var r="exit";if(t&&t.alwaysLast){r="afterexit"}var remove=function(){u.removeListener(r,e);if(u.listeners("exit").length===0&&u.listeners("afterexit").length===0){c()}};u.on(r,e);return remove};var c=function unload(){if(!d||!processOk(global.process)){return}d=false;i.forEach((function(e){try{n.removeListener(e,f[e])}catch(e){}}));n.emit=g;n.reallyExit=h;u.count-=1};e.exports.unload=c;var l=function emit(e,t,r){if(u.emitted[e]){return}u.emitted[e]=true;u.emit(e,t,r)};var f={};i.forEach((function(e){f[e]=function listener(){if(!processOk(global.process)){return}var t=n.listeners(e);if(t.length===u.count){c();l("exit",null,e);l("afterexit",null,e);if(s&&e==="SIGHUP"){e="SIGINT"}n.kill(n.pid,e)}}}));e.exports.signals=function(){return i};var d=false;var p=function load(){if(d||!processOk(global.process)){return}d=true;u.count+=1;i=i.filter((function(e){try{n.on(e,f[e]);return true}catch(e){return false}}));n.emit=D;n.reallyExit=m};e.exports.load=p;var h=n.reallyExit;var m=function processReallyExit(e){if(!processOk(global.process)){return}n.exitCode=e||0;l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);h.call(n,n.exitCode)};var g=n.emit;var D=function processEmit(e,t){if(e==="exit"&&processOk(global.process)){if(t!==undefined){n.exitCode=t}var r=g.apply(this,arguments);l("exit",n.exitCode,null);l("afterexit",n.exitCode,null);return r}else{return g.apply(this,arguments)}}}},518:e=>{e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];if(process.platform!=="win32"){e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT")}if(process.platform==="linux"){e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}},103:e=>{e.exports=function getCallerFile(e){if(e===void 0){e=2}if(e>=Error.stackTraceLimit){throw new TypeError("getCallerFile(position) requires position be less then Error.stackTraceLimit but position was: `"+e+"` and Error.stackTraceLimit was: `"+Error.stackTraceLimit+"`")}var t=Error.prepareStackTrace;Error.prepareStackTrace=function(e,t){return t};var r=(new Error).stack;Error.prepareStackTrace=t;if(r!==null&&typeof r==="object"){return r[e]?r[e].getFileName():undefined}}},324:(e,t,r)=>{const{PassThrough:n}=r(203);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const o=r==="buffer";let i=false;if(t){i=!(r||o)}else{r=r||"utf8"}if(o){r=null}const s=new n({objectMode:i});if(r){s.setEncoding(r)}let a=0;const u=[];s.on("data",(e=>{u.push(e);if(i){a=u.length}else{a+=e.length}}));s.getBufferedValue=()=>{if(t){return u}return o?Buffer.concat(u,a):u.join("")};s.getBufferedLength=()=>a;return s}},602:(e,t,r)=>{const{constants:n}=r(181);const o=r(203);const{promisify:i}=r(23);const s=r(324);const a=i(o.pipeline);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){throw new Error("Expected a stream")}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;const o=s(t);await new Promise(((t,i)=>{const rejectPromise=e=>{if(e&&o.getBufferedLength()<=n.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}i(e)};(async()=>{try{await a(e,o);t()}catch(e){rejectPromise(e)}})();o.on("data",(()=>{if(o.getBufferedLength()>r){rejectPromise(new MaxBufferError)}}))}));return o.getBufferedValue()}e.exports=getStream;e.exports.buffer=(e,t)=>getStream(e,{...t,encoding:"buffer"});e.exports.array=(e,t)=>getStream(e,{...t,array:true});e.exports.MaxBufferError=MaxBufferError},534:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGNALS=void 0;const r=[{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:true},{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:true},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:true},{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",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];t.SIGNALS=r},280:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.signalsByNumber=t.signalsByName=void 0;var n=r(857);var o=r(899);var i=r(576);const getSignalsByName=function(){const e=(0,o.getSignals)();return e.reduce(getSignalByName,{})};const getSignalByName=function(e,{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}}};const s=getSignalsByName();t.signalsByName=s;const getSignalsByNumber=function(){const e=(0,o.getSignals)();const t=i.SIGRTMAX+1;const r=Array.from({length:t},((t,r)=>getSignalByNumber(r,e)));return Object.assign({},...r)};const getSignalByNumber=function(e,t){const r=findSignalByNumber(e,t);if(r===undefined){return{}}const{name:n,description:o,supported:i,action:s,forced:a,standard:u}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:u}}};const findSignalByNumber=function(e,t){const r=t.find((({name:t})=>n.constants.signals[t]===e));if(r!==undefined){return r}return t.find((t=>t.number===e))};const a=getSignalsByNumber();t.signalsByNumber=a},576:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.SIGRTMAX=t.getRealtimeSignals=void 0;const getRealtimeSignals=function(){const e=n-r+1;return Array.from({length:e},getRealtimeSignal)};t.getRealtimeSignals=getRealtimeSignals;const getRealtimeSignal=function(e,t){return{name:`SIGRT${t+1}`,number:r+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}};const r=34;const n=64;t.SIGRTMAX=n},899:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:true});t.getSignals=void 0;var n=r(857);var o=r(534);var i=r(576);const getSignals=function(){const e=(0,i.getRealtimeSignals)();const t=[...o.SIGNALS,...e].map(normalizeSignal);return t};t.getSignals=getSignals;const normalizeSignal=function({name:e,number:t,description:r,action:o,forced:i=false,standard:s}){const{signals:{[e]:a}}=n.constants;const u=a!==undefined;const c=u?a:t;return{name:e,number:c,description:r,supported:u,action:o,forced:i,standard:s}}},277:e=>{const isStream=e=>e!==null&&typeof e==="object"&&typeof e.pipe==="function";isStream.writable=e=>isStream(e)&&e.writable!==false&&typeof e._write==="function"&&typeof e._writableState==="object";isStream.readable=e=>isStream(e)&&e.readable!==false&&typeof e._read==="function"&&typeof e._readableState==="object";isStream.duplex=e=>isStream.writable(e)&&isStream.readable(e);isStream.transform=e=>isStream.duplex(e)&&typeof e._transform==="function";e.exports=isStream},210:(e,t,r)=>{var n=r(896);var o;if(process.platform==="win32"||global.TESTING_WINDOWS){o=r(431)}else{o=r(891)}e.exports=isexe;isexe.sync=sync;function isexe(e,t,r){if(typeof t==="function"){r=t;t={}}if(!r){if(typeof Promise!=="function"){throw new TypeError("callback not provided")}return new Promise((function(r,n){isexe(e,t||{},(function(e,t){if(e){n(e)}else{r(t)}}))}))}o(e,t||{},(function(e,n){if(e){if(e.code==="EACCES"||t&&t.ignoreErrors){e=null;n=false}}r(e,n)}))}function sync(e,t){try{return o.sync(e,t||{})}catch(e){if(t&&t.ignoreErrors||e.code==="EACCES"){return false}else{throw e}}}},891:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(896);function isexe(e,t,r){n.stat(e,(function(e,n){r(e,e?false:checkStat(n,t))}))}function sync(e,t){return checkStat(n.statSync(e),t)}function checkStat(e,t){return e.isFile()&&checkMode(e,t)}function checkMode(e,t){var r=e.mode;var n=e.uid;var o=e.gid;var i=t.uid!==undefined?t.uid:process.getuid&&process.getuid();var s=t.gid!==undefined?t.gid:process.getgid&&process.getgid();var a=parseInt("100",8);var u=parseInt("010",8);var c=parseInt("001",8);var l=a|u;var f=r&c||r&u&&o===s||r&a&&n===i||r&l&&i===0;return f}},431:(e,t,r)=>{e.exports=isexe;isexe.sync=sync;var n=r(896);function checkPathExt(e,t){var r=t.pathExt!==undefined?t.pathExt:process.env.PATHEXT;if(!r){return true}r=r.split(";");if(r.indexOf("")!==-1){return true}for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o){return true}}return false}function checkStat(e,t,r){if(!e.isSymbolicLink()&&!e.isFile()){return false}return checkPathExt(t,r)}function isexe(e,t,r){n.stat(e,(function(n,o){r(n,n?false:checkStat(o,e,t))}))}function sync(e,t){return checkStat(n.statSync(e),e,t)}},993:(e,t,r)=>{const{PassThrough:n}=r(203);e.exports=function(){var e=[];var t=new n({objectMode:true});t.setMaxListeners(0);t.add=add;t.isEmpty=isEmpty;t.on("unpipe",remove);Array.prototype.slice.call(arguments).forEach(add);return t;function add(r){if(Array.isArray(r)){r.forEach(add);return this}e.push(r);r.once("end",remove.bind(null,r));r.once("error",t.emit.bind(t,"error"));r.pipe(t,{end:false});return this}function isEmpty(){return e.length==0}function remove(r){e=e.filter((function(e){return e!==r}));if(!e.length&&t.readable){t.end()}}}},98:e=>{const mimicFn=(e,t)=>{for(const r of Reflect.ownKeys(t)){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}return e};e.exports=mimicFn;e.exports["default"]=mimicFn},221:(e,t,r)=>{const n=r(928);const o=r(251);const npmRunPath=e=>{e={cwd:process.cwd(),path:process.env[o()],execPath:process.execPath,...e};let t;let r=n.resolve(e.cwd);const i=[];while(t!==r){i.push(n.join(r,"node_modules/.bin"));t=r;r=n.resolve(r,"..")}const s=n.resolve(e.cwd,e.execPath,"..");i.push(s);return i.concat(e.path).join(n.delimiter)};e.exports=npmRunPath;e.exports["default"]=npmRunPath;e.exports.env=t=>{t={env:process.env,...t};const r={...t.env};const n=o({env:r});t.path=r[n];r[n]=e.exports(t);return r}},163:(e,t,r)=>{const n=r(98);const o=new WeakMap;const onetime=(e,t={})=>{if(typeof e!=="function"){throw new TypeError("Expected a function")}let r;let i=0;const s=e.displayName||e.name||"<anonymous>";const onetime=function(...n){o.set(onetime,++i);if(i===1){r=e.apply(this,n);e=null}else if(t.throw===true){throw new Error(`Function \`${s}\` can only be called once`)}return r};n(onetime,e);o.set(onetime,i);return onetime};e.exports=onetime;e.exports["default"]=onetime;e.exports.callCount=e=>{if(!o.has(e)){throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`)}return o.get(e)}},251:e=>{const pathKey=(e={})=>{const t=e.env||process.env;const r=e.platform||process.platform;if(r!=="win32"){return"PATH"}return Object.keys(t).reverse().find((e=>e.toUpperCase()==="PATH"))||"Path"};e.exports=pathKey;e.exports["default"]=pathKey},934:(e,t,r)=>{const n=r(368);e.exports=(e="")=>{const t=e.match(n);if(!t){return null}const[r,o]=t[0].replace(/#! ?/,"").split(" ");const i=r.split("/").pop();if(i==="env"){return o}return o?`${i} ${o}`:i}},368:e=>{e.exports=/^#!(.*)/},588:e=>{e.exports=e=>{const t=typeof e==="string"?"\n":"\n".charCodeAt();const r=typeof e==="string"?"\r":"\r".charCodeAt();if(e[e.length-1]===t){e=e.slice(0,e.length-1)}if(e[e.length-1]===r){e=e.slice(0,e.length-1)}return e}},719:(e,t,r)=>{r.a(e,(async(e,t)=>{try{var n=r(317);var o=r.n(n);var i=r(943);var s=r.n(i);var a=r(309);var u=r(185);var c=r(142);const prepare=async()=>{await s().access("src").catch((()=>{throw new Error("src directory not found. Make sure all your source code is in the src directory.")}));await s().access("src/pages").then((()=>{throw new Error("pages directory found. Only NextJS App Router is supported. Convert your app to use App Router and delete the pages directory.")})).catch((()=>{}));await s().rm("src/app/mavenagi-cgi",{recursive:true,force:true});await s().mkdir("src/app/mavenagi-cgi",{recursive:true});await Promise.all([s().writeFile("src/app/mavenagi-cgi/next.ts",`// @ts-nocheck\n${c.S}`),...Object.entries({"pre-install":"preInstall","post-install":"postInstall",uninstall:"uninstall",feedbacks:"feedbackCreatedOrUpdated",conversations:"conversationCreatedOrUpdated","inbox-items":"inboxItemCreatedOrUpdated",events:"eventCreatedOrUpdated","execute-action":"executeAction","knowledge-base-refreshed":"knowledgeBaseRefreshed","handle-message":"handleMessage"}).map((async([e,t])=>{await s().mkdir(`src/app/mavenagi-cgi/v1/${e}`,{recursive:true});const r=await s().readFile(`src/index.ts`,"utf8");const n=r.includes("export const runtime = 'edge'")||r.includes('export const runtime = "edge"');if(n){throw new Error("Edge runtime is no longer supported. Remove the runtime export from index.ts.")}await s().writeFile(`src/app/mavenagi-cgi/v1/${e}/route.ts`,`// @ts-nocheck\nimport {${t}} from '../../next'\nimport userWorker from '../../../..'\n\nexport const POST = ${t}\n`)}))])};await(0,u.A)(process.argv.slice(2)).scriptName("mavenagi").usage("$0 <cmd> [args]").command("build","build",(async()=>{await prepare();(0,n.execFileSync)(await(0,a.o0)(),["run","build"],{stdio:"inherit"});process.exit(0)})).command("dev","dev",(async()=>{await prepare();(0,n.execFileSync)(await(0,a.o0)(),["run","dev"],{stdio:"inherit"});process.exit(0)})).help().argv;t()}catch(e){t(e)}}),1)},142:(e,t,r)=>{r.d(t,{S:()=>n});const n=`var fi=Object.defineProperty;var li=(e,r)=>{for(var t in r)fi(e,t,{get:r[t],enumerable:!0})};var fe=new TextEncoder,F=new TextDecoder,Rs=2**32;function nt(...e){let r=e.reduce((i,{length:a})=>i+a,0),t=new Uint8Array(r),n=0;for(let i of e)t.set(i,n),n+=i.length;return t}function ze(e){let r=new Uint8Array(e.length);for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>127)throw new TypeError("non-ASCII string encountered in encode()");r[t]=n}return r}function it(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let r=atob(e),t=new Uint8Array(r.length);for(let n=0;n<r.length;n++)t[n]=r.charCodeAt(n);return t}function V(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(typeof e=="string"?e:F.decode(e),{alphabet:"base64url"});let r=e;r instanceof Uint8Array&&(r=F.decode(r)),r=r.replace(/-/g,"+").replace(/_/g,"/");try{return it(r)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}}var T=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(r,t){super(r,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},U=class extends T{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},le=class extends T{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(r,t,n="unspecified",i="unspecified"){super(r,{cause:{claim:n,reason:i,payload:t}}),this.claim=n,this.reason=i,this.payload=t}},Pe=class extends T{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"},z=class extends T{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"};var E=class extends T{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},Q=class extends T{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"};var me=class extends T{static code="ERR_JWKS_INVALID";code="ERR_JWKS_INVALID"},Z=class extends T{static code="ERR_JWKS_NO_MATCHING_KEY";code="ERR_JWKS_NO_MATCHING_KEY";constructor(r="no applicable key found in the JSON Web Key Set",t){super(r,t)}},Te=class extends T{[Symbol.asyncIterator];static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(r="multiple matching keys found in the JSON Web Key Set",t){super(r,t)}},Re=class extends T{static code="ERR_JWKS_TIMEOUT";code="ERR_JWKS_TIMEOUT";constructor(r="request timed out",t){super(r,t)}},je=class extends T{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(r="signature verification failed",t){super(r,t)}};var B=(e,r="algorithm.name")=>new TypeError(\`CryptoKey does not support this operation, its \${r} must be \${e}\`),ee=(e,r)=>e.name===r;function Er(e){return parseInt(e.name.slice(4),10)}function mi(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function pi(e,r){if(r&&!e.usages.includes(r))throw new TypeError(\`CryptoKey does not support this operation, its usages must include \${r}.\`)}function at(e,r,t){switch(r){case"HS256":case"HS384":case"HS512":{if(!ee(e.algorithm,"HMAC"))throw B("HMAC");let n=parseInt(r.slice(2),10);if(Er(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!ee(e.algorithm,"RSASSA-PKCS1-v1_5"))throw B("RSASSA-PKCS1-v1_5");let n=parseInt(r.slice(2),10);if(Er(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!ee(e.algorithm,"RSA-PSS"))throw B("RSA-PSS");let n=parseInt(r.slice(2),10);if(Er(e.algorithm.hash)!==n)throw B(\`SHA-\${n}\`,"algorithm.hash");break}case"Ed25519":case"EdDSA":{if(!ee(e.algorithm,"Ed25519"))throw B("Ed25519");break}case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":{if(!ee(e.algorithm,r))throw B(r);break}case"ES256":case"ES384":case"ES512":{if(!ee(e.algorithm,"ECDSA"))throw B("ECDSA");let n=mi(r);if(e.algorithm.namedCurve!==n)throw B(n,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}pi(e,t)}function st(e,r,...t){if(t=t.filter(Boolean),t.length>2){let n=t.pop();e+=\`one of type \${t.join(", ")}, or \${n}.\`}else t.length===2?e+=\`one of type \${t[0]} or \${t[1]}.\`:e+=\`of type \${t[0]}.\`;return r==null?e+=\` Received \${r}\`:typeof r=="function"&&r.name?e+=\` Received function \${r.name}\`:typeof r=="object"&&r!=null&&r.constructor?.name&&(e+=\` Received an instance of \${r.constructor.name}\`),e}var ct=(e,...r)=>st("Key must be ",e,...r),wr=(e,r,...t)=>st(\`Key for the \${e} algorithm must be \`,r,...t);var Ir=e=>{if(e?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return e instanceof CryptoKey}catch{return!1}},Or=e=>e?.[Symbol.toStringTag]==="KeyObject",Ar=e=>Ir(e)||Or(e);function ut(...e){let r=e.filter(Boolean);if(r.length===0||r.length===1)return!0;let t;for(let n of r){let i=Object.keys(n);if(!t||t.size===0){t=new Set(i);continue}for(let a of i){if(t.has(a))return!1;t.add(a)}}return!0}var di=e=>typeof e=="object"&&e!==null;function j(e){if(!di(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let r=e;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function ft(e,r){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:t}=r.algorithm;if(typeof t!="number"||t<2048)throw new TypeError(\`\${e} requires key modulusLength to be 2048 bits or larger\`)}}function yi(e){let r,t;switch(e.kty){case"AKP":{switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":r={name:e.alg},t=e.priv?["sign"]:["verify"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"RSA":{switch(e.alg){case"PS256":case"PS384":case"PS512":r={name:"RSA-PSS",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":r={name:"RSASSA-PKCS1-v1_5",hash:\`SHA-\${e.alg.slice(-3)}\`},t=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":r={name:"RSA-OAEP",hash:\`SHA-\${parseInt(e.alg.slice(-3),10)||1}\`},t=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"EC":{switch(e.alg){case"ES256":r={name:"ECDSA",namedCurve:"P-256"},t=e.d?["sign"]:["verify"];break;case"ES384":r={name:"ECDSA",namedCurve:"P-384"},t=e.d?["sign"]:["verify"];break;case"ES512":r={name:"ECDSA",namedCurve:"P-521"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:"ECDH",namedCurve:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}case"OKP":{switch(e.alg){case"Ed25519":case"EdDSA":r={name:"Ed25519"},t=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":r={name:e.crv},t=e.d?["deriveBits"]:[];break;default:throw new z('Invalid or unsupported JWK "alg" (Algorithm) Parameter value')}break}default:throw new z('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:r,keyUsages:t}}async function re(e){if(!e.alg)throw new TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:r,keyUsages:t}=yi(e),n={...e};return n.kty!=="AKP"&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,r,e.ext??!(e.d||e.priv),e.key_ops??t)}async function lt(e,r,t){if(!j(e))throw new TypeError("JWK must be an object");let n;switch(r??=e.alg,n??=t?.extractable??e.ext,e.kty){case"oct":if(typeof e.k!="string"||!e.k)throw new TypeError('missing "k" (Key Value) Parameter value');return V(e.k);case"RSA":if("oth"in e&&e.oth!==void 0)throw new z('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');return re({...e,alg:r,ext:n});case"AKP":{if(typeof e.alg!="string"||!e.alg)throw new TypeError('missing "alg" (Algorithm) Parameter value');if(r!==void 0&&r!==e.alg)throw new TypeError("JWK alg and alg option value mismatch");return re({...e,ext:n})}case"EC":case"OKP":return re({...e,alg:r,ext:n});default:throw new z('Unsupported "kty" (Key Type) Parameter value')}}function mt(e,r,t,n,i){if(i.crit!==void 0&&n?.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||n.crit===void 0)return new Set;if(!Array.isArray(n.crit)||n.crit.length===0||n.crit.some(c=>typeof c!="string"||c.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let a;t!==void 0?a=new Map([...Object.entries(t),...r.entries()]):a=r;for(let c of n.crit){if(!a.has(c))throw new z(\`Extension Header Parameter "\${c}" is not recognized\`);if(i[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" is missing\`);if(a.get(c)&&n[c]===void 0)throw new e(\`Extension Header Parameter "\${c}" MUST be integrity protected\`)}return new Set(n.crit)}function pt(e,r){if(r!==void 0&&(!Array.isArray(r)||r.some(t=>typeof t!="string")))throw new TypeError(\`"\${e}" option must be an array of strings\`);if(r)return new Set(r)}var pe=e=>j(e)&&typeof e.kty=="string",dt=e=>e.kty!=="oct"&&(e.kty==="AKP"&&typeof e.priv=="string"||typeof e.d=="string"),yt=e=>e.kty!=="oct"&&e.d===void 0&&e.priv===void 0,bt=e=>e.kty==="oct"&&typeof e.k=="string";var te,gt=async(e,r,t,n=!1)=>{te||=new WeakMap;let i=te.get(e);if(i?.[t])return i[t];let a=await re({...r,alg:t});return n&&Object.freeze(e),i?i[t]=a:te.set(e,{[t]:a}),a},gi=(e,r)=>{te||=new WeakMap;let t=te.get(e);if(t?.[r])return t[r];let n=e.type==="public",i=!!n,a;if(e.asymmetricKeyType==="x25519"){switch(r){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}a=e.toCryptoKey(e.asymmetricKeyType,i,n?[]:["deriveBits"])}if(e.asymmetricKeyType==="ed25519"){if(r!=="EdDSA"&&r!=="Ed25519")throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":{if(r!==e.asymmetricKeyType.toUpperCase())throw new TypeError("given KeyObject instance cannot be used for this algorithm");a=e.toCryptoKey(e.asymmetricKeyType,i,[n?"verify":"sign"])}}if(e.asymmetricKeyType==="rsa"){let c;switch(r){case"RSA-OAEP":c="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":c="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":c="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":c="SHA-512";break;default:throw new TypeError("given KeyObject instance cannot be used for this algorithm")}if(r.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:c},i,n?["encrypt"]:["decrypt"]);a=e.toCryptoKey({name:r.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:c},i,[n?"verify":"sign"])}if(e.asymmetricKeyType==="ec"){let u=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!u)throw new TypeError("given KeyObject instance cannot be used for this algorithm");r==="ES256"&&u==="P-256"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES384"&&u==="P-384"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r==="ES512"&&u==="P-521"&&(a=e.toCryptoKey({name:"ECDSA",namedCurve:u},i,[n?"verify":"sign"])),r.startsWith("ECDH-ES")&&(a=e.toCryptoKey({name:"ECDH",namedCurve:u},i,n?[]:["deriveBits"]))}if(!a)throw new TypeError("given KeyObject instance cannot be used for this algorithm");return t?t[r]=a:te.set(e,{[r]:a}),a};async function ht(e,r){if(e instanceof Uint8Array||Ir(e))return e;if(Or(e)){if(e.type==="secret")return e.export();if("toCryptoKey"in e&&typeof e.toCryptoKey=="function")try{return gi(e,r)}catch(n){if(n instanceof TypeError)throw n}let t=e.export({format:"jwk"});return gt(e,t,r)}if(pe(e))return e.k?V(e.k):gt(e,e,r,!0);throw new Error("unreachable")}var oe=e=>e?.[Symbol.toStringTag],zr=(e,r,t)=>{if(r.use!==void 0){let n;switch(t){case"sign":case"verify":n="sig";break;case"encrypt":case"decrypt":n="enc";break}if(r.use!==n)throw new TypeError(\`Invalid key for this operation, its "use" must be "\${n}" when present\`)}if(r.alg!==void 0&&r.alg!==e)throw new TypeError(\`Invalid key for this operation, its "alg" must be "\${e}" when present\`);if(Array.isArray(r.key_ops)){let n;switch(!0){case(t==="sign"||t==="verify"):case e==="dir":case e.includes("CBC-HS"):n=t;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\\d{3}(?:GCM)?(?:KW)?$/.test(e):!e.includes("GCM")&&e.endsWith("KW")?n=t==="encrypt"?"wrapKey":"unwrapKey":n=t;break;case(t==="encrypt"&&e.startsWith("RSA")):n="wrapKey";break;case t==="decrypt":n=e.startsWith("RSA")?"unwrapKey":"deriveBits";break}if(n&&r.key_ops?.includes?.(n)===!1)throw new TypeError(\`Invalid key for this operation, its "key_ops" must include "\${n}" when present\`)}return!0},hi=(e,r,t)=>{if(!(r instanceof Uint8Array)){if(pe(r)){if(bt(r)&&zr(e,r,t))return;throw new TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!Ar(r))throw new TypeError(wr(e,r,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if(r.type!=="secret")throw new TypeError(\`\${oe(r)} instances for symmetric algorithms must be of type "secret"\`)}},vi=(e,r,t)=>{if(pe(r))switch(t){case"decrypt":case"sign":if(dt(r)&&zr(e,r,t))return;throw new TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(yt(r)&&zr(e,r,t))return;throw new TypeError("JSON Web Key for this operation must be a public JWK")}if(!Ar(r))throw new TypeError(wr(e,r,"CryptoKey","KeyObject","JSON Web Key"));if(r.type==="secret")throw new TypeError(\`\${oe(r)} instances for asymmetric algorithms must not be of type "secret"\`);if(r.type==="public")switch(t){case"sign":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm signing must be of type "private"\`);case"decrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm decryption must be of type "private"\`)}if(r.type==="private")switch(t){case"verify":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm verifying must be of type "public"\`);case"encrypt":throw new TypeError(\`\${oe(r)} instances for asymmetric algorithm encryption must be of type "public"\`)}};function vt(e,r,t){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":hi(e,r,t);break;default:vi(e,r,t)}}function xt(e,r){let t=\`SHA-\${e.slice(-3)}\`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:t,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:t,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:t,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:t,name:"ECDSA",namedCurve:r.namedCurve};case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new z(\`alg \${e} is not supported either by JOSE or your javascript runtime\`)}}async function _t(e,r,t){if(r instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(ct(r,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",r,{hash:\`SHA-\${e.slice(-3)}\`,name:"HMAC"},!1,[t])}return at(r,e,t),r}async function St(e,r,t,n){let i=await _t(e,r,"verify");ft(e,i);let a=xt(e,i.algorithm);try{return await crypto.subtle.verify(a,i,t,n)}catch{return!1}}async function Et(e,r,t){if(!j(e))throw new E("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new E('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new E("JWS Protected Header incorrect type");if(e.payload===void 0)throw new E("JWS Payload missing");if(typeof e.signature!="string")throw new E("JWS Signature missing or incorrect type");if(e.header!==void 0&&!j(e.header))throw new E("JWS Unprotected Header incorrect type");let n={};if(e.protected)try{let O=V(e.protected);n=JSON.parse(F.decode(O))}catch{throw new E("JWS Protected Header is invalid")}if(!ut(n,e.header))throw new E("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let i={...n,...e.header},a=mt(E,new Map([["b64",!0]]),t?.crit,n,i),c=!0;if(a.has("b64")&&(c=n.b64,typeof c!="boolean"))throw new E('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:u}=i;if(typeof u!="string"||!u)throw new E('JWS "alg" (Algorithm) Header Parameter missing or invalid');let l=t&&pt("algorithms",t.algorithms);if(l&&!l.has(u))throw new Pe('"alg" (Algorithm) Header Parameter value not allowed');if(c){if(typeof e.payload!="string")throw new E("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new E("JWS Payload must be a string or an Uint8Array instance");let f=!1;typeof r=="function"&&(r=await r(n,e),f=!0),vt(u,r,"verify");let m=nt(e.protected!==void 0?ze(e.protected):new Uint8Array,ze("."),typeof e.payload=="string"?c?ze(e.payload):fe.encode(e.payload):e.payload),y;try{y=V(e.signature)}catch{throw new E("Failed to base64url decode the signature")}let _=await ht(r,u);if(!await St(u,_,y,m))throw new je;let b;if(c)try{b=V(e.payload)}catch{throw new E("Failed to base64url decode the payload")}else typeof e.payload=="string"?b=fe.encode(e.payload):b=e.payload;let h={payload:b};return e.protected!==void 0&&(h.protectedHeader=n),e.header!==void 0&&(h.unprotectedHeader=e.header),f?{...h,key:_}:h}async function wt(e,r,t){if(e instanceof Uint8Array&&(e=F.decode(e)),typeof e!="string")throw new E("Compact JWS must be a string or Uint8Array");let{0:n,1:i,2:a,length:c}=e.split(".");if(c!==3)throw new E("Invalid Compact JWS");let u=await Et({payload:i,protected:n,signature:a},r,t),l={payload:u.payload,protectedHeader:u.protectedHeader};return typeof r=="function"?{...l,key:u.key}:l}var xi=e=>Math.floor(e.getTime()/1e3),At=60,zt=At*60,Pr=zt*24,_i=Pr*7,Si=Pr*365.25,Ei=/^(\\+|\\-)? ?(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function It(e){let r=Ei.exec(e);if(!r||r[4]&&r[1])throw new TypeError("Invalid time period format");let t=parseFloat(r[2]),n=r[3].toLowerCase(),i;switch(n){case"sec":case"secs":case"second":case"seconds":case"s":i=Math.round(t);break;case"minute":case"minutes":case"min":case"mins":case"m":i=Math.round(t*At);break;case"hour":case"hours":case"hr":case"hrs":case"h":i=Math.round(t*zt);break;case"day":case"days":case"d":i=Math.round(t*Pr);break;case"week":case"weeks":case"w":i=Math.round(t*_i);break;default:i=Math.round(t*Si);break}return r[1]==="-"||r[4]==="ago"?-i:i}var Ot=e=>e.includes("/")?e.toLowerCase():\`application/\${e.toLowerCase()}\`,wi=(e,r)=>typeof e=="string"?r.includes(e):Array.isArray(e)?r.some(Set.prototype.has.bind(new Set(e))):!1;function Pt(e,r,t={}){let n;try{n=JSON.parse(F.decode(r))}catch{}if(!j(n))throw new Q("JWT Claims Set must be a top-level JSON object");let{typ:i}=t;if(i&&(typeof e.typ!="string"||Ot(e.typ)!==Ot(i)))throw new U('unexpected "typ" JWT header value',n,"typ","check_failed");let{requiredClaims:a=[],issuer:c,subject:u,audience:l,maxTokenAge:f}=t,m=[...a];f!==void 0&&m.push("iat"),l!==void 0&&m.push("aud"),u!==void 0&&m.push("sub"),c!==void 0&&m.push("iss");for(let b of new Set(m.reverse()))if(!(b in n))throw new U(\`missing required "\${b}" claim\`,n,b,"missing");if(c&&!(Array.isArray(c)?c:[c]).includes(n.iss))throw new U('unexpected "iss" claim value',n,"iss","check_failed");if(u&&n.sub!==u)throw new U('unexpected "sub" claim value',n,"sub","check_failed");if(l&&!wi(n.aud,typeof l=="string"?[l]:l))throw new U('unexpected "aud" claim value',n,"aud","check_failed");let y;switch(typeof t.clockTolerance){case"string":y=It(t.clockTolerance);break;case"number":y=t.clockTolerance;break;case"undefined":y=0;break;default:throw new TypeError("Invalid clockTolerance option type")}let{currentDate:_}=t,g=xi(_||new Date);if((n.iat!==void 0||f)&&typeof n.iat!="number")throw new U('"iat" claim must be a number',n,"iat","invalid");if(n.nbf!==void 0){if(typeof n.nbf!="number")throw new U('"nbf" claim must be a number',n,"nbf","invalid");if(n.nbf>g+y)throw new U('"nbf" claim timestamp check failed',n,"nbf","check_failed")}if(n.exp!==void 0){if(typeof n.exp!="number")throw new U('"exp" claim must be a number',n,"exp","invalid");if(n.exp<=g-y)throw new le('"exp" claim timestamp check failed',n,"exp","check_failed")}if(f){let b=g-n.iat,h=typeof f=="number"?f:It(f);if(b-y>h)throw new le('"iat" claim timestamp check failed (too far in the past)',n,"iat","check_failed");if(b<0-y)throw new U('"iat" claim timestamp check failed (it should be in the past)',n,"iat","check_failed")}return n}async function Ne(e,r,t){let n=await wt(e,r,t);if(n.protectedHeader.crit?.includes("b64")&&n.protectedHeader.b64===!1)throw new Q("JWTs MUST NOT use unencoded payload");let a={payload:Pt(n.protectedHeader,n.payload,t),protectedHeader:n.protectedHeader};return typeof r=="function"?{...a,key:n.key}:a}function Ii(e){switch(typeof e=="string"&&e.slice(0,2)){case"RS":case"PS":return"RSA";case"ES":return"EC";case"Ed":return"OKP";case"ML":return"AKP";default:throw new z('Unsupported "alg" value for a JSON Web Key Set')}}function Oi(e){return e&&typeof e=="object"&&Array.isArray(e.keys)&&e.keys.every(Ai)}function Ai(e){return j(e)}var Tr=class{#t;#a=new WeakMap;constructor(r){if(!Oi(r))throw new me("JSON Web Key Set malformed");this.#t=structuredClone(r)}jwks(){return this.#t}async getKey(r,t){let{alg:n,kid:i}={...r,...t?.header},a=Ii(n),c=this.#t.keys.filter(f=>{let m=a===f.kty;if(m&&typeof i=="string"&&(m=i===f.kid),m&&(typeof f.alg=="string"||a==="AKP")&&(m=n===f.alg),m&&typeof f.use=="string"&&(m=f.use==="sig"),m&&Array.isArray(f.key_ops)&&(m=f.key_ops.includes("verify")),m)switch(n){case"ES256":m=f.crv==="P-256";break;case"ES384":m=f.crv==="P-384";break;case"ES512":m=f.crv==="P-521";break;case"Ed25519":case"EdDSA":m=f.crv==="Ed25519";break}return m}),{0:u,length:l}=c;if(l===0)throw new Z;if(l!==1){let f=new Te,m=this.#a;throw f[Symbol.asyncIterator]=async function*(){for(let y of c)try{yield await Tt(m,y,n)}catch{}},f}return Tt(this.#a,u,n)}};async function Tt(e,r,t){let n=e.get(r)||e.set(r,{}).get(r);if(n[t]===void 0){let i=await lt({...r,ext:!0},t);if(i instanceof Uint8Array||i.type!=="public")throw new me("JSON Web Key Set members must be public keys");n[t]=i}return n[t]}function Rr(e){let r=new Tr(e),t=async(n,i)=>r.getKey(n,i);return Object.defineProperties(t,{jwks:{value:()=>structuredClone(r.jwks()),enumerable:!1,configurable:!1,writable:!1}}),t}function zi(){return typeof WebSocketPair<"u"||typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"||typeof EdgeRuntime<"u"&&EdgeRuntime==="vercel"}var jr;(typeof navigator>"u"||!navigator.userAgent?.startsWith?.("Mozilla/5.0 "))&&(jr="jose/v6.1.3");var Rt=Symbol();async function Pi(e,r,t,n=fetch){let i=await n(e,{method:"GET",signal:t,redirect:"manual",headers:r}).catch(a=>{throw a.name==="TimeoutError"?new Re:a});if(i.status!==200)throw new T("Expected 200 OK from the JSON Web Key Set HTTP response");try{return await i.json()}catch{throw new T("Failed to parse the JSON Web Key Set HTTP response as JSON")}}var Ue=Symbol();function Ti(e,r){return!(typeof e!="object"||e===null||!("uat"in e)||typeof e.uat!="number"||Date.now()-e.uat>=r||!("jwks"in e)||!j(e.jwks)||!Array.isArray(e.jwks.keys)||!Array.prototype.every.call(e.jwks.keys,j))}var Nr=class{#t;#a;#c;#s;#o;#e;#r;#u;#n;#i;constructor(r,t){if(!(r instanceof URL))throw new TypeError("url must be an instance of URL");this.#t=new URL(r.href),this.#a=typeof t?.timeoutDuration=="number"?t?.timeoutDuration:5e3,this.#c=typeof t?.cooldownDuration=="number"?t?.cooldownDuration:3e4,this.#s=typeof t?.cacheMaxAge=="number"?t?.cacheMaxAge:6e5,this.#r=new Headers(t?.headers),jr&&!this.#r.has("User-Agent")&&this.#r.set("User-Agent",jr),this.#r.has("accept")||(this.#r.set("accept","application/json"),this.#r.append("accept","application/jwk-set+json")),this.#u=t?.[Rt],t?.[Ue]!==void 0&&(this.#i=t?.[Ue],Ti(t?.[Ue],this.#s)&&(this.#o=this.#i.uat,this.#n=Rr(this.#i.jwks)))}pendingFetch(){return!!this.#e}coolingDown(){return typeof this.#o=="number"?Date.now()<this.#o+this.#c:!1}fresh(){return typeof this.#o=="number"?Date.now()<this.#o+this.#s:!1}jwks(){return this.#n?.jwks()}async getKey(r,t){(!this.#n||!this.fresh())&&await this.reload();try{return await this.#n(r,t)}catch(n){if(n instanceof Z&&this.coolingDown()===!1)return await this.reload(),this.#n(r,t);throw n}}async reload(){this.#e&&zi()&&(this.#e=void 0),this.#e||=Pi(this.#t.href,this.#r,AbortSignal.timeout(this.#a),this.#u).then(r=>{this.#n=Rr(r),this.#i&&(this.#i.uat=Date.now(),this.#i.jwks=r),this.#o=Date.now(),this.#e=void 0}).catch(r=>{throw this.#e=void 0,r}),await this.#e}};function Ur(e,r){let t=new Nr(e,r),n=async(i,a)=>t.getKey(i,a);return Object.defineProperties(n,{coolingDown:{get:()=>t.coolingDown(),enumerable:!0,configurable:!1},fresh:{get:()=>t.fresh(),enumerable:!0,configurable:!1},reload:{value:()=>t.reload(),enumerable:!0,configurable:!1,writable:!1},reloading:{get:()=>t.pendingFetch(),enumerable:!0,configurable:!1},jwks:{value:()=>t.jwks(),enumerable:!0,configurable:!1,writable:!1}}),n}function Ri(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}var Cr=ji();function ji(){var e,r,t,n,i,a,c,u,l=typeof window<"u"&&typeof window.document<"u";if(l)return{type:"browser",version:window.navigator.userAgent};var f=typeof globalThis<"u"&&((r=globalThis)===null||r===void 0||(e=r.navigator)===null||e===void 0?void 0:e.userAgent)==="Cloudflare-Workers";if(f)return{type:"workerd"};var m=typeof EdgeRuntime=="string";if(m)return{type:"edge-runtime"};var y=(typeof self>"u"?"undefined":Ri(self))==="object"&&typeof((t=self)===null||t===void 0?void 0:t.importScripts)=="function"&&(((n=self.constructor)===null||n===void 0?void 0:n.name)==="DedicatedWorkerGlobalScope"||((i=self.constructor)===null||i===void 0?void 0:i.name)==="ServiceWorkerGlobalScope"||((a=self.constructor)===null||a===void 0?void 0:a.name)==="SharedWorkerGlobalScope");if(y)return{type:"web-worker"};var _=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";if(_)return{type:"deno",version:Deno.version.deno};var g=typeof Bun<"u"&&typeof Bun.version<"u";if(g)return{type:"bun",version:Bun.version};var b=typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((c=process.versions)===null||c===void 0)&&c.node);if(b)return{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])};var h=typeof navigator<"u"&&((u=navigator)===null||u===void 0?void 0:u.product)==="ReactNative";return h?{type:"react-native"}:{type:"unknown"}}var o={};li(o,{JsonError:()=>ke,ParseError:()=>Me,any:()=>eo,bigint:()=>Ct,boolean:()=>ro,booleanLiteral:()=>Zt,date:()=>Dt,discriminant:()=>yo,enum_:()=>Le,getObjectLikeUtils:()=>K,getObjectUtils:()=>Y,getSchemaUtils:()=>x,isProperty:()=>G,lazy:()=>kt,lazyObject:()=>$t,list:()=>Je,number:()=>to,object:()=>We,objectWithoutOptionalProperties:()=>Gt,optional:()=>Lr,property:()=>Wt,record:()=>co,set:()=>uo,string:()=>oo,stringLiteral:()=>Qt,transform:()=>Wr,undiscriminatedUnion:()=>po,union:()=>go,unknown:()=>no,withParsedProperties:()=>Vr});var p={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"};function Ui(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function jt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function v(e,r){return"Expected ".concat(r,". Received ").concat(Ci(e),".")}function Ci(e){if(Array.isArray(e))return"list";if(e===null)return"null";if(Ui(e,BigInt))return"BigInt";switch(typeof e>"u"?"undefined":jt(e)){case"string":return'"'.concat(e,'"');case"bigint":case"number":case"boolean":case"undefined":return"".concat(e)}return typeof e>"u"?"undefined":jt(e)}function Dr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Di(e){if(Array.isArray(e))return Dr(e)}function ki(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ki(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Mi(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Bi(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ki(e,i,t[i])})}return e}function Li(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Wi(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Li(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ji(e){return Di(e)||Ki(e)||Fi(e)||Mi()}function Fi(e,r){if(e){if(typeof e=="string")return Dr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Dr(e,r)}}function A(e){return Wi(Bi({},e),{json:Nt(e.json),parse:Nt(e.parse)})}function Nt(e){return function(r,t){var n=e(r,t),i=t??{},a=i.skipValidation,c=a===void 0?!1:a;return!n.ok&&c?(console.warn(["Failed to validate."].concat(Ji(n.errors.map(function(u){return" - "+(u.path.length>0?"".concat(u.path.join("."),": ").concat(u.message):u.message)}))).join(\`\n\`)),{ok:!0,value:r}):n}}function Ce(e){return e.path.length===0?e.message:"".concat(e.path.join(" -> "),": ").concat(e.message)}function Vi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hi(e,r,t){return r=de(r),Xi(e,Kr()?Reflect.construct(r,t||[],de(e).constructor):r.apply(e,t))}function Gi(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function De(e,r,t){return Kr()?De=Reflect.construct:De=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&ye(f,c.prototype),f},De.apply(null,arguments)}function qi(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function de(e){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},de(e)}function $i(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&ye(e,r)}function Yi(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Xi(e,r){return r&&(Qi(r)==="object"||typeof r=="function")?r:Vi(e)}function ye(e,r){return ye=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ye(e,r)}function Qi(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function kr(e){var r=typeof Map=="function"?new Map:void 0;return kr=function(n){if(n===null||!Yi(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return De(n,arguments,de(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ye(i,n)},kr(e)}function Kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kr=function(){return!!e})()}var ke=(function(e){"use strict";$i(r,e);function r(t){Gi(this,r);var n;return n=Hi(this,r,[t.map(Ce).join("; ")]),qi(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r})(kr(Error));function Zi(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ea(e,r,t){return r=be(r),ia(e,Br()?Reflect.construct(r,t||[],be(e).constructor):r.apply(e,t))}function ra(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ke(e,r,t){return Br()?Ke=Reflect.construct:Ke=function(i,a,c){var u=[null];u.push.apply(u,a);var l=Function.bind.apply(i,u),f=new l;return c&&ge(f,c.prototype),f},Ke.apply(null,arguments)}function ta(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function be(e){return be=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},be(e)}function oa(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&ge(e,r)}function na(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function ia(e,r){return r&&(aa(r)==="object"||typeof r=="function")?r:Zi(e)}function ge(e,r){return ge=Object.setPrototypeOf||function(n,i){return n.__proto__=i,n},ge(e,r)}function aa(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Mr(e){var r=typeof Map=="function"?new Map:void 0;return Mr=function(n){if(n===null||!na(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r<"u"){if(r.has(n))return r.get(n);r.set(n,i)}function i(){return Ke(n,arguments,be(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ge(i,n)},Mr(e)}function Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Br=function(){return!!e})()}var Me=(function(e){"use strict";oa(r,e);function r(t){ra(this,r);var n;return n=ea(this,r,[t.map(Ce).join("; ")]),ta(n,"errors",void 0),n.errors=t,Object.setPrototypeOf(n,r.prototype),n}return r})(Mr(Error));function sa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Be(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){sa(e,i,t[i])})}return e}function x(e){return{nullable:function(){return ca(e)},optional:function(){return Lr(e)},optionalNullable:function(){return ua(e)},transform:function(r){return Wr(e,r)},parseOrThrow:function(r,t){var n=e.parse(r,t);if(n.ok)return n.value;throw new Me(n.errors)},jsonOrThrow:function(r,t){var n=e.json(r,t);if(n.ok)return n.value;throw new ke(n.errors)}}}function ca(e){var r={parse:function(t,n){return t==null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return p.NULLABLE}};return Be({},r,x(r))}function Lr(e){var r={parse:function(t,n){return t==null?{ok:!0,value:void 0}:e.parse(t,n)},json:function(t,n){return n?.omitUndefined&&t===void 0?{ok:!0,value:void 0}:t==null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return p.OPTIONAL}};return Be({},r,x(r))}function ua(e){var r={parse:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.parse(t,n)},json:function(t,n){return t===void 0?{ok:!0,value:void 0}:t===null?{ok:!0,value:null}:e.json(t,n)},getType:function(){return p.OPTIONAL_NULLABLE}};return Be({},r,x(r))}function Wr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);return a.ok?{ok:!0,value:r.transform(a.value)}:a},json:function(n,i){var a=r.untransform(n);return e.json(a,i)},getType:function(){return e.getType()}};return Be({},t,x(t))}function fa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function la(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){fa(e,i,t[i])})}return e}function Ut(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function Ct(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":Ut(r))==="bigint"?{ok:!0,value:r}:typeof r=="number"?{ok:!0,value:BigInt(r)}:{ok:!1,errors:[{path:i,message:v(r,"bigint | number")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return(typeof r>"u"?"undefined":Ut(r))!=="bigint"?{ok:!1,errors:[{path:i,message:v(r,"bigint")}]}:{ok:!0,value:r}},getType:function(){return p.BIGINT}};return la({},A(e),x(e))}function ma(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function pa(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function da(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ma(e,i,t[i])})}return e}var ya=/^([+-]?\\d{4}(?!\\d{2}\\b))((-?)((0[1-9]|1[0-2])(\\3([12]\\d|0[1-9]|3[01]))?|W([0-4]\\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\\d|[12]\\d{2}|3([0-5]\\d|6[1-6])))([T\\s]((([01]\\d|2[0-3])((:?)[0-5]\\d)?|24:?00)([.,]\\d+(?!:))?)?(\\17[0-5]\\d([.,]\\d+)?)?([zZ]|([+-])([01]\\d|2[0-3]):?([0-5]\\d)?)?)?)?$/;function Dt(){var e={parse:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return typeof r!="string"?{ok:!1,errors:[{path:i,message:v(r,"string")}]}:ya.test(r)?{ok:!0,value:new Date(r)}:{ok:!1,errors:[{path:i,message:v(r,"ISO 8601 date string")}]}},json:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.breadcrumbsPrefix,i=n===void 0?[]:n;return pa(r,Date)?{ok:!0,value:r.toISOString()}:{ok:!1,errors:[{path:i,message:v(r,"Date object")}]}},getType:function(){return p.DATE}};return da({},A(e),x(e))}function ba(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ga(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ba(e,i,t[i])})}return e}function R(e,r){return function(){var t={parse:r,json:r,getType:function(){return e}};return ga({},A(t),x(t))}}function Le(e){var r=new Set(e),t=R(p.ENUM,function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.allowUnrecognizedEnumValues,c=i.breadcrumbsPrefix,u=c===void 0?[]:c;return typeof n!="string"?{ok:!1,errors:[{path:u,message:v(n,"string")}]}:!r.has(n)&&!a?{ok:!1,errors:[{path:u,message:v(n,"enum")}]}:{ok:!0,value:n}});return t()}function ha(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function va(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ha(e,i,t[i])})}return e}function kt(e){var r=Jr(e);return va({},r,x(r))}function Jr(e){return{parse:function(r,t){return ne(e).parse(r,t)},json:function(r,t){return ne(e).json(r,t)},getType:function(){return ne(e).getType()}}}function ne(e){var r=e;return r.__zurg_memoized==null&&(r.__zurg_memoized=e()),r.__zurg_memoized}function he(e){return Object.entries(e)}function Kt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function xa(e){if(Array.isArray(e))return e}function _a(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Sa(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ea(e,r){return xa(e)||_a(e,r)||wa(e,r)||Sa()}function wa(e,r){if(e){if(typeof e=="string")return Kt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Kt(e,r)}}function ve(e,r){var t=new Set(r);return Object.entries(e).reduce(function(n,i){var a=Ea(i,2),c=a[0],u=a[1];return t.has(c)&&(n[c]=u),n},{})}function Ia(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function H(e){if((typeof e>"u"?"undefined":Ia(e))!=="object"||e===null)return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var r=e;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(e)===r}function xe(e){return Object.keys(e)}function Mt(e,r){var t=[],n=[],i=!0,a=!1,c=void 0;try{for(var u=e[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=l.value;r(f)?t.push(f):n.push(f)}}catch(m){a=!0,c=m}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return[t,n]}function Bt(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Oa(e){if(Array.isArray(e))return e}function Lt(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Aa(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function za(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Fr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Lt(e,i,t[i])})}return e}function Pa(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Ta(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Pa(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ra(e,r){return Oa(e)||Aa(e,r)||ja(e,r)||za()}function ja(e,r){if(e){if(typeof e=="string")return Bt(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Bt(e,r)}}function K(e){return{withParsedProperties:function(r){return Vr(e,r)}}}function Vr(e,r){var t={parse:function(n,i){var a=e.parse(n,i);if(!a.ok)return a;var c=Object.entries(r).reduce(function(u,l){var f=Ra(l,2),m=f[0],y=f[1];return Ta(Fr({},u),Lt({},m,typeof y=="function"?y(a.value):y))},{});return{ok:!0,value:Fr({},a.value,c)}},json:function(n,i){if(!H(n)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"object")}]}}var c=new Set(Object.keys(r)),u=ve(n,Object.keys(n).filter(function(l){return!c.has(l)}));return e.json(u,i)},getType:function(){return e.getType()}};return Fr({},t,x(t),K(t))}function Wt(e,r){return{rawKey:e,valueSchema:r,isProperty:!0}}function G(e){return e.isProperty}function Hr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Na(e){if(Array.isArray(e))return e}function Ua(e){if(Array.isArray(e))return Hr(e)}function Ca(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Da(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ka(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function Ka(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ma(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ca(e,i,t[i])})}return e}function Ba(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function _e(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ba(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Se(e,r){return Na(e)||ka(e,r)||Ht(e,r)||Ka()}function D(e){return Ua(e)||Da(e)||Ht(e)||Ma()}function Ht(e,r){if(e){if(typeof e=="string")return Hr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Hr(e,r)}}function We(e){var r={_getRawProperties:function(){return Object.entries(e).map(function(t){var n=Se(t,2),i=n[0],a=n[1];return G(a)?a.rawKey:i})},_getParsedProperties:function(){return xe(e)},parse:function(t,n){var i={},a=[],c=!0,u=!1,l=void 0;try{for(var f=he(e)[Symbol.iterator](),m;!(c=(m=f.next()).done);c=!0){var y=Se(m.value,2),_=y[0],g=y[1],b=G(g)?g.rawKey:_,h=G(g)?g.valueSchema:g,O={rawKey:b,parsedKey:_,valueSchema:h};i[b]=O,Vt(h)&&a.push(b)}}catch(S){u=!0,l=S}finally{try{!c&&f.return!=null&&f.return()}finally{if(u)throw l}}return Jt({value:t,requiredKeys:a,getProperty:function(S){var C=i[S];if(C!=null)return{transformedKey:C.parsedKey,transform:function(k){var N;return C.valueSchema.parse(k,_e(M({},n),{breadcrumbsPrefix:D((N=n?.breadcrumbsPrefix)!==null&&N!==void 0?N:[]).concat([S])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:function(t,n){var i=[],a=!0,c=!1,u=void 0;try{for(var l=he(e)[Symbol.iterator](),f;!(a=(f=l.next()).done);a=!0){var m=Se(f.value,2),y=m[0],_=m[1],g=G(_)?_.valueSchema:_;Vt(g)&&i.push(y)}}catch(b){c=!0,u=b}finally{try{!a&&l.return!=null&&l.return()}finally{if(c)throw u}}return Jt({value:t,requiredKeys:i,getProperty:function(b){var h=e[b];if(h!=null)return G(h)?{transformedKey:h.rawKey,transform:function(O){var S;return h.valueSchema.json(O,_e(M({},n),{breadcrumbsPrefix:D((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}:{transformedKey:b,transform:function(O){var S;return h.json(O,_e(M({},n),{breadcrumbsPrefix:D((S=n?.breadcrumbsPrefix)!==null&&S!==void 0?S:[]).concat([b])}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:function(){return p.OBJECT}};return M({},A(r),x(r),K(r),Y(r))}function Jt(e){var r=e.value,t=e.requiredKeys,n=e.getProperty,i=e.unrecognizedObjectKeys,a=i===void 0?"fail":i,c=e.skipValidation,u=c===void 0?!1:c,l=e.breadcrumbsPrefix,f=l===void 0?[]:l,m;if(!H(r))return{ok:!1,errors:[{path:f,message:v(r,"object")}]};var y=new Set(t),_=[],g={},b=!0,h=!1,O=void 0;try{for(var S=Object.entries(r)[Symbol.iterator](),C;!(b=(C=S.next()).done);b=!0){var k=Se(C.value,2),N=k[0],xr=k[1],_r=n(N);if(_r!=null){y.delete(N);var Sr=_r.transform(xr);if(Sr.ok)g[_r.transformedKey]=Sr.value;else{var ot;g[N]=xr,(ot=_).push.apply(ot,D(Sr.errors))}}else switch(a){case"fail":_.push({path:D(f).concat([N]),message:'Unexpected key "'.concat(N,'"')});break;case"strip":break;case"passthrough":g[N]=xr;break}}}catch(ue){h=!0,O=ue}finally{try{!b&&S.return!=null&&S.return()}finally{if(h)throw O}}return(m=_).push.apply(m,D(t.filter(function(ue){return y.has(ue)}).map(function(ue){return{path:f,message:'Missing required key "'.concat(ue,'"')}}))),_.length===0||u?{ok:!0,value:g}:{ok:!1,errors:_}}function Y(e){return{extend:function(r){var t={_getParsedProperties:function(){return D(e._getParsedProperties()).concat(D(r._getParsedProperties()))},_getRawProperties:function(){return D(e._getRawProperties()).concat(D(r._getRawProperties()))},parse:function(n,i){return Ft({extensionKeys:r._getRawProperties(),value:n,transformBase:function(a){return e.parse(a,i)},transformExtension:function(a){return r.parse(a,i)}})},json:function(n,i){return Ft({extensionKeys:r._getParsedProperties(),value:n,transformBase:function(a){return e.json(a,i)},transformExtension:function(a){return r.json(a,i)}})},getType:function(){return p.OBJECT}};return M({},t,x(t),K(t),Y(t))},passthrough:function(){var r={_getParsedProperties:function(){return e._getParsedProperties()},_getRawProperties:function(){return e._getRawProperties()},parse:function(t,n){var i=e.parse(t,_e(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},json:function(t,n){var i=e.json(t,_e(M({},n),{unrecognizedObjectKeys:"passthrough"}));return i.ok?{ok:!0,value:M({},t,i.value)}:i},getType:function(){return p.OBJECT}};return M({},r,x(r),K(r),Y(r))}}}function Ft(e){var r=e.extensionKeys,t=e.value,n=e.transformBase,i=e.transformExtension,a=new Set(r),c=Se(Mt(xe(t),function(y){return a.has(y)}),2),u=c[0],l=c[1],f=n(ve(t,l)),m=i(ve(t,u));return f.ok&&m.ok?{ok:!0,value:M({},f.value,m.value)}:{ok:!1,errors:D(f.ok?[]:f.errors).concat(D(m.ok?[]:m.errors))}}function Vt(e){return!La(e)}function La(e){switch(e.getType()){case p.ANY:case p.UNKNOWN:case p.OPTIONAL:case p.OPTIONAL_NULLABLE:return!0;default:return!1}}function Gt(e){return We(e)}function Wa(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function qt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Wa(e,i,t[i])})}return e}function Ja(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Fa(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ja(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function $t(e){var r=Fa(qt({},Jr(e)),{_getRawProperties:function(){return ne(e)._getRawProperties()},_getParsedProperties:function(){return ne(e)._getParsedProperties()}});return qt({},r,x(r),K(r),Y(r))}function qr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Va(e){if(Array.isArray(e))return qr(e)}function Ha(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ga(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Ha(e,i,t[i])})}return e}function $a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function Yt(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function Ee(e){return Va(e)||Ga(e)||Ya(e)||qa()}function Ya(e,r){if(e){if(typeof e=="string")return qr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qr(e,r)}}function Je(e){var r={parse:function(t,n){return Xt(t,function(i,a){var c;return e.parse(i,Yt(Gr({},n),{breadcrumbsPrefix:Ee((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},json:function(t,n){return Xt(t,function(i,a){var c;return e.json(i,Yt(Gr({},n),{breadcrumbsPrefix:Ee((c=n?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["[".concat(a,"]")])}))})},getType:function(){return p.LIST}};return Gr({},A(r),x(r))}function Xt(e,r){if(!Array.isArray(e))return{ok:!1,errors:[{message:v(e,"list"),path:[]}]};var t=e.map(function(n,i){return r(n,i)});return t.reduce(function(n,i){if(n.ok&&i.ok)return{ok:!0,value:Ee(n.value).concat([i.value])};var a=[];if(!n.ok){var c;(c=a).push.apply(c,Ee(n.errors))}if(!i.ok){var u;(u=a).push.apply(u,Ee(i.errors))}return{ok:!1,errors:a}},{ok:!0,value:[]})}function Qt(e){var r=R(p.STRING_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,'"'.concat(e,'"'))}]}});return r()}function Zt(e){var r=R(p.BOOLEAN_LITERAL,function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.breadcrumbsPrefix,a=i===void 0?[]:i;return t===e?{ok:!0,value:e}:{ok:!1,errors:[{path:a,message:v(t,"".concat(e.toString()))}]}});return r()}var eo=R(p.ANY,function(e){return{ok:!0,value:e}});var ro=R(p.BOOLEAN,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="boolean"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"boolean")}]}});var to=R(p.NUMBER,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="number"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"number")}]}});var oo=R(p.STRING,function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=r.breadcrumbsPrefix,n=t===void 0?[]:t;return typeof e=="string"?{ok:!0,value:e}:{ok:!1,errors:[{path:n,message:v(e,"string")}]}});var no=R(p.UNKNOWN,function(e){return{ok:!0,value:e}});function $r(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function Xa(e){if(Array.isArray(e))return e}function Qa(e){if(Array.isArray(e))return $r(e)}function ao(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Za(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function es(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function rs(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ts(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ie(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ao(e,i,t[i])})}return e}function os(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function we(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):os(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function ns(e,r){return Xa(e)||es(e,r)||so(e,r)||rs()}function X(e){return Qa(e)||Za(e)||so(e)||ts()}function so(e,r){if(e){if(typeof e=="string")return $r(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return $r(e,r)}}function co(e,r){var t={parse:function(n,i){return io({value:n,isKeyNumeric:e.getType()===p.NUMBER,transformKey:function(a){var c;return e.parse(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.parse(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},json:function(n,i){return io({value:n,isKeyNumeric:e.getType()===p.NUMBER,transformKey:function(a){var c;return e.json(a,we(ie({},i),{breadcrumbsPrefix:X((c=i?.breadcrumbsPrefix)!==null&&c!==void 0?c:[]).concat(["".concat(a," (key)")])}))},transformValue:function(a,c){var u;return r.json(a,we(ie({},i),{breadcrumbsPrefix:X((u=i?.breadcrumbsPrefix)!==null&&u!==void 0?u:[]).concat(["".concat(c)])}))},breadcrumbsPrefix:i?.breadcrumbsPrefix})},getType:function(){return p.RECORD}};return ie({},A(t),x(t))}function io(e){var r=e.value,t=e.isKeyNumeric,n=e.transformKey,i=e.transformValue,a=e.breadcrumbsPrefix,c=a===void 0?[]:a;return H(r)?he(r).reduce(function(u,l){var f=ns(l,2),m=f[0],y=f[1];if(y===void 0)return u;var _=u,g=m;if(t){var b=m.length>0?Number(m):NaN;isNaN(b)||(g=b)}var h=n(g),O=i(y,g);if(_.ok&&h.ok&&O.ok)return{ok:!0,value:we(ie({},_.value),ao({},h.value,O.value))};var S=[];if(!_.ok){var C;(C=S).push.apply(C,X(_.errors))}if(!h.ok){var k;(k=S).push.apply(k,X(h.errors))}if(!O.ok){var N;(N=S).push.apply(N,X(O.errors))}return{ok:!1,errors:S}},{ok:!0,value:{}}):{ok:!1,errors:[{path:c,message:v(r,"object")}]}}function Yr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function is(e){if(Array.isArray(e))return Yr(e)}function as(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ss(e,r){return r!=null&&typeof Symbol<"u"&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r}function cs(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function us(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function fs(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){as(e,i,t[i])})}return e}function ls(e){return is(e)||cs(e)||ms(e)||us()}function ms(e,r){if(e){if(typeof e=="string")return Yr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Yr(e,r)}}function uo(e){var r=Je(e),t={parse:function(n,i){var a=r.parse(n,i);return a.ok?{ok:!0,value:new Set(a.value)}:a},json:function(n,i){if(!ss(n,Set)){var a;return{ok:!1,errors:[{path:(a=i?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],message:v(n,"Set")}]}}var c=r.json(ls(n),i);return c},getType:function(){return p.SET}};return fs({},A(t),x(t))}function fo(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function ps(e){if(Array.isArray(e))return e}function ds(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function ys(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n=[],i=!0,a=!1,c,u;try{for(t=t.call(e);!(i=(c=t.next()).done)&&(n.push(c.value),!(r&&n.length===r));i=!0);}catch(l){a=!0,u=l}finally{try{!i&&t.return!=null&&t.return()}finally{if(a)throw u}}return n}}function bs(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function mo(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){ds(e,i,t[i])})}return e}function gs(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),t.push.apply(t,n)}return t}function hs(e,r){return r=r??{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gs(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}function vs(e,r){return ps(e)||ys(e,r)||xs(e,r)||bs()}function xs(e,r){if(e){if(typeof e=="string")return fo(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return fo(e,r)}}function po(e){var r={parse:function(t,n){return lo(function(i,a){return i.parse(t,a)},e,n)},json:function(t,n){return lo(function(i,a){return i.json(t,a)},e,n)},getType:function(){return p.UNDISCRIMINATED_UNION}};return mo({},A(r),x(r))}function lo(e,r,t){var n=[],i=!0,a=!1,c=void 0;try{for(var u=r.entries()[Symbol.iterator](),l;!(i=(l=u.next()).done);i=!0){var f=vs(l.value,2),m=f[0],y=f[1],_=e(y,hs(mo({},t),{skipValidation:!1}));if(_.ok)return _;var g=!0,b=!1,h=void 0;try{for(var O=_.errors[Symbol.iterator](),S;!(g=(S=O.next()).done);g=!0){var C=S.value;n.push({path:C.path,message:"[Variant ".concat(m,"] ").concat(C.message)})}}catch(k){b=!0,h=k}finally{try{!g&&O.return!=null&&O.return()}finally{if(b)throw h}}}}catch(k){a=!0,c=k}finally{try{!i&&u.return!=null&&u.return()}finally{if(a)throw c}}return{ok:!1,errors:n}}function yo(e,r){return{parsedDiscriminant:e,rawDiscriminant:r}}function Xr(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function _s(e){if(Array.isArray(e))return Xr(e)}function Qr(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function Ss(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Es(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Zr(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.forEach(function(i){Qr(e,i,t[i])})}return e}function ws(e,r){if(e==null)return{};var t=Is(e,r),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(r.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function Is(e,r){if(e==null)return{};var t={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(r.indexOf(i)>=0)&&(t[i]=e[i]);return t}function et(e){return _s(e)||Ss(e)||zs(e)||Es()}function Os(e,r){if(rt(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r||"default");if(rt(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function As(e){var r=Os(e,"string");return rt(r)==="symbol"?r:String(r)}function rt(e){"@swc/helpers - typeof";return e&&typeof Symbol<"u"&&e.constructor===Symbol?"symbol":typeof e}function zs(e,r){if(e){if(typeof e=="string")return Xr(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);if(t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set")return Array.from(t);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Xr(e,r)}}function go(e,r){var t=typeof e=="string"?e:e.rawDiscriminant,n=typeof e=="string"?e:e.parsedDiscriminant,i=Le(xe(r)),a={parse:function(c,u){return bo({value:c,discriminant:t,transformedDiscriminant:n,transformDiscriminantValue:function(l){var f;return i.parse(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:et((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([t])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.parse(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},json:function(c,u){return bo({value:c,discriminant:n,transformedDiscriminant:t,transformDiscriminantValue:function(l){var f;return i.json(l,{allowUnrecognizedEnumValues:u?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:et((f=u?.breadcrumbsPrefix)!==null&&f!==void 0?f:[]).concat([n])})},getAdditionalPropertiesSchema:function(l){return r[l]},allowUnrecognizedUnionMembers:u?.allowUnrecognizedUnionMembers,transformAdditionalProperties:function(l,f){return f.json(l,u)},breadcrumbsPrefix:u?.breadcrumbsPrefix})},getType:function(){return p.UNION}};return Zr({},A(a),x(a),K(a))}function bo(e){var r=e.value,t=e.discriminant,n=e.transformedDiscriminant,i=e.transformDiscriminantValue,a=e.getAdditionalPropertiesSchema,c=e.allowUnrecognizedUnionMembers,u=c===void 0?!1:c,l=e.transformAdditionalProperties,f=e.breadcrumbsPrefix,m=f===void 0?[]:f;if(!H(r))return{ok:!1,errors:[{path:m,message:v(r,"object")}]};var y=r[t],_=ws(r,[t].map(As));if(y==null)return{ok:!1,errors:[{path:m,message:'Missing discriminant ("'.concat(t,'")')}]};var g=i(y);if(!g.ok)return{ok:!1,errors:g.errors};var b=a(g.value);if(b==null)return u?{ok:!0,value:Zr(Qr({},n,g.value),_)}:{ok:!1,errors:[{path:et(m).concat([t]),message:"Unexpected discriminant value"}]};var h=l(_,b);return h.ok?{ok:!0,value:Zr(Qr({},n,y),h.value)}:h}var w=o.object({organizationId:o.string(),agentId:o.string(),settings:o.record(o.string(),o.unknown())});var ho=o.object({}).extend(w);var vo=o.object({}).extend(w);var xo=o.object({}).extend(w);var Fe=o.enum_(["AGENT","ASSET","CONVERSATION","CONVERSATION_MESSAGE","KNOWLEDGE_BASE","KNOWLEDGE_BASE_VERSION","KNOWLEDGE_DOCUMENT","ACTION","USER","EVENT","EVENT_TRIGGER","USER_PROFILE","FEEDBACK","INBOX_ITEM","INBOX_ITEM_FIX","SEGMENT","CUSTOMER"]);var I=o.object({referenceId:o.string()});var P=o.object({type:Fe,appId:o.string()}).extend(I);var d=o.object({organizationId:o.string(),agentId:o.string()}).extend(P);var Ve=o.enum_(["THUMBS_UP","THUMBS_DOWN","INSERT","HANDOFF"]);var _o=o.object({type:Ve,text:o.string().optional()});var So=o.object({feedbackId:d,conversationId:d,conversationMessageId:d,userId:d.optional(),createdAt:o.date().optional()}).extend(_o);var Eo=o.object({feedbacks:o.list(So)}).extend(w);var q=o.enum_(["BUTTON_CLICKED","LINK_CLICKED","CHAT_OPENED","CHAT_CLOSED","TEXT_INSERTED"]);var wo=o.object({id:d.optional(),userDisplayName:o.string().optional()});var Io=o.object({surveyQuestion:o.string().optional(),surveyAnswer:o.string().optional()});var He=o.object({rating:o.number().optional(),thumbUp:o.boolean().optional(),survey:Io.optional()});var Ge=o.object({pageName:o.string().optional(),pageUrl:o.string().optional(),pageTitle:o.string().optional(),linkUrl:o.string().optional(),elementId:o.string().optional()});var $=o.object({entityId:d,scopeEntityId:d.optional()});var Oo=o.enum_(["WEB","API","SYSTEM"]);var Ao=o.enum_(["DESKTOP","MOBILE","TABLET","OTHER"]);var zo=o.enum_(["WINDOWS","MACOS","LINUX","ANDROID","IOS","OTHER"]);var Po=o.object({type:zo.optional(),name:o.string().optional(),version:o.string().optional()});var To=o.object({type:Ao,name:o.string().optional(),version:o.string().optional(),osInfo:Po.optional()});var Ro=o.enum_(["CHROME","FIREFOX","SAFARI","OPERA","EDGE","OTHER"]);var jo=o.object({type:Ro,name:o.string().optional(),version:o.string().optional(),userAgent:o.string().optional()});var No=o.object({city:o.string().optional(),state:o.string().optional(),country:o.string().optional(),region:o.string().optional(),latitude:o.number().optional(),longitude:o.number().optional()});var Uo=o.object({ip:o.string().optional()});var Co=o.object({code:o.string().optional()});var Do=o.object({type:Oo,deviceInfo:To.optional(),browserInfo:jo.optional(),geoInfo:No.optional(),ipInfo:Uo.optional(),languageInfo:Co.optional()});var ko=o.object({id:o.string(),start:o.date().optional(),end:o.date().optional(),duration:o.number().optional()});var Ko=o.object({additionalData:o.record(o.string(),o.string())});var ae=o.object({timestamp:o.date().optional(),references:o.list($).optional(),sourceInfo:Do.optional(),sessionInfo:ko.optional(),contextInfo:Ko.optional()});var Mo=o.object({id:d,eventName:q,userInfo:wo,feedbackInfo:o.list(He).optional(),pageInfo:Ge.optional()}).extend(ae);var qe=o.enum_(["APP_INSTALLED","APP_UNINSTALLED","APP_UPDATED"]);var $e=o.object({eventName:qe}).extend(ae);var Bo=o.object({id:d}).extend($e);var Ye=o.union("eventType",{userEvent:Mo,systemEvent:Bo}).transform({transform:function(e){return e},untransform:function(e){return e}});var Lo=o.object({events:o.list(Ye)}).extend(w);var Wo=o.object({conversations:o.list(d)}).extend(w);var Jo=o.object({inboxItemIds:o.list(d)}).extend(w);var Fo=o.enum_(["EMAIL","PHONE_NUMBER"]);var Xe=o.object({value:o.string(),type:Fo});var Qe=o.object({referenceId:o.string(),appId:o.string()});var Ze=o.enum_(["VISIBLE","PARTIALLY_VISIBLE","HIDDEN"]);var er=o.object({value:o.string(),visibility:Ze});var rr=o.object({userId:Qe}).extend(er);var Vo=o.object({userId:I.optional(),agentUserId:o.string().optional(),userIdentifiers:o.list(Xe),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string()),agentUserData:o.record(o.string(),o.list(rr))});var Ho=o.object({actionId:o.string(),conversationId:d.optional(),conversationMetadata:o.record(o.string(),o.string()),parameters:o.record(o.string(),o.unknown()),user:Vo,transientData:o.record(o.string(),o.string()).optional()}).extend(w);var ry=o.object({response:o.string()});var Go=o.object({knowledgeBaseId:I}).extend(w);var qo=o.enum_(["PENDING","PROCESSING","ACCEPTED","REJECTED"]);var tr=o.object({type:o.string(),name:o.string().optional()});var se=o.object({url:o.string().optional(),sizeBytes:o.number().optional(),status:qo}).extend(tr);var or=o.enum_(["SENDING","SENT","REJECTED","CANCELED","FAILED","UNKNOWN"]);var $o=o.enum_(["NOT_ASKED","LLM_ENABLED","LLM_DISABLED"]);var Yo=o.enum_(["USER","HUMAN_AGENT","EXTERNAL_SYSTEM"]);var nr=o.object({createdAt:o.date().optional(),updatedAt:o.date().optional()});var Xo=o.object({userId:I,text:o.string(),userMessageType:Yo}).extend(nr);var Qo=o.object({conversationMessageId:d,language:o.string().optional(),attachments:o.list(se),agentUserId:o.string().optional(),userDisplayName:o.string().optional(),status:or,responseState:$o.optional()}).extend(Xo);var Zo=o.enum_(["BOT_RESPONSE","BOT_SUGGESTION"]);var en=o.object({text:o.string()});var ir=o.enum_(["STRING","MULTILINE","BOOLEAN","NUMBER","DATETIME","DATE","TIME","EMAIL","SCHEMA","FILE","OAUTH"]);var ar=o.object({label:o.string(),value:o.unknown()});var rn=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),suggestion:o.unknown().optional(),type:ir,enumOptions:o.list(ar).optional()});var tn=o.object({id:o.string(),actionId:P,formLabel:o.string(),fields:o.list(rn),submitLabel:o.string()});var on=o.object({buttonName:o.string(),url:o.string().optional()});var nn=o.enum_(["HIGHCHARTS_TS"]);var an=o.object({label:o.string(),specSchema:nn,spec:o.string()});var sn=o.object({label:o.string().optional(),object:o.unknown()});var cn=o.union("type",{text:en,actionForm:tn,oauthButton:on,chart:an,object:sn}).transform({transform:function(e){return e},untransform:function(e){return e}});var un=o.object({title:o.string(),url:o.string()});var fn=o.object({followupQuestions:o.list(o.string()),sources:o.list(un),language:o.string().optional()});var tt=o.object({knowledgeBaseId:P,documentId:P,documentName:o.string(),documentExcerpt:o.string()});var ln=o.object({knowledgeReviewed:o.list(tt),knowledgeUtilized:o.list(tt)});var sr=o.object({actionId:P,actionName:o.string()});var mn=o.union("valueType",{primitive:o.object({value:o.unknown()}),attachment:se}).transform({transform:function(e){return e},untransform:function(e){return e}});var cr=o.object({actionParameters:o.record(o.string(),mn),executionResult:o.string().optional(),executionError:o.string().optional()}).extend(sr);var pn=o.object({actionsReviewed:o.list(sr),actionsExecuted:o.list(cr)});var dn=o.object({}).extend(cr);var yn=o.object({category:o.string(),harmfulContentDetected:o.boolean(),severity:o.number(),threshold:o.number()});var bn=o.object({attackDetected:o.boolean(),harmfulContentDetected:o.boolean(),harmfulContentAnalysis:o.list(yn)});var gn=o.object({safetyCheckPassed:o.boolean(),report:bn.optional()});var hn=o.object({userData:o.record(o.string(),o.string())});var vn=o.object({matchingSegmentIds:o.list(d)});var xn=o.union("type",{knowledge:ln,actions:pn,form:dn,safety:gn,user:hn,segments:vn}).transform({transform:function(e){return e},untransform:function(e){return e}});var _n=o.object({items:o.list(xn)});var Sn=o.object({conversationMessageId:d,botMessageType:Zo,responses:o.list(cn),metadata:fn,status:or,logic:_n.optional()}).extend(nr);var ur=o.union("type",{user:Qo,bot:Sn}).transform({transform:function(e){return e},untransform:function(e){return e}});var En=o.object({conversationId:d,message:ur}).extend(w);var tg=o.object({message:o.string().optional()});var ig=o.object({name:o.string().optional()}).extend(Qe);var fr=o.enum_(["USER","SYSTEM"]);var lr=o.object({id:I});var yg=o.object({id:I,eventName:q,eventType:fr,userInfo:lr.optional(),timestamp:o.date().optional(),reference:$.optional()});var wn=o.object({id:I,eventName:q,userInfo:lr,feedbackInfo:o.list(He).optional(),pageInfo:Ge.optional()}).extend(ae);var In=o.object({id:I}).extend($e);var Pg=o.union("eventType",{userEvent:wn,systemEvent:In}).transform({transform:function(e){return e},untransform:function(e){return e}});var On=o.enum_(["CREATED_AT","EVENT_NAME","EVENT_TYPE","APP","SESSION_ID","SOURCE_TYPE","SOURCE_LANGUAGE_CODE","SOURCE_DEVICE_TYPE","SOURCE_DEVICE_NAME","SOURCE_BROWSER_TYPE","SOURCE_BROWSER_NAME","SOURCE_GEO_CITY","SOURCE_GEO_STATE","SOURCE_GEO_COUNTRY","USER_REFERENCE_ID","AGENT_USER_ID"]);var An=o.object({search:o.string().optional(),createdAfter:o.date().optional(),createdBefore:o.date().optional(),references:o.list($).optional(),eventTypes:o.list(fr).optional(),userEventNames:o.list(q).optional(),systemEventNames:o.list(qe).optional(),agentUserIds:o.list(o.string()).optional(),legacyFeedbackTypes:o.list(Ve).optional(),hasEventText:o.boolean().optional()});var mr=o.object({page:o.number().optional(),size:o.number().optional(),sortDesc:o.boolean().optional()});var Wg=o.object({sort:On.optional(),filter:An.optional()}).extend(mr);var zn=o.object({number:o.number(),size:o.number(),totalElements:o.number(),totalPages:o.number()});var Gg=o.object({events:o.list(Ye)}).extend(zn);var Pn=o.enum_(["basic","post"]);var Tn=o.enum_(["text","array","complexarray","color","image","multiline","checkbox","dropdown","section","oauth","number"]);var Rn=o.object({pattern:o.string(),errorMessage:o.string()});var jn=o.object({key:o.string(),displayName:o.string(),description:o.string().optional(),type:Tn,visibility:Ze.optional(),required:o.boolean().optional(),defaultValue:o.unknown().optional(),validation:Rn.optional(),fields:o.lazy(function(){return Nn}).optional(),dropdownOptions:o.list(o.string()).optional(),oauthScopes:o.list(o.string()).optional(),scopeLabels:o.list(o.unknown()).optional(),oauthRedirectUri:o.string().optional(),oauthClientId:o.string().optional(),oauthAuthorizationUrl:o.string().optional(),oauthClientSecret:o.string().optional(),oauthTokenUrl:o.string().optional(),oauthAuthenticationMethod:Pn.optional()});var Nn=o.list(o.lazyObject(function(){return jn}));var pr=o.object({identifiers:o.list(Xe),data:o.record(o.string(),er)});var uh=o.object({userId:I}).extend(pr);var dh=o.object({userId:d,agentUserId:o.string(),allUserData:o.record(o.string(),o.record(o.string(),o.string())),defaultUserData:o.record(o.string(),o.string()),agentUserData:o.record(o.string(),o.list(rr))}).extend(pr);var gh=o.object({sortId:o.string().optional()}).extend(mr);var Un=o.enum_(["POSITIVE","NEGATIVE","NEUTRAL","MIXED","UNKNOWN"]);var Cn=o.enum_(["GOOD","NEEDS_IMPROVEMENT","UNKNOWN"]);var Dn=o.enum_(["MISSING_KNOWLEDGE","MISSING_USER_INFORMATION","MISSING_ACTION","NEEDS_USER_CLARIFICATION","UNSUPPORTED_FORMAT","INTERRUPTED","UNSUPPORTED_USER_BEHAVIOR","UNKNOWN","NO_BOT_REPLIES"]);var kn=o.object({actionIds:o.list(P),incompleteActionIds:o.list(P),insertCount:o.number(),thumbsUpCount:o.number(),thumbsDownCount:o.number(),handoffCount:o.number(),userMessageCount:o.number(),botMessageCount:o.number(),handleTime:o.number().optional(),humanAgentResponseDelay:o.number().optional(),humanAgents:o.list(o.string()),humanAgentsWithInserts:o.list(o.string()),users:o.list(o.string()),userIdentifiers:o.list(o.string()),lastUserMessage:o.string().optional(),lastBotMessage:o.string().optional(),involvedAppIds:o.set(o.string())});var Kn=o.object({userRequest:o.string().optional(),agentResponse:o.string().optional(),resolutionStatus:o.string().optional(),category:o.string().optional(),sentiment:Un.optional(),quality:Cn.optional(),qualityReason:Dn.optional(),resolvedByMaven:o.boolean().optional(),primaryLanguage:o.string().optional(),predictedNps:o.number().optional()});var Mn=o.object({conversationId:P});var dr=o.enum_(["SHORT","MEDIUM","LONG"]);var Bn=o.enum_(["MARKDOWN","FORMS","IMAGES","CHARTS_HIGHCHARTS_TS","ASYNC","OAUTH_BUTTONS"]);var Ln=o.object({entities:o.list($)});var Wn=o.object({entityTypes:o.set(Fe)});var Jn=o.union("scopeType",{byEntities:Ln,byEntityTypes:Wn}).transform({transform:function(e){return e},untransform:function(e){return e}});var Fn=o.object({capabilities:o.list(Bn),isCopilot:o.boolean(),responseLength:dr,contextFilter:Jn.optional()});var Vn=o.enum_(["CASUAL_BUDDY","EMPATHETIC_SUPPORTER","FORMAL_PROFESSIONAL","CONCISE_EXPERT","ENTHUSIASTIC_HELPER","PATIENT_EDUCATOR","PIRATE"]);var Hn=o.object({additionalPromptText:o.string().optional(),persona:Vn.optional(),availableKnowledgeBases:o.list(d).optional()});var yr=o.object({responseConfig:Fn.optional(),subject:o.string().optional(),url:o.string().optional(),createdAt:o.date().optional(),updatedAt:o.date().optional(),tags:o.set(o.string()).optional(),metadata:o.record(o.string(),o.string()).optional(),allMetadata:o.record(o.string(),o.record(o.string(),o.string())),conversationId:d,analysis:Kn,summary:kn,deleted:o.boolean(),open:o.boolean(),llmEnabled:o.boolean(),simulationContext:Hn.optional()});var tv=o.object({messages:o.list(ur),attachments:o.list(se)}).extend(yr);var iv=o.object({}).extend(yr);var uv=o.object({content:o.string().optional(),assetId:I.optional()}).extend(tr);var Gn=o.object({authorizationUrl:o.string(),tokenUrl:o.string(),clientId:o.string(),clientSecret:o.string(),scopes:o.list(o.string()),extraAuthParams:o.record(o.string(),o.string()).optional(),extraTokenParams:o.record(o.string(),o.string()).optional()});var qn=o.object({id:o.string(),label:o.string(),description:o.string(),required:o.boolean(),hidden:o.boolean().optional(),type:ir.optional(),enumOptions:o.list(ar).optional(),schema:o.string().optional(),oauthConfiguration:Gn.optional()});var $n=o.object({name:o.string(),description:o.string(),userInteractionRequired:o.boolean(),buttonName:o.string().optional(),precondition:o.lazy(function(){return br}).optional(),userFormParameters:o.list(qn),language:o.string().optional()});var Yn=o.enum_(["ALWAYS","WHEN_RELEVANT","NEVER"]);var Sv=o.object({actionId:d,instructions:o.string().optional(),llmInclusionStatus:Yn,segmentId:d.optional(),preconditionExplanation:o.string().optional(),deleted:o.boolean()}).extend($n);var Xn=o.enum_(["NOT"]);var L=o.object({operator:Xn.optional()});var gr=o.object({key:o.string(),value:o.string().optional()}).extend(L);var Qn=o.object({tags:o.set(o.string())}).extend(L);var Zn=o.object({actionId:o.string(),appId:o.string().optional()}).extend(L);var ei=o.object({useMarkdown:o.boolean().optional(),useForms:o.boolean().optional(),useImages:o.boolean().optional(),isCopilot:o.boolean().optional(),responseLength:dr.optional()}).extend(L);var ri=o.object({appId:o.string()}).extend(L);var ti=o.union("conversationPreconditionType",{tags:Qn,metadata:gr,actionExecuted:Zn,responseConfig:ei,app:ri}).transform({transform:function(e){return e},untransform:function(e){return e}});var br=o.union("preconditionType",{user:gr,conversation:o.object({value:ti}),group:o.lazyObject(function(){return oi})}).transform({transform:function(e){return e},untransform:function(e){return e}});var ni=o.enum_(["AND","OR"]);var oi=o.object({operator:ni,preconditions:o.list(o.lazy(function(){return br}))});var Oe=o.object({knowledgeBaseId:P,documentId:P,title:o.string().optional(),snippet:o.string().optional()});var ii=o.enum_(["OPEN","USER_RESOLVED","SYSTEM_RESOLVED","REGRESSED","IGNORED"]);var Zv=o.enum_(["DUPLICATE_DOCUMENT","MISSING_KNOWLEDGE","CUSTOM"]);var ai=o.enum_(["LOW","MEDIUM","HIGH"]);var hr=o.object({id:d});var Ae=o.object({documentInformation:Oe}).extend(hr);var ce=o.object({id:d,createdAt:o.date(),updatedAt:o.date(),status:ii,severity:ai});var si=o.object({recommendedFixes:o.list(Ae),otherFixes:o.list(Ae),sourceDocument:Oe,documents:o.list(Oe)}).extend(ce);var vr=o.object({suggestedTextTitle:o.string(),suggestedText:o.string()}).extend(hr);var ci=o.object({fix:vr,conversations:o.list(Mn)}).extend(ce);var ui=o.object({metadata:o.record(o.string(),o.string())}).extend(ce);var Ox=o.union("type",{duplicateDocuments:si,missingKnowledge:ci,custom:ui}).transform({transform:function(e){return e},untransform:function(e){return e}});var Tx=o.union("type",{addDocument:vr,deactivateDocument:Ae}).transform({transform:function(e){return e},untransform:function(e){return e}});var jx=o.object({greaterThanOrEqual:o.number().optional(),lessThan:o.number().optional()});var Ux=o.enum_(["Name","Email","PhoneNumber","StreetAddress","CreditCardNumber","UsBankAccountNumber","UsSocialSecurityNumber","UsUkPassportNumber","UsDriversLicenseNumber","UsIndividualTaxpayerIdentification","Date","IpAddress","Url","AbaRoutingNumber","Age","SwiftCode","AuBankAccountNumber","AuBusinessNumber","AuCompanyNumber","AuDriversLicenseNumber","AuMedicalAccountNumber","AuPassportNumber","AuTaxFileNumber","CaBankAccountNumber","CaDriversLicenseNumber","CaHealthServiceNumber","CaPassportNumber","CaPersonalHealthIdentification","CaSocialInsuranceNumber","EsDni","EsSocialSecurityNumber","EsTaxIdentificationNumber","EuDebitCardNumber","EuDriversLicenseNumber","EuGpsCoordinates","EuNationalIdentificationNumber","EuPassportNumber","EuSocialSecurityNumber","EuTaxIdentificationNumber","FrDriversLicenseNumber","FrHealthInsuranceNumber","FrNationalId","FrPassportNumber","FrSocialSecurityNumber","FrTaxIdentificationNumber","FrValueAddedTaxNumber","InternationalBankingAccountNumber","NzBankAccountNumber","NzDriversLicenseNumber","NzInlandRevenueNumber","NzMinistryOfHealthNumber","NzSocialWelfareNumber","UkDriversLicenseNumber","UkElectoralRollNumber","UkNationalHealthNumber","UkNationalInsuranceNumber","UkUniqueTaxpayerNumber"]);import W from"../..";async function J(e){let r=e.headers.get("authorization").replace("Bearer ","");if(process.env.MAVENAGI_WEBHOOK_SECRET){let a=await crypto.subtle.importKey("raw",Buffer.from(process.env.MAVENAGI_WEBHOOK_SECRET,"base64"),{name:"HMAC",hash:"SHA-256"},!1,["sign","verify"]);await Ne(r,a,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID});return}let n=\`https://developers\${process.env.ENVIRONMENT===void 0?"":\`.\${process.env.ENVIRONMENT==="sandbox"?\`\${process.env.SANDBOX_USER}.sb\`:process.env.ENVIRONMENT}\`}.mavenagi-apis.com/.well-known/jwks\`,i=Ur(new URL(n));await Ne(r,i,{issuer:"https://developers.mavenagi.com",audience:process.env.MAVENAGI_APP_ID})}async function jE(e){await J(e);let{organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f}=Ho.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{let m=await W.executeAction?.({organizationId:r,agentId:t,settings:n,actionId:i,conversationId:a,conversationMetadata:c,parameters:u,user:l,transientData:f});return new Response(JSON.stringify({response:m}),{status:200,headers:{"Content-Type":"application/json"}})}catch(m){return console.error(m),m instanceof Error?new Response(m.message,{status:500}):new Response("No result returned",{status:204})}}async function NE(e){await J(e);let{organizationId:r,agentId:t,settings:n,feedbacks:i}=Eo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.feedbackCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,feedbacks:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function UE(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversations:i}=Wo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.conversationCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,conversations:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function CE(e){await J(e);let{organizationId:r,agentId:t,settings:n,inboxItemIds:i}=Jo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.inboxItemCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,inboxItemIds:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function DE(e){await J(e);let{organizationId:r,agentId:t,settings:n,events:i}=Lo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.eventCreatedOrUpdated?.({organizationId:r,agentId:t,settings:n,events:i}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function kE(e){await J(e);let{organizationId:r,agentId:t,settings:n,knowledgeBaseId:i}=Go.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.knowledgeBaseRefreshed?.({organizationId:r,agentId:t,knowledgeBaseId:i,settings:n}),new Response(null)}catch(a){return console.error(a),a instanceof Error?new Response(a.message,{status:500}):new Response("Unknown error",{status:500})}}async function KE(e){await J(e);let{organizationId:r,agentId:t,settings:n,conversationId:i,message:a}=En.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.handleMessage?.({organizationId:r,agentId:t,conversationId:i,message:a,settings:n}),new Response(null)}catch(c){return console.error(c),c instanceof Error?new Response(c.message,{status:500}):new Response("Unknown error",{status:500})}}async function ME(e){await J(e);let{organizationId:r,agentId:t,settings:n}=vo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.postInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function BE(e){await J(e);let{organizationId:r,agentId:t,settings:n}=ho.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.preInstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}async function LE(e){await J(e);let{organizationId:r,agentId:t,settings:n}=xo.parseOrThrow(await e.json(),{unrecognizedObjectKeys:"strip",allowUnrecognizedEnumValues:!0,allowUnrecognizedUnionMembers:!0});try{return await W.uninstall?.({organizationId:r,agentId:t,settings:n}),new Response(null)}catch(i){return console.error(i),i instanceof Error?new Response(i.message,{status:400}):new Response("Unknown error",{status:500})}}export{UE as conversationCreatedOrUpdated,DE as eventCreatedOrUpdated,jE as executeAction,NE as feedbackCreatedOrUpdated,KE as handleMessage,CE as inboxItemCreatedOrUpdated,kE as knowledgeBaseRefreshed,ME as postInstall,BE as preInstall,LE as uninstall};\n`},613:t=>{t.exports=e(import.meta.url)("assert")},181:t=>{t.exports=e(import.meta.url)("buffer")},317:t=>{t.exports=e(import.meta.url)("child_process")},434:t=>{t.exports=e(import.meta.url)("events")},896:t=>{t.exports=e(import.meta.url)("fs")},943:t=>{t.exports=e(import.meta.url)("fs/promises")},857:t=>{t.exports=e(import.meta.url)("os")},928:t=>{t.exports=e(import.meta.url)("path")},203:t=>{t.exports=e(import.meta.url)("stream")},23:t=>{t.exports=e(import.meta.url)("util")},309:(e,t,r)=>{r.d(t,{o0:()=>detect});var n=r(896);var o=r(928);var i=r(426);async function pathExists(e){try{await n.promises.access(e);return true}catch{return false}}var s=new Map;function hasGlobalInstallation(e){const t=`has_global_${e}`;if(s.has(t)){return Promise.resolve(s.get(t))}return i(e,["--version"]).then((e=>/^\d+.\d+.\d+$/.test(e.stdout))).then((e=>{s.set(t,e);return e})).catch((()=>false))}function getTypeofLockFile(e="."){const t=`lockfile_${e}`;if(s.has(t)){return Promise.resolve(s.get(t))}return Promise.all([pathExists((0,o.resolve)(e,"yarn.lock")),pathExists((0,o.resolve)(e,"package-lock.json")),pathExists((0,o.resolve)(e,"pnpm-lock.yaml")),pathExists((0,o.resolve)(e,"bun.lockb"))]).then((([e,r,n,o])=>{let i=null;if(e){i="yarn"}else if(n){i="pnpm"}else if(o){i="bun"}else if(r){i="npm"}s.set(t,i);return i}))}var detect=async({cwd:e,includeGlobalBun:t}={})=>{const r=await getTypeofLockFile(e);if(r){return r}const[n,o,i]=await Promise.all([hasGlobalInstallation("yarn"),hasGlobalInstallation("pnpm"),t&&hasGlobalInstallation("bun")]);if(n){return"yarn"}if(o){return"pnpm"}if(i){return"bun"}return"npm"};function getNpmVersion(e){return execa(e||"npm",["--version"]).then((e=>e.stdout))}function clearCache(){return s.clear()}},185:(t,r,n)=>{n.d(r,{A:()=>It});var o=n(613);const i={right:alignRight,center:alignCenter};const s=0;const a=1;const u=2;const c=3;class UI{constructor(e){var t;this.width=e.width;this.wrap=(t=e.wrap)!==null&&t!==void 0?t:true;this.rows=[]}span(...e){const t=this.div(...e);t.span=true}resetOutput(){this.rows=[]}div(...e){if(e.length===0){this.div("")}if(this.wrap&&this.shouldApplyLayoutDSL(...e)&&typeof e[0]==="string"){return this.applyLayoutDSL(e[0])}const t=e.map((e=>{if(typeof e==="string"){return this.colFromString(e)}return e}));this.rows.push(t);return t}shouldApplyLayoutDSL(...e){return e.length===1&&typeof e[0]==="string"&&/[\t\n]/.test(e[0])}applyLayoutDSL(e){const t=e.split("\n").map((e=>e.split("\t")));let r=0;t.forEach((e=>{if(e.length>1&&l.stringWidth(e[0])>r){r=Math.min(Math.floor(this.width*.5),l.stringWidth(e[0]))}}));t.forEach((e=>{this.div(...e.map(((t,n)=>({text:t.trim(),padding:this.measurePadding(t),width:n===0&&e.length>1?r:undefined}))))}));return this.rows[this.rows.length-1]}colFromString(e){return{text:e,padding:this.measurePadding(e)}}measurePadding(e){const t=l.stripAnsi(e);return[0,t.match(/\s*$/)[0].length,0,t.match(/^\s*/)[0].length]}toString(){const e=[];this.rows.forEach((t=>{this.rowToString(t,e)}));return e.filter((e=>!e.hidden)).map((e=>e.text)).join("\n")}rowToString(e,t){this.rasterize(e).forEach(((r,n)=>{let o="";r.forEach(((r,s)=>{const{width:u}=e[s];const f=this.negatePadding(e[s]);let d=r;if(f>l.stringWidth(r)){d+=" ".repeat(f-l.stringWidth(r))}if(e[s].align&&e[s].align!=="left"&&this.wrap){const t=i[e[s].align];d=t(d,f);if(l.stringWidth(d)<f){d+=" ".repeat((u||0)-l.stringWidth(d)-1)}}const p=e[s].padding||[0,0,0,0];if(p[c]){o+=" ".repeat(p[c])}o+=addBorder(e[s],d,"| ");o+=d;o+=addBorder(e[s],d," |");if(p[a]){o+=" ".repeat(p[a])}if(n===0&&t.length>0){o=this.renderInline(o,t[t.length-1])}}));t.push({text:o.replace(/ +$/,""),span:e.span})}));return t}renderInline(e,t){const r=e.match(/^ */);const n=r?r[0].length:0;const o=t.text;const i=l.stringWidth(o.trimRight());if(!t.span){return e}if(!this.wrap){t.hidden=true;return o+e}if(n<i){return e}t.hidden=true;return o.trimRight()+" ".repeat(n-i)+e.trimLeft()}rasterize(e){const t=[];const r=this.columnWidths(e);let n;e.forEach(((e,o)=>{e.width=r[o];if(this.wrap){n=l.wrap(e.text,this.negatePadding(e),{hard:true}).split("\n")}else{n=e.text.split("\n")}if(e.border){n.unshift("."+"-".repeat(this.negatePadding(e)+2)+".");n.push("'"+"-".repeat(this.negatePadding(e)+2)+"'")}if(e.padding){n.unshift(...new Array(e.padding[s]||0).fill(""));n.push(...new Array(e.padding[u]||0).fill(""))}n.forEach(((e,r)=>{if(!t[r]){t.push([])}const n=t[r];for(let e=0;e<o;e++){if(n[e]===undefined){n.push("")}}n.push(e)}))}));return t}negatePadding(e){let t=e.width||0;if(e.padding){t-=(e.padding[c]||0)+(e.padding[a]||0)}if(e.border){t-=4}return t}columnWidths(e){if(!this.wrap){return e.map((e=>e.width||l.stringWidth(e.text)))}let t=e.length;let r=this.width;const n=e.map((e=>{if(e.width){t--;r-=e.width;return e.width}return undefined}));const o=t?Math.floor(r/t):0;return n.map(((t,r)=>{if(t===undefined){return Math.max(o,_minWidth(e[r]))}return t}))}}function addBorder(e,t,r){if(e.border){if(/[.']-+[.']/.test(t)){return""}if(t.trim().length!==0){return r}return" "}return""}function _minWidth(e){const t=e.padding||[];const r=1+(t[c]||0)+(t[a]||0);if(e.border){return r+4}return r}function getWindowWidth(){if(typeof process==="object"&&process.stdout&&process.stdout.columns){return process.stdout.columns}return 80}function alignRight(e,t){e=e.trim();const r=l.stringWidth(e);if(r<t){return" ".repeat(t-r)+e}return e}function alignCenter(e,t){e=e.trim();const r=l.stringWidth(e);if(r>=t){return e}return" ".repeat(t-r>>1)+e}let l;function cliui(e,t){l=t;return new UI({width:(e===null||e===void 0?void 0:e.width)||getWindowWidth(),wrap:e===null||e===void 0?void 0:e.wrap})}function ansiRegex({onlyFirst:e=false}={}){const t="(?:\\u0007|\\u001B\\u005C|\\u009C)";const r=`(?:\\u001B\\][\\s\\S]*?${t})`;const n="[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";const o=`${r}|${n}`;return new RegExp(o,e?undefined:"g")}const f=ansiRegex();function stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(f,"")}function isAmbiguous(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function isFullWidth(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function isWide(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function lookup_getCategory(e){if(isAmbiguous(e))return"ambiguous";if(isFullWidth(e))return"fullwidth";if(e===8361||e>=65377&&e<=65470||e>=65474&&e<=65479||e>=65482&&e<=65487||e>=65490&&e<=65495||e>=65498&&e<=65500||e>=65512&&e<=65518){return"halfwidth"}if(e>=32&&e<=126||e===162||e===163||e===165||e===166||e===172||e===175||e>=10214&&e<=10221||e===10629||e===10630){return"narrow"}if(isWide(e))return"wide";return"neutral"}function validate(e){if(!Number.isSafeInteger(e)){throw new TypeError(`Expected a code point, got \`${typeof e}\`.`)}}function eastAsianWidthType(e){validate(e);return getCategory(e)}function eastAsianWidth(e,{ambiguousAsWide:t=false}={}){validate(e);if(isFullWidth(e)||isWide(e)||t&&isAmbiguous(e)){return 2}return 1}var d=n(946);const p=new Intl.Segmenter;const h=/^\p{Default_Ignorable_Code_Point}$/u;function stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of p.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(h.test(t)){continue}if(d().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}const m=ansiRegex();function strip_ansi_stripAnsi(e){if(typeof e!=="string"){throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``)}return e.replace(m,"")}const g=new Intl.Segmenter;const D=/^\p{Default_Ignorable_Code_Point}$/u;function string_width_stringWidth(e,t={}){if(typeof e!=="string"||e.length===0){return 0}const{ambiguousIsNarrow:r=true,countAnsiEscapeCodes:n=false}=t;if(!n){e=strip_ansi_stripAnsi(e)}if(e.length===0){return 0}let o=0;const i={ambiguousAsWide:!r};for(const{segment:t}of g.segment(e)){const e=t.codePointAt(0);if(e<=31||e>=127&&e<=159){continue}if(e>=8203&&e<=8207||e===65279){continue}if(e>=768&&e<=879||e>=6832&&e<=6911||e>=7616&&e<=7679||e>=8400&&e<=8447||e>=65056&&e<=65071){continue}if(e>=55296&&e<=57343){continue}if(e>=65024&&e<=65039){continue}if(D.test(t)){continue}if(d().test(t)){o+=2;continue}o+=eastAsianWidth(e,i)}return o}const y=10;const wrapAnsi16=(e=0)=>t=>`[${t+e}m`;const wrapAnsi256=(e=0)=>t=>`[${38+e};5;${t}m`;const wrapAnsi16m=(e=0)=>(t,r,n)=>`[${38+e};2;${t};${r};${n}m`;const b={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const E=Object.keys(b.modifier);const v=Object.keys(b.color);const w=Object.keys(b.bgColor);const F=[...v,...w];function assembleStyles(){const e=new Map;for(const[t,r]of Object.entries(b)){for(const[t,n]of Object.entries(r)){b[t]={open:`[${n[0]}m`,close:`[${n[1]}m`};r[t]=b[t];e.set(n[0],n[1])}Object.defineProperty(b,t,{value:r,enumerable:false})}Object.defineProperty(b,"codes",{value:e,enumerable:false});b.color.close="[39m";b.bgColor.close="[49m";b.color.ansi=wrapAnsi16();b.color.ansi256=wrapAnsi256();b.color.ansi16m=wrapAnsi16m();b.bgColor.ansi=wrapAnsi16(y);b.bgColor.ansi256=wrapAnsi256(y);b.bgColor.ansi16m=wrapAnsi16m(y);Object.defineProperties(b,{rgbToAnsi256:{value:(e,t,r)=>{if(e===t&&t===r){if(e<8){return 16}if(e>248){return 231}return Math.round((e-8)/247*24)+232}return 16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:false},hexToRgb:{value:e=>{const t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t){return[0,0,0]}let[r]=t;if(r.length===3){r=[...r].map((e=>e+e)).join("")}const n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:false},hexToAnsi256:{value:e=>b.rgbToAnsi256(...b.hexToRgb(e)),enumerable:false},ansi256ToAnsi:{value:e=>{if(e<8){return 30+e}if(e<16){return 90+(e-8)}let t;let r;let n;if(e>=232){t=((e-232)*10+8)/255;r=t;n=t}else{e-=16;const o=e%36;t=Math.floor(e/36)/5;r=Math.floor(o/6)/5;n=o%6/5}const o=Math.max(t,r,n)*2;if(o===0){return 30}let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));if(o===2){i+=60}return i},enumerable:false},rgbToAnsi:{value:(e,t,r)=>b.ansi256ToAnsi(b.rgbToAnsi256(e,t,r)),enumerable:false},hexToAnsi:{value:e=>b.ansi256ToAnsi(b.hexToAnsi256(e)),enumerable:false}});return b}const C=assembleStyles();const A=C;const O=new Set(["",""]);const S=39;const j="";const k="[";const x="]";const P="m";const _=`${x}8;;`;const wrapAnsiCode=e=>`${O.values().next().value}${k}${e}${P}`;const wrapAnsiHyperlink=e=>`${O.values().next().value}${_}${e}${j}`;const wordLengths=e=>e.split(" ").map((e=>string_width_stringWidth(e)));const wrapWord=(e,t,r)=>{const n=[...t];let o=false;let i=false;let s=string_width_stringWidth(strip_ansi_stripAnsi(e.at(-1)));for(const[t,a]of n.entries()){const u=string_width_stringWidth(a);if(s+u<=r){e[e.length-1]+=a}else{e.push(a);s=0}if(O.has(a)){o=true;const e=n.slice(t+1,t+1+_.length).join("");i=e===_}if(o){if(i){if(a===j){o=false;i=false}}else if(a===P){o=false}continue}s+=u;if(s===r&&t<n.length-1){e.push("");s=0}}if(!s&&e.at(-1).length>0&&e.length>1){e[e.length-2]+=e.pop()}};const stringVisibleTrimSpacesRight=e=>{const t=e.split(" ");let r=t.length;while(r>0){if(string_width_stringWidth(t[r-1])>0){break}r--}if(r===t.length){return e}return t.slice(0,r).join(" ")+t.slice(r).join("")};const exec=(e,t,r={})=>{if(r.trim!==false&&e.trim()===""){return""}let n="";let o;let i;const s=wordLengths(e);let a=[""];for(const[n,o]of e.split(" ").entries()){if(r.trim!==false){a[a.length-1]=a.at(-1).trimStart()}let e=string_width_stringWidth(a.at(-1));if(n!==0){if(e>=t&&(r.wordWrap===false||r.trim===false)){a.push("");e=0}if(e>0||r.trim===false){a[a.length-1]+=" ";e++}}if(r.hard&&s[n]>t){const r=t-e;const i=1+Math.floor((s[n]-r-1)/t);const u=Math.floor((s[n]-1)/t);if(u<i){a.push("")}wrapWord(a,o,t);continue}if(e+s[n]>t&&e>0&&s[n]>0){if(r.wordWrap===false&&e<t){wrapWord(a,o,t);continue}a.push("")}if(e+s[n]>t&&r.wordWrap===false){wrapWord(a,o,t);continue}a[a.length-1]+=o}if(r.trim!==false){a=a.map((e=>stringVisibleTrimSpacesRight(e)))}const u=a.join("\n");const c=[...u];let l=0;for(const[e,t]of c.entries()){n+=t;if(O.has(t)){const{groups:e}=new RegExp(`(?:\\${k}(?<code>\\d+)m|\\${_}(?<uri>.*)${j})`).exec(u.slice(l))||{groups:{}};if(e.code!==undefined){const t=Number.parseFloat(e.code);o=t===S?undefined:t}else if(e.uri!==undefined){i=e.uri.length===0?undefined:e.uri}}const r=A.codes.get(Number(o));if(c[e+1]==="\n"){if(i){n+=wrapAnsiHyperlink("")}if(o&&r){n+=wrapAnsiCode(r)}}else if(t==="\n"){if(o&&r){n+=wrapAnsiCode(o)}if(i){n+=wrapAnsiHyperlink(i)}}l+=t.length}return n};function wrapAnsi(e,t,r){return String(e).normalize().replaceAll("\r\n","\n").split("\n").map((e=>exec(e,t,r))).join("\n")}function ui(e){return cliui(e,{stringWidth:stringWidth,stripAnsi:stripAnsi,wrap:wrapAnsi})}var I=n(928);var B=n(896);function sync(e,t){let r=(0,I.resolve)(".",e);let n,o=(0,B.statSync)(r);if(!o.isDirectory()){r=(0,I.dirname)(r)}while(true){n=t(r,(0,B.readdirSync)(r));if(n)return(0,I.resolve)(r,n);r=(0,I.dirname)(n=r);if(n===r)break}}var T=n(23);const N=e(import.meta.url)("url");
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
5
5
|
* Copyright (c) 2016, Contributors
|
|
6
6
|
* SPDX-License-Identifier: ISC
|
|
7
7
|
*/
|
|
8
|
-
function camelCase(e){const t=e!==e.toLowerCase()&&e!==e.toUpperCase();if(!t){e=e.toLowerCase()}if(e.indexOf("-")===-1&&e.indexOf("_")===-1){return e}else{let t="";let r=false;const n=e.match(/^-+/);for(let o=n?n[0].length:0;o<e.length;o++){let n=e.charAt(o);if(r){r=false;n=n.toUpperCase()}if(o!==0&&(n==="-"||n==="_")){r=true}else if(n!=="-"&&n!=="_"){t+=n}}return t}}function decamelize(e,t){const r=e.toLowerCase();t=t||"-";let n="";for(let o=0;o<e.length;o++){const i=r.charAt(o);const
|
|
8
|
+
function camelCase(e){const t=e!==e.toLowerCase()&&e!==e.toUpperCase();if(!t){e=e.toLowerCase()}if(e.indexOf("-")===-1&&e.indexOf("_")===-1){return e}else{let t="";let r=false;const n=e.match(/^-+/);for(let o=n?n[0].length:0;o<e.length;o++){let n=e.charAt(o);if(r){r=false;n=n.toUpperCase()}if(o!==0&&(n==="-"||n==="_")){r=true}else if(n!=="-"&&n!=="_"){t+=n}}return t}}function decamelize(e,t){const r=e.toLowerCase();t=t||"-";let n="";for(let o=0;o<e.length;o++){const i=r.charAt(o);const s=e.charAt(o);if(i!==s&&o>0){n+=`${t}${r.charAt(o)}`}else{n+=s}}return n}function looksLikeNumber(e){if(e===null||e===undefined)return false;if(typeof e==="number")return true;if(/^0x[0-9a-f]+$/i.test(e))return true;if(/^0[^.]/.test(e))return false;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}
|
|
9
9
|
/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright (c) 2016, Contributors
|
|
12
12
|
* SPDX-License-Identifier: ISC
|
|
13
13
|
*/
|
|
14
|
-
function tokenizeArgString(e){if(Array.isArray(e)){return e.map((e=>typeof e!=="string"?e+"":e))}e=e.trim();let t=0;let r=null;let n=null;let o=null;const i=[];for(let
|
|
14
|
+
function tokenizeArgString(e){if(Array.isArray(e)){return e.map((e=>typeof e!=="string"?e+"":e))}e=e.trim();let t=0;let r=null;let n=null;let o=null;const i=[];for(let s=0;s<e.length;s++){r=n;n=e.charAt(s);if(n===" "&&!o){if(!(r===" ")){t++}continue}if(n===o){o=null}else if((n==="'"||n==='"')&&!o){o=n}if(!i[t])i[t]="";i[t]+=n}return i}
|
|
15
15
|
/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright (c) 2016, Contributors
|
|
18
18
|
* SPDX-License-Identifier: ISC
|
|
19
19
|
*/
|
|
20
|
-
var
|
|
20
|
+
var M;(function(e){e["BOOLEAN"]="boolean";e["STRING"]="string";e["NUMBER"]="number";e["ARRAY"]="array"})(M||(M={}));
|
|
21
21
|
/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright (c) 2016, Contributors
|
|
24
24
|
* SPDX-License-Identifier: ISC
|
|
25
25
|
*/
|
|
26
|
-
let U;class YargsParser{constructor(e){U=e}parse(e,t){const r=Object.assign({alias:undefined,array:undefined,boolean:undefined,config:undefined,configObjects:undefined,configuration:undefined,coerce:undefined,count:undefined,default:undefined,envPrefix:undefined,narg:undefined,normalize:undefined,string:undefined,number:undefined,__:undefined,key:undefined},t);const n=tokenizeArgString(e);const o=typeof e==="string";const i=combineAliases(Object.assign(Object.create(null),r.alias));const u=Object.assign({"boolean-negation":true,"camel-case-expansion":true,"combine-arrays":false,"dot-notation":true,"duplicate-arguments-array":true,"flatten-duplicate-arrays":true,"greedy-arrays":true,"halt-at-non-option":false,"nargs-eats-options":false,"negation-prefix":"no-","parse-numbers":true,"parse-positional-numbers":true,"populate--":false,"set-placeholder-key":false,"short-option-groups":true,"strip-aliased":false,"strip-dashed":false,"unknown-options-as-args":false},r.configuration);const s=Object.assign(Object.create(null),r.default);const a=r.configObjects||[];const c=r.envPrefix;const l=u["populate--"];const D=l?"--":"_";const f=Object.create(null);const d=Object.create(null);const p=r.__||U.format;const h={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]};const g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;const m=new RegExp("^--"+u["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach((function(e){const t=typeof e==="object"?e.key:e;const r=Object.keys(e).map((function(e){const t={boolean:"bools",string:"strings",number:"numbers"};return t[e]})).filter(Boolean).pop();if(r){h[r][t]=true}h.arrays[t]=true;h.keys.push(t)}));[].concat(r.boolean||[]).filter(Boolean).forEach((function(e){h.bools[e]=true;h.keys.push(e)}));[].concat(r.string||[]).filter(Boolean).forEach((function(e){h.strings[e]=true;h.keys.push(e)}));[].concat(r.number||[]).filter(Boolean).forEach((function(e){h.numbers[e]=true;h.keys.push(e)}));[].concat(r.count||[]).filter(Boolean).forEach((function(e){h.counts[e]=true;h.keys.push(e)}));[].concat(r.normalize||[]).filter(Boolean).forEach((function(e){h.normalize[e]=true;h.keys.push(e)}));if(typeof r.narg==="object"){Object.entries(r.narg).forEach((([e,t])=>{if(typeof t==="number"){h.nargs[e]=t;h.keys.push(e)}}))}if(typeof r.coerce==="object"){Object.entries(r.coerce).forEach((([e,t])=>{if(typeof t==="function"){h.coercions[e]=t;h.keys.push(e)}}))}if(typeof r.config!=="undefined"){if(Array.isArray(r.config)||typeof r.config==="string"){[].concat(r.config).filter(Boolean).forEach((function(e){h.configs[e]=true}))}else if(typeof r.config==="object"){Object.entries(r.config).forEach((([e,t])=>{if(typeof t==="boolean"||typeof t==="function"){h.configs[e]=t}}))}}extendAliases(r.key,i,r.default,h.arrays);Object.keys(s).forEach((function(e){(h.aliases[e]||[]).forEach((function(t){s[t]=s[e]}))}));let y=null;checkConfiguration();let F=[];const b=Object.assign(Object.create(null),{_:[]});const E={};for(let e=0;e<n.length;e++){const t=n[e];const r=t.replace(/^-{3,}/,"---");let o;let i;let s;let a;let c;let l;if(t!=="--"&&/^-/.test(t)&&isUnknownOptionAsArg(t)){pushPositional(t)}else if(r.match(/^---+(=|$)/)){pushPositional(t);continue}else if(t.match(/^--.+=/)||!u["short-option-groups"]&&t.match(/^-.+=/)){a=t.match(/^--?([^=]+)=([\s\S]*)$/);if(a!==null&&Array.isArray(a)&&a.length>=3){if(checkAllAliases(a[1],h.arrays)){e=eatArray(e,a[1],n,a[2])}else if(checkAllAliases(a[1],h.nargs)!==false){e=eatNargs(e,a[1],n,a[2])}else{setArg(a[1],a[2],true)}}}else if(t.match(m)&&u["boolean-negation"]){a=t.match(m);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];setArg(i,checkAllAliases(i,h.arrays)?[false]:false)}}else if(t.match(/^--.+/)||!u["short-option-groups"]&&t.match(/^-[^-]+/)){a=t.match(/^--?(.+)/);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!c.match(/^-/)||c.match(g))&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-.\..+=/)){a=t.match(/^-([^=]+)=([\s\S]*)$/);if(a!==null&&Array.isArray(a)&&a.length>=3){setArg(a[1],a[2])}}else if(t.match(/^-.\..+/)&&!t.match(g)){c=n[e+1];a=t.match(/^-(.\..+)/);if(a!==null&&Array.isArray(a)&&a.length>=2){i=a[1];if(c!==undefined&&!c.match(/^-/)&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}else if(t.match(/^-[^-]+/)&&!t.match(g)){s=t.slice(1,-1).split("");o=false;for(let r=0;r<s.length;r++){c=t.slice(r+2);if(s[r+1]&&s[r+1]==="="){l=t.slice(r+3);i=s[r];if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n,l)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n,l)}else{setArg(i,l)}o=true;break}if(c==="-"){setArg(s[r],c);continue}if(/[A-Za-z]/.test(s[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(c)&&checkAllAliases(c,h.bools)===false){setArg(s[r],c);o=true;break}if(s[r+1]&&s[r+1].match(/\W/)){setArg(s[r],c);o=true;break}else{setArg(s[r],defaultValue(s[r]))}}i=t.slice(-1)[0];if(!o&&i!=="-"){if(checkAllAliases(i,h.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,h.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!/^(-|--)[^-]/.test(c)||c.match(g))&&!checkAllAliases(i,h.bools)&&!checkAllAliases(i,h.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-[0-9]$/)&&t.match(g)&&checkAllAliases(t.slice(1),h.bools)){i=t.slice(1);setArg(i,defaultValue(i))}else if(t==="--"){F=n.slice(e+1);break}else if(u["halt-at-non-option"]){F=n.slice(e);break}else{pushPositional(t)}}applyEnvVars(b,true);applyEnvVars(b,false);setConfig(b);setConfigObjects();applyDefaultsAndAliases(b,h.aliases,s,true);applyCoercions(b);if(u["set-placeholder-key"])setPlaceholderKeys(b);Object.keys(h.counts).forEach((function(e){if(!hasKey(b,e.split(".")))setArg(e,0)}));if(l&&F.length)b[D]=[];F.forEach((function(e){b[D].push(e)}));if(u["camel-case-expansion"]&&u["strip-dashed"]){Object.keys(b).filter((e=>e!=="--"&&e.includes("-"))).forEach((e=>{delete b[e]}))}if(u["strip-aliased"]){[].concat(...Object.keys(i).map((e=>i[e]))).forEach((e=>{if(u["camel-case-expansion"]&&e.includes("-")){delete b[e.split(".").map((e=>camelCase(e))).join(".")]}delete b[e]}))}function pushPositional(e){const t=maybeCoerceNumber("_",e);if(typeof t==="string"||typeof t==="number"){b._.push(t)}}function eatNargs(e,t,r,n){let o;let i=checkAllAliases(t,h.nargs);i=typeof i!=="number"||isNaN(i)?1:i;if(i===0){if(!isUndefined(n)){y=Error(p("Argument unexpected for: %s",t))}setArg(t,defaultValue(t));return e}let s=isUndefined(n)?0:1;if(u["nargs-eats-options"]){if(r.length-(e+1)+s<i){y=Error(p("Not enough arguments following: %s",t))}s=i}else{for(o=e+1;o<r.length;o++){if(!r[o].match(/^-[^0-9]/)||r[o].match(g)||isUnknownOptionAsArg(r[o]))s++;else break}if(s<i)y=Error(p("Not enough arguments following: %s",t))}let a=Math.min(s,i);if(!isUndefined(n)&&a>0){setArg(t,n);a--}for(o=e+1;o<a+e+1;o++){setArg(t,r[o])}return e+a}function eatArray(e,t,r,n){let i=[];let a=n||r[e+1];const c=checkAllAliases(t,h.nargs);if(checkAllAliases(t,h.bools)&&!/^(true|false)$/.test(a)){i.push(true)}else if(isUndefined(a)||isUndefined(n)&&/^-/.test(a)&&!g.test(a)&&!isUnknownOptionAsArg(a)){if(s[t]!==undefined){const e=s[t];i=Array.isArray(e)?e:[e]}}else{if(!isUndefined(n)){i.push(processValue(t,n,true))}for(let n=e+1;n<r.length;n++){if(!u["greedy-arrays"]&&i.length>0||c&&typeof c==="number"&&i.length>=c)break;a=r[n];if(/^-/.test(a)&&!g.test(a)&&!isUnknownOptionAsArg(a))break;e=n;i.push(processValue(t,a,o))}}if(typeof c==="number"&&(c&&i.length<c||isNaN(c)&&i.length===0)){y=Error(p("Not enough arguments following: %s",t))}setArg(t,i);return e}function setArg(e,t,r=o){if(/-/.test(e)&&u["camel-case-expansion"]){const t=e.split(".").map((function(e){return camelCase(e)})).join(".");addNewAlias(e,t)}const n=processValue(e,t,r);const i=e.split(".");setKey(b,i,n);if(h.aliases[e]){h.aliases[e].forEach((function(e){const t=e.split(".");setKey(b,t,n)}))}if(i.length>1&&u["dot-notation"]){(h.aliases[i[0]]||[]).forEach((function(t){let r=t.split(".");const o=[].concat(i);o.shift();r=r.concat(o);if(!(h.aliases[e]||[]).includes(r.join("."))){setKey(b,r,n)}}))}if(checkAllAliases(e,h.normalize)&&!checkAllAliases(e,h.arrays)){const r=[e].concat(h.aliases[e]||[]);r.forEach((function(e){Object.defineProperty(E,e,{enumerable:true,get(){return t},set(e){t=typeof e==="string"?U.normalize(e):e}})}))}}function addNewAlias(e,t){if(!(h.aliases[e]&&h.aliases[e].length)){h.aliases[e]=[t];f[t]=true}if(!(h.aliases[t]&&h.aliases[t].length)){addNewAlias(t,e)}}function processValue(e,t,r){if(r){t=stripQuotes(t)}if(checkAllAliases(e,h.bools)||checkAllAliases(e,h.counts)){if(typeof t==="string")t=t==="true"}let n=Array.isArray(t)?t.map((function(t){return maybeCoerceNumber(e,t)})):maybeCoerceNumber(e,t);if(checkAllAliases(e,h.counts)&&(isUndefined(n)||typeof n==="boolean")){n=increment()}if(checkAllAliases(e,h.normalize)&&checkAllAliases(e,h.arrays)){if(Array.isArray(t))n=t.map((e=>U.normalize(e)));else n=U.normalize(t)}return n}function maybeCoerceNumber(e,t){if(!u["parse-positional-numbers"]&&e==="_")return t;if(!checkAllAliases(e,h.strings)&&!checkAllAliases(e,h.bools)&&!Array.isArray(t)){const r=looksLikeNumber(t)&&u["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)));if(r||!isUndefined(t)&&checkAllAliases(e,h.numbers)){t=Number(t)}}return t}function setConfig(e){const t=Object.create(null);applyDefaultsAndAliases(t,h.aliases,s);Object.keys(h.configs).forEach((function(r){const n=e[r]||t[r];if(n){try{let e=null;const t=U.resolve(U.cwd(),n);const o=h.configs[r];if(typeof o==="function"){try{e=o(t)}catch(t){e=t}if(e instanceof Error){y=e;return}}else{e=U.require(t)}setConfigObject(e)}catch(t){if(t.name==="PermissionDenied")y=t;else if(e[r])y=Error(p("Invalid JSON config file: %s",n))}}}))}function setConfigObject(e,t){Object.keys(e).forEach((function(r){const n=e[r];const o=t?t+"."+r:r;if(typeof n==="object"&&n!==null&&!Array.isArray(n)&&u["dot-notation"]){setConfigObject(n,o)}else{if(!hasKey(b,o.split("."))||checkAllAliases(o,h.arrays)&&u["combine-arrays"]){setArg(o,n)}}}))}function setConfigObjects(){if(typeof a!=="undefined"){a.forEach((function(e){setConfigObject(e)}))}}function applyEnvVars(e,t){if(typeof c==="undefined")return;const r=typeof c==="string"?c:"";const n=U.env();Object.keys(n).forEach((function(o){if(r===""||o.lastIndexOf(r,0)===0){const i=o.split("__").map((function(e,t){if(t===0){e=e.substring(r.length)}return camelCase(e)}));if((t&&h.configs[i.join(".")]||!t)&&!hasKey(e,i)){setArg(i.join("."),n[o])}}}))}function applyCoercions(e){let t;const r=new Set;Object.keys(e).forEach((function(n){if(!r.has(n)){t=checkAllAliases(n,h.coercions);if(typeof t==="function"){try{const o=maybeCoerceNumber(n,t(e[n]));[].concat(h.aliases[n]||[],n).forEach((t=>{r.add(t);e[t]=o}))}catch(e){y=e}}}}))}function setPlaceholderKeys(e){h.keys.forEach((t=>{if(~t.indexOf("."))return;if(typeof e[t]==="undefined")e[t]=undefined}));return e}function applyDefaultsAndAliases(e,t,r,n=false){Object.keys(r).forEach((function(o){if(!hasKey(e,o.split("."))){setKey(e,o.split("."),r[o]);if(n)d[o]=true;(t[o]||[]).forEach((function(t){if(hasKey(e,t.split(".")))return;setKey(e,t.split("."),r[o])}))}}))}function hasKey(e,t){let r=e;if(!u["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){r=r[e]||{}}));const n=t[t.length-1];if(typeof r!=="object")return false;else return n in r}function setKey(e,t,r){let n=e;if(!u["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){e=sanitizeKey(e);if(typeof n==="object"&&n[e]===undefined){n[e]={}}if(typeof n[e]!=="object"||Array.isArray(n[e])){if(Array.isArray(n[e])){n[e].push({})}else{n[e]=[n[e],{}]}n=n[e][n[e].length-1]}else{n=n[e]}}));const o=sanitizeKey(t[t.length-1]);const i=checkAllAliases(t.join("."),h.arrays);const s=Array.isArray(r);let a=u["duplicate-arguments-array"];if(!a&&checkAllAliases(o,h.nargs)){a=true;if(!isUndefined(n[o])&&h.nargs[o]===1||Array.isArray(n[o])&&n[o].length===h.nargs[o]){n[o]=undefined}}if(r===increment()){n[o]=increment(n[o])}else if(Array.isArray(n[o])){if(a&&i&&s){n[o]=u["flatten-duplicate-arrays"]?n[o].concat(r):(Array.isArray(n[o][0])?n[o]:[n[o]]).concat([r])}else if(!a&&Boolean(i)===Boolean(s)){n[o]=r}else{n[o]=n[o].concat([r])}}else if(n[o]===undefined&&i){n[o]=s?r:[r]}else if(a&&!(n[o]===undefined||checkAllAliases(o,h.counts)||checkAllAliases(o,h.bools))){n[o]=[n[o],r]}else{n[o]=r}}function extendAliases(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){if(h.aliases[e])return;h.aliases[e]=[].concat(i[e]||[]);h.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&u["camel-case-expansion"]){const r=camelCase(t);if(r!==e&&h.aliases[e].indexOf(r)===-1){h.aliases[e].push(r);f[r]=true}}}));h.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&u["camel-case-expansion"]){const r=decamelize(t,"-");if(r!==e&&h.aliases[e].indexOf(r)===-1){h.aliases[e].push(r);f[r]=true}}}));h.aliases[e].forEach((function(t){h.aliases[t]=[e].concat(h.aliases[e].filter((function(e){return t!==e})))}))}))}))}function checkAllAliases(e,t){const r=[].concat(h.aliases[e]||[],e);const n=Object.keys(t);const o=r.find((e=>n.includes(e)));return o?t[o]:false}function hasAnyFlag(e){const t=Object.keys(h);const r=[].concat(t.map((e=>h[e])));return r.some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function hasFlagsMatching(e,...t){const r=[].concat(...t);return r.some((function(t){const r=e.match(t);return r&&hasAnyFlag(r[1])}))}function hasAllShortFlags(e){if(e.match(g)||!e.match(/^-[^-]+/)){return false}let t=true;let r;const n=e.slice(1).split("");for(let o=0;o<n.length;o++){r=e.slice(o+2);if(!hasAnyFlag(n[o])){t=false;break}if(n[o+1]&&n[o+1]==="="||r==="-"||/[A-Za-z]/.test(n[o])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(r)||n[o+1]&&n[o+1].match(/\W/)){break}}return t}function isUnknownOptionAsArg(e){return u["unknown-options-as-args"]&&isUnknownOption(e)}function isUnknownOption(e){e=e.replace(/^-{3,}/,"--");if(e.match(g)){return false}if(hasAllShortFlags(e)){return false}const t=/^-+([^=]+?)=[\s\S]*$/;const r=/^-+([^=]+?)$/;const n=/^-+([^=]+?)-$/;const o=/^-+([^=]+?\d+)$/;const i=/^-+([^=]+?)\W+.*$/;return!hasFlagsMatching(e,t,m,r,n,o,i)}function defaultValue(e){if(!checkAllAliases(e,h.bools)&&!checkAllAliases(e,h.counts)&&`${e}`in s){return s[e]}else{return defaultForType(guessType(e))}}function defaultForType(e){const t={[R.BOOLEAN]:true,[R.STRING]:"",[R.NUMBER]:undefined,[R.ARRAY]:[]};return t[e]}function guessType(e){let t=R.BOOLEAN;if(checkAllAliases(e,h.strings))t=R.STRING;else if(checkAllAliases(e,h.numbers))t=R.NUMBER;else if(checkAllAliases(e,h.bools))t=R.BOOLEAN;else if(checkAllAliases(e,h.arrays))t=R.ARRAY;return t}function isUndefined(e){return e===undefined}function checkConfiguration(){Object.keys(h.counts).find((e=>{if(checkAllAliases(e,h.arrays)){y=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",e));return true}else if(checkAllAliases(e,h.nargs)){y=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",e));return true}return false}))}return{aliases:Object.assign({},h.aliases),argv:Object.assign(E,b),configuration:u,defaulted:Object.assign({},d),error:y,newAliases:Object.assign({},f)}}}function combineAliases(e){const t=[];const r=Object.create(null);let n=true;Object.keys(e).forEach((function(r){t.push([].concat(e[r],r))}));while(n){n=false;for(let e=0;e<t.length;e++){for(let r=e+1;r<t.length;r++){const o=t[e].filter((function(e){return t[r].indexOf(e)!==-1}));if(o.length){t[e]=t[e].concat(t[r]);t.splice(r,1);n=true;break}}}}t.forEach((function(e){e=e.filter((function(e,t,r){return r.indexOf(e)===t}));const t=e.pop();if(t!==undefined&&typeof t==="string"){r[t]=e}}));return r}function increment(e){return e!==undefined?e+1:1}function sanitizeKey(e){if(e==="__proto__")return"___proto___";return e}function stripQuotes(e){return typeof e==="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}const $=e(import.meta.url)("node:module");
|
|
26
|
+
let R;class YargsParser{constructor(e){R=e}parse(e,t){const r=Object.assign({alias:undefined,array:undefined,boolean:undefined,config:undefined,configObjects:undefined,configuration:undefined,coerce:undefined,count:undefined,default:undefined,envPrefix:undefined,narg:undefined,normalize:undefined,string:undefined,number:undefined,__:undefined,key:undefined},t);const n=tokenizeArgString(e);const o=typeof e==="string";const i=combineAliases(Object.assign(Object.create(null),r.alias));const s=Object.assign({"boolean-negation":true,"camel-case-expansion":true,"combine-arrays":false,"dot-notation":true,"duplicate-arguments-array":true,"flatten-duplicate-arrays":true,"greedy-arrays":true,"halt-at-non-option":false,"nargs-eats-options":false,"negation-prefix":"no-","parse-numbers":true,"parse-positional-numbers":true,"populate--":false,"set-placeholder-key":false,"short-option-groups":true,"strip-aliased":false,"strip-dashed":false,"unknown-options-as-args":false},r.configuration);const a=Object.assign(Object.create(null),r.default);const u=r.configObjects||[];const c=r.envPrefix;const l=s["populate--"];const f=l?"--":"_";const d=Object.create(null);const p=Object.create(null);const h=r.__||R.format;const m={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]};const g=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/;const D=new RegExp("^--"+s["negation-prefix"]+"(.+)");[].concat(r.array||[]).filter(Boolean).forEach((function(e){const t=typeof e==="object"?e.key:e;const r=Object.keys(e).map((function(e){const t={boolean:"bools",string:"strings",number:"numbers"};return t[e]})).filter(Boolean).pop();if(r){m[r][t]=true}m.arrays[t]=true;m.keys.push(t)}));[].concat(r.boolean||[]).filter(Boolean).forEach((function(e){m.bools[e]=true;m.keys.push(e)}));[].concat(r.string||[]).filter(Boolean).forEach((function(e){m.strings[e]=true;m.keys.push(e)}));[].concat(r.number||[]).filter(Boolean).forEach((function(e){m.numbers[e]=true;m.keys.push(e)}));[].concat(r.count||[]).filter(Boolean).forEach((function(e){m.counts[e]=true;m.keys.push(e)}));[].concat(r.normalize||[]).filter(Boolean).forEach((function(e){m.normalize[e]=true;m.keys.push(e)}));if(typeof r.narg==="object"){Object.entries(r.narg).forEach((([e,t])=>{if(typeof t==="number"){m.nargs[e]=t;m.keys.push(e)}}))}if(typeof r.coerce==="object"){Object.entries(r.coerce).forEach((([e,t])=>{if(typeof t==="function"){m.coercions[e]=t;m.keys.push(e)}}))}if(typeof r.config!=="undefined"){if(Array.isArray(r.config)||typeof r.config==="string"){[].concat(r.config).filter(Boolean).forEach((function(e){m.configs[e]=true}))}else if(typeof r.config==="object"){Object.entries(r.config).forEach((([e,t])=>{if(typeof t==="boolean"||typeof t==="function"){m.configs[e]=t}}))}}extendAliases(r.key,i,r.default,m.arrays);Object.keys(a).forEach((function(e){(m.aliases[e]||[]).forEach((function(t){a[t]=a[e]}))}));let y=null;checkConfiguration();let b=[];const E=Object.assign(Object.create(null),{_:[]});const v={};for(let e=0;e<n.length;e++){const t=n[e];const r=t.replace(/^-{3,}/,"---");let o;let i;let a;let u;let c;let l;if(t!=="--"&&/^-/.test(t)&&isUnknownOptionAsArg(t)){pushPositional(t)}else if(r.match(/^---+(=|$)/)){pushPositional(t);continue}else if(t.match(/^--.+=/)||!s["short-option-groups"]&&t.match(/^-.+=/)){u=t.match(/^--?([^=]+)=([\s\S]*)$/);if(u!==null&&Array.isArray(u)&&u.length>=3){if(checkAllAliases(u[1],m.arrays)){e=eatArray(e,u[1],n,u[2])}else if(checkAllAliases(u[1],m.nargs)!==false){e=eatNargs(e,u[1],n,u[2])}else{setArg(u[1],u[2],true)}}}else if(t.match(D)&&s["boolean-negation"]){u=t.match(D);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];setArg(i,checkAllAliases(i,m.arrays)?[false]:false)}}else if(t.match(/^--.+/)||!s["short-option-groups"]&&t.match(/^-[^-]+/)){u=t.match(/^--?(.+)/);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!c.match(/^-/)||c.match(g))&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-.\..+=/)){u=t.match(/^-([^=]+)=([\s\S]*)$/);if(u!==null&&Array.isArray(u)&&u.length>=3){setArg(u[1],u[2])}}else if(t.match(/^-.\..+/)&&!t.match(g)){c=n[e+1];u=t.match(/^-(.\..+)/);if(u!==null&&Array.isArray(u)&&u.length>=2){i=u[1];if(c!==undefined&&!c.match(/^-/)&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}else if(t.match(/^-[^-]+/)&&!t.match(g)){a=t.slice(1,-1).split("");o=false;for(let r=0;r<a.length;r++){c=t.slice(r+2);if(a[r+1]&&a[r+1]==="="){l=t.slice(r+3);i=a[r];if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n,l)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n,l)}else{setArg(i,l)}o=true;break}if(c==="-"){setArg(a[r],c);continue}if(/[A-Za-z]/.test(a[r])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(c)&&checkAllAliases(c,m.bools)===false){setArg(a[r],c);o=true;break}if(a[r+1]&&a[r+1].match(/\W/)){setArg(a[r],c);o=true;break}else{setArg(a[r],defaultValue(a[r]))}}i=t.slice(-1)[0];if(!o&&i!=="-"){if(checkAllAliases(i,m.arrays)){e=eatArray(e,i,n)}else if(checkAllAliases(i,m.nargs)!==false){e=eatNargs(e,i,n)}else{c=n[e+1];if(c!==undefined&&(!/^(-|--)[^-]/.test(c)||c.match(g))&&!checkAllAliases(i,m.bools)&&!checkAllAliases(i,m.counts)){setArg(i,c);e++}else if(/^(true|false)$/.test(c)){setArg(i,c);e++}else{setArg(i,defaultValue(i))}}}}else if(t.match(/^-[0-9]$/)&&t.match(g)&&checkAllAliases(t.slice(1),m.bools)){i=t.slice(1);setArg(i,defaultValue(i))}else if(t==="--"){b=n.slice(e+1);break}else if(s["halt-at-non-option"]){b=n.slice(e);break}else{pushPositional(t)}}applyEnvVars(E,true);applyEnvVars(E,false);setConfig(E);setConfigObjects();applyDefaultsAndAliases(E,m.aliases,a,true);applyCoercions(E);if(s["set-placeholder-key"])setPlaceholderKeys(E);Object.keys(m.counts).forEach((function(e){if(!hasKey(E,e.split(".")))setArg(e,0)}));if(l&&b.length)E[f]=[];b.forEach((function(e){E[f].push(e)}));if(s["camel-case-expansion"]&&s["strip-dashed"]){Object.keys(E).filter((e=>e!=="--"&&e.includes("-"))).forEach((e=>{delete E[e]}))}if(s["strip-aliased"]){[].concat(...Object.keys(i).map((e=>i[e]))).forEach((e=>{if(s["camel-case-expansion"]&&e.includes("-")){delete E[e.split(".").map((e=>camelCase(e))).join(".")]}delete E[e]}))}function pushPositional(e){const t=maybeCoerceNumber("_",e);if(typeof t==="string"||typeof t==="number"){E._.push(t)}}function eatNargs(e,t,r,n){let o;let i=checkAllAliases(t,m.nargs);i=typeof i!=="number"||isNaN(i)?1:i;if(i===0){if(!isUndefined(n)){y=Error(h("Argument unexpected for: %s",t))}setArg(t,defaultValue(t));return e}let a=isUndefined(n)?0:1;if(s["nargs-eats-options"]){if(r.length-(e+1)+a<i){y=Error(h("Not enough arguments following: %s",t))}a=i}else{for(o=e+1;o<r.length;o++){if(!r[o].match(/^-[^0-9]/)||r[o].match(g)||isUnknownOptionAsArg(r[o]))a++;else break}if(a<i)y=Error(h("Not enough arguments following: %s",t))}let u=Math.min(a,i);if(!isUndefined(n)&&u>0){setArg(t,n);u--}for(o=e+1;o<u+e+1;o++){setArg(t,r[o])}return e+u}function eatArray(e,t,r,n){let i=[];let u=n||r[e+1];const c=checkAllAliases(t,m.nargs);if(checkAllAliases(t,m.bools)&&!/^(true|false)$/.test(u)){i.push(true)}else if(isUndefined(u)||isUndefined(n)&&/^-/.test(u)&&!g.test(u)&&!isUnknownOptionAsArg(u)){if(a[t]!==undefined){const e=a[t];i=Array.isArray(e)?e:[e]}}else{if(!isUndefined(n)){i.push(processValue(t,n,true))}for(let n=e+1;n<r.length;n++){if(!s["greedy-arrays"]&&i.length>0||c&&typeof c==="number"&&i.length>=c)break;u=r[n];if(/^-/.test(u)&&!g.test(u)&&!isUnknownOptionAsArg(u))break;e=n;i.push(processValue(t,u,o))}}if(typeof c==="number"&&(c&&i.length<c||isNaN(c)&&i.length===0)){y=Error(h("Not enough arguments following: %s",t))}setArg(t,i);return e}function setArg(e,t,r=o){if(/-/.test(e)&&s["camel-case-expansion"]){const t=e.split(".").map((function(e){return camelCase(e)})).join(".");addNewAlias(e,t)}const n=processValue(e,t,r);const i=e.split(".");setKey(E,i,n);if(m.aliases[e]){m.aliases[e].forEach((function(e){const t=e.split(".");setKey(E,t,n)}))}if(i.length>1&&s["dot-notation"]){(m.aliases[i[0]]||[]).forEach((function(t){let r=t.split(".");const o=[].concat(i);o.shift();r=r.concat(o);if(!(m.aliases[e]||[]).includes(r.join("."))){setKey(E,r,n)}}))}if(checkAllAliases(e,m.normalize)&&!checkAllAliases(e,m.arrays)){const r=[e].concat(m.aliases[e]||[]);r.forEach((function(e){Object.defineProperty(v,e,{enumerable:true,get(){return t},set(e){t=typeof e==="string"?R.normalize(e):e}})}))}}function addNewAlias(e,t){if(!(m.aliases[e]&&m.aliases[e].length)){m.aliases[e]=[t];d[t]=true}if(!(m.aliases[t]&&m.aliases[t].length)){addNewAlias(t,e)}}function processValue(e,t,r){if(r){t=stripQuotes(t)}if(checkAllAliases(e,m.bools)||checkAllAliases(e,m.counts)){if(typeof t==="string")t=t==="true"}let n=Array.isArray(t)?t.map((function(t){return maybeCoerceNumber(e,t)})):maybeCoerceNumber(e,t);if(checkAllAliases(e,m.counts)&&(isUndefined(n)||typeof n==="boolean")){n=increment()}if(checkAllAliases(e,m.normalize)&&checkAllAliases(e,m.arrays)){if(Array.isArray(t))n=t.map((e=>R.normalize(e)));else n=R.normalize(t)}return n}function maybeCoerceNumber(e,t){if(!s["parse-positional-numbers"]&&e==="_")return t;if(!checkAllAliases(e,m.strings)&&!checkAllAliases(e,m.bools)&&!Array.isArray(t)){const r=looksLikeNumber(t)&&s["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)));if(r||!isUndefined(t)&&checkAllAliases(e,m.numbers)){t=Number(t)}}return t}function setConfig(e){const t=Object.create(null);applyDefaultsAndAliases(t,m.aliases,a);Object.keys(m.configs).forEach((function(r){const n=e[r]||t[r];if(n){try{let e=null;const t=R.resolve(R.cwd(),n);const o=m.configs[r];if(typeof o==="function"){try{e=o(t)}catch(t){e=t}if(e instanceof Error){y=e;return}}else{e=R.require(t)}setConfigObject(e)}catch(t){if(t.name==="PermissionDenied")y=t;else if(e[r])y=Error(h("Invalid JSON config file: %s",n))}}}))}function setConfigObject(e,t){Object.keys(e).forEach((function(r){const n=e[r];const o=t?t+"."+r:r;if(typeof n==="object"&&n!==null&&!Array.isArray(n)&&s["dot-notation"]){setConfigObject(n,o)}else{if(!hasKey(E,o.split("."))||checkAllAliases(o,m.arrays)&&s["combine-arrays"]){setArg(o,n)}}}))}function setConfigObjects(){if(typeof u!=="undefined"){u.forEach((function(e){setConfigObject(e)}))}}function applyEnvVars(e,t){if(typeof c==="undefined")return;const r=typeof c==="string"?c:"";const n=R.env();Object.keys(n).forEach((function(o){if(r===""||o.lastIndexOf(r,0)===0){const i=o.split("__").map((function(e,t){if(t===0){e=e.substring(r.length)}return camelCase(e)}));if((t&&m.configs[i.join(".")]||!t)&&!hasKey(e,i)){setArg(i.join("."),n[o])}}}))}function applyCoercions(e){let t;const r=new Set;Object.keys(e).forEach((function(n){if(!r.has(n)){t=checkAllAliases(n,m.coercions);if(typeof t==="function"){try{const o=maybeCoerceNumber(n,t(e[n]));[].concat(m.aliases[n]||[],n).forEach((t=>{r.add(t);e[t]=o}))}catch(e){y=e}}}}))}function setPlaceholderKeys(e){m.keys.forEach((t=>{if(~t.indexOf("."))return;if(typeof e[t]==="undefined")e[t]=undefined}));return e}function applyDefaultsAndAliases(e,t,r,n=false){Object.keys(r).forEach((function(o){if(!hasKey(e,o.split("."))){setKey(e,o.split("."),r[o]);if(n)p[o]=true;(t[o]||[]).forEach((function(t){if(hasKey(e,t.split(".")))return;setKey(e,t.split("."),r[o])}))}}))}function hasKey(e,t){let r=e;if(!s["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){r=r[e]||{}}));const n=t[t.length-1];if(typeof r!=="object")return false;else return n in r}function setKey(e,t,r){let n=e;if(!s["dot-notation"])t=[t.join(".")];t.slice(0,-1).forEach((function(e){e=sanitizeKey(e);if(typeof n==="object"&&n[e]===undefined){n[e]={}}if(typeof n[e]!=="object"||Array.isArray(n[e])){if(Array.isArray(n[e])){n[e].push({})}else{n[e]=[n[e],{}]}n=n[e][n[e].length-1]}else{n=n[e]}}));const o=sanitizeKey(t[t.length-1]);const i=checkAllAliases(t.join("."),m.arrays);const a=Array.isArray(r);let u=s["duplicate-arguments-array"];if(!u&&checkAllAliases(o,m.nargs)){u=true;if(!isUndefined(n[o])&&m.nargs[o]===1||Array.isArray(n[o])&&n[o].length===m.nargs[o]){n[o]=undefined}}if(r===increment()){n[o]=increment(n[o])}else if(Array.isArray(n[o])){if(u&&i&&a){n[o]=s["flatten-duplicate-arrays"]?n[o].concat(r):(Array.isArray(n[o][0])?n[o]:[n[o]]).concat([r])}else if(!u&&Boolean(i)===Boolean(a)){n[o]=r}else{n[o]=n[o].concat([r])}}else if(n[o]===undefined&&i){n[o]=a?r:[r]}else if(u&&!(n[o]===undefined||checkAllAliases(o,m.counts)||checkAllAliases(o,m.bools))){n[o]=[n[o],r]}else{n[o]=r}}function extendAliases(...e){e.forEach((function(e){Object.keys(e||{}).forEach((function(e){if(m.aliases[e])return;m.aliases[e]=[].concat(i[e]||[]);m.aliases[e].concat(e).forEach((function(t){if(/-/.test(t)&&s["camel-case-expansion"]){const r=camelCase(t);if(r!==e&&m.aliases[e].indexOf(r)===-1){m.aliases[e].push(r);d[r]=true}}}));m.aliases[e].concat(e).forEach((function(t){if(t.length>1&&/[A-Z]/.test(t)&&s["camel-case-expansion"]){const r=decamelize(t,"-");if(r!==e&&m.aliases[e].indexOf(r)===-1){m.aliases[e].push(r);d[r]=true}}}));m.aliases[e].forEach((function(t){m.aliases[t]=[e].concat(m.aliases[e].filter((function(e){return t!==e})))}))}))}))}function checkAllAliases(e,t){const r=[].concat(m.aliases[e]||[],e);const n=Object.keys(t);const o=r.find((e=>n.includes(e)));return o?t[o]:false}function hasAnyFlag(e){const t=Object.keys(m);const r=[].concat(t.map((e=>m[e])));return r.some((function(t){return Array.isArray(t)?t.includes(e):t[e]}))}function hasFlagsMatching(e,...t){const r=[].concat(...t);return r.some((function(t){const r=e.match(t);return r&&hasAnyFlag(r[1])}))}function hasAllShortFlags(e){if(e.match(g)||!e.match(/^-[^-]+/)){return false}let t=true;let r;const n=e.slice(1).split("");for(let o=0;o<n.length;o++){r=e.slice(o+2);if(!hasAnyFlag(n[o])){t=false;break}if(n[o+1]&&n[o+1]==="="||r==="-"||/[A-Za-z]/.test(n[o])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(r)||n[o+1]&&n[o+1].match(/\W/)){break}}return t}function isUnknownOptionAsArg(e){return s["unknown-options-as-args"]&&isUnknownOption(e)}function isUnknownOption(e){e=e.replace(/^-{3,}/,"--");if(e.match(g)){return false}if(hasAllShortFlags(e)){return false}const t=/^-+([^=]+?)=[\s\S]*$/;const r=/^-+([^=]+?)$/;const n=/^-+([^=]+?)-$/;const o=/^-+([^=]+?\d+)$/;const i=/^-+([^=]+?)\W+.*$/;return!hasFlagsMatching(e,t,D,r,n,o,i)}function defaultValue(e){if(!checkAllAliases(e,m.bools)&&!checkAllAliases(e,m.counts)&&`${e}`in a){return a[e]}else{return defaultForType(guessType(e))}}function defaultForType(e){const t={[M.BOOLEAN]:true,[M.STRING]:"",[M.NUMBER]:undefined,[M.ARRAY]:[]};return t[e]}function guessType(e){let t=M.BOOLEAN;if(checkAllAliases(e,m.strings))t=M.STRING;else if(checkAllAliases(e,m.numbers))t=M.NUMBER;else if(checkAllAliases(e,m.bools))t=M.BOOLEAN;else if(checkAllAliases(e,m.arrays))t=M.ARRAY;return t}function isUndefined(e){return e===undefined}function checkConfiguration(){Object.keys(m.counts).find((e=>{if(checkAllAliases(e,m.arrays)){y=Error(h("Invalid configuration: %s, opts.count excludes opts.array.",e));return true}else if(checkAllAliases(e,m.nargs)){y=Error(h("Invalid configuration: %s, opts.count excludes opts.narg.",e));return true}return false}))}return{aliases:Object.assign({},m.aliases),argv:Object.assign(v,E),configuration:s,defaulted:Object.assign({},p),error:y,newAliases:Object.assign({},d)}}}function combineAliases(e){const t=[];const r=Object.create(null);let n=true;Object.keys(e).forEach((function(r){t.push([].concat(e[r],r))}));while(n){n=false;for(let e=0;e<t.length;e++){for(let r=e+1;r<t.length;r++){const o=t[e].filter((function(e){return t[r].indexOf(e)!==-1}));if(o.length){t[e]=t[e].concat(t[r]);t.splice(r,1);n=true;break}}}}t.forEach((function(e){e=e.filter((function(e,t,r){return r.indexOf(e)===t}));const t=e.pop();if(t!==undefined&&typeof t==="string"){r[t]=e}}));return r}function increment(e){return e!==undefined?e+1:1}function sanitizeKey(e){if(e==="__proto__")return"___proto___";return e}function stripQuotes(e){return typeof e==="string"&&(e[0]==="'"||e[0]==='"')&&e[e.length-1]===e[0]?e.substring(1,e.length-1):e}const U=e(import.meta.url)("node:module");
|
|
27
27
|
/**
|
|
28
28
|
* @fileoverview Main entrypoint for libraries using yargs-parser in Node.js
|
|
29
29
|
*
|
|
@@ -31,4 +31,4 @@ let U;class YargsParser{constructor(e){U=e}parse(e,t){const r=Object.assign({ali
|
|
|
31
31
|
* Copyright (c) 2016, Contributors
|
|
32
32
|
* SPDX-License-Identifier: ISC
|
|
33
33
|
*/
|
|
34
|
-
var L,W,K;const z=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const G=(W=(L=process===null||process===void 0?void 0:process.versions)===null||L===void 0?void 0:L.node)!==null&&W!==void 0?W:(K=process===null||process===void 0?void 0:process.version)===null||K===void 0?void 0:K.slice(1);if(G){const e=Number(G.match(/^([^.]+)/)[1]);if(e<z){throw Error(`yargs parser supports a minimum Node.js version of ${z}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}}const H=process?process.env:{};const V=$.createRequire?(0,$.createRequire)(import.meta.url):undefined;const J=new YargsParser({cwd:process.cwd,env:()=>H,format:N.format,normalize:I.normalize,resolve:I.resolve,require:e=>{if(typeof V!=="undefined"){return V(e)}else if(e.match(/\.json$/)){return JSON.parse((0,T.readFileSync)(e,"utf8"))}else{throw Error("only .json config files are supported in ESM")}}});const q=function Parser(e,t){const r=J.parse(e.slice(),t);return r.argv};q.detailed=function(e,t){return J.parse(e.slice(),t)};q.camelCase=camelCase;q.decamelize=decamelize;q.looksLikeNumber=looksLikeNumber;const Y=q;function getProcessArgvBinIndex(){if(isBundledElectronApp())return 0;return 1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(e){return e.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}const X={fs:{readFileSync:T.readFileSync,writeFile:T.writeFile},format:N.format,resolve:I.resolve,exists:e=>{try{return(0,T.statSync)(e).isFile()}catch(e){return false}}};let Q;class Y18N{constructor(e){e=e||{};this.directory=e.directory||"./locales";this.updateFiles=typeof e.updateFiles==="boolean"?e.updateFiles:true;this.locale=e.locale||"en";this.fallbackToLanguage=typeof e.fallbackToLanguage==="boolean"?e.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...e){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const t=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]=t;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return Q.format.apply(Q.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments);const t=e.shift();const r=e.shift();const n=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();if(!this.cache[this.locale])this._readLocaleFile();let o=n===1?t:r;if(this.cache[this.locale][t]){const e=this.cache[this.locale][t];o=e[n===1?"one":"other"]}if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]={one:t,other:r};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const i=[o];if(~o.indexOf("%d"))i.push(n);return Q.format.apply(Q.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){if(!this.cache[this.locale])this._readLocaleFile();for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this.cache[this.locale][t]=e[t]}}}_taggedLiteral(e,...t){let r="";e.forEach((function(e,n){const o=t[n+1];r+=e;if(typeof o!=="undefined"){r+="%s"}}));return this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const e=this;const t=this.writeQueue[0];const r=t.directory;const n=t.locale;const o=t.cb;const i=this._resolveLocaleFile(r,n);const u=JSON.stringify(this.cache[n],null,2);Q.fs.writeFile(i,u,"utf-8",(function(t){e.writeQueue.shift();if(e.writeQueue.length>0)e._processWriteQueue();o(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{if(Q.fs.readFileSync){e=JSON.parse(Q.fs.readFileSync(t,"utf-8"))}}catch(r){if(r instanceof SyntaxError){r.message="syntax error in "+t}if(r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=Q.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){const n=Q.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(n))r=n}return r}_fileExistsSync(e){return Q.exists(e)}}function y18n(e,t){Q=t;const r=new Y18N(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const y18n_y18n=e=>y18n(e,X);const Z=y18n_y18n;var ee=n(9103);const te=e(import.meta.url)("node:fs");const re=(0,M.fileURLToPath)(import.meta.url);const ne=re.substring(0,re.lastIndexOf("node_modules"));const oe=(0,$.createRequire)(import.meta.url);const ie={assert:{notStrictEqual:o.notStrictEqual,strictEqual:o.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:N.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:ne||process.cwd(),Parser:Y,path:{basename:I.basename,dirname:I.dirname,extname:I.extname,relative:I.relative,resolve:I.resolve,join:I.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!=="undefined"?process.stdout.columns:null},readFileSync:te.readFileSync,readdirSync:te.readdirSync,require:oe,getCallerFile:()=>{const e=ee(3);return e.match(/^file:\/\//)?(0,M.fileURLToPath)(e):e},stringWidth:stringWidth,y18n:Z({directory:(0,I.resolve)(re,"../../../locales"),updateFiles:false})};function assertNotStrictEqual(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function assertSingleKey(e,t){t.assert.strictEqual(typeof e,"string")}function objectKeys(e){return Object.keys(e)}function isPromise(e){return!!e&&!!e.then&&typeof e.then==="function"}class YError extends Error{constructor(e){super(e||"yargs error");this.name="YError";if(Error.captureStackTrace){Error.captureStackTrace(this,YError)}}}function parseCommand(e){const t=e.replace(/\s{2,}/g," ");const r=t.split(/\s+(?![^[]*]|[^<]*>)/);const n=/\.*[\][<>]/g;const o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);const i={cmd:o.replace(n,""),demanded:[],optional:[]};r.forEach(((e,t)=>{let o=false;e=e.replace(/\s/g,"");if(/\.+[\]>]/.test(e)&&t===r.length-1)o=true;if(/^\[/.test(e)){i.optional.push({cmd:e.replace(n,"").split("|"),variadic:o})}else{i.demanded.push({cmd:e.replace(n,"").split("|"),variadic:o})}}));return i}const ue=["first","second","third","fourth","fifth","sixth"];function argsert(e,t,r){function parseArgs(){return typeof e==="object"?[{demanded:[],optional:[]},e,t]:[parseCommand(`cmd ${e}`),t,r]}try{let e=0;const[t,r,n]=parseArgs();const o=[].slice.call(r);while(o.length&&o[o.length-1]===undefined)o.pop();const i=n||o.length;if(i<t.demanded.length){throw new YError(`Not enough arguments provided. Expected ${t.demanded.length} but received ${o.length}.`)}const u=t.demanded.length+t.optional.length;if(i>u){throw new YError(`Too many arguments provided. Expected max ${u} but received ${i}.`)}t.demanded.forEach((t=>{const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}));t.optional.forEach((t=>{if(o.length===0)return;const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}))}catch(e){console.warn(e.stack)}}function guessType(e){if(Array.isArray(e)){return"array"}else if(e===null){return"null"}return typeof e}function argumentTypeError(e,t,r){throw new YError(`Invalid ${ue[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[];this.frozens=[];this.yargs=e}addMiddleware(e,t,r=true,n=false){argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length);if(Array.isArray(e)){for(let n=0;n<e.length;n++){if(typeof e[n]!=="function"){throw Error("middleware must be a function")}const o=e[n];o.applyBeforeValidation=t;o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==="function"){const o=e;o.applyBeforeValidation=t;o.global=r;o.mutates=n;this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const r=this.yargs.getAliases();this.globalMiddleware=this.globalMiddleware.filter((e=>{const n=[...r[t]||[],t];if(!e.option)return true;else return!n.includes(e.option)}));e.option=t;return this.addMiddleware(e,true,true,true)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();if(e!==undefined)this.globalMiddleware=e}reset(){this.globalMiddleware=this.globalMiddleware.filter((e=>e.global))}}function commandMiddlewareFactory(e){if(!e)return[];return e.map((e=>{e.applyBeforeValidation=false;return e}))}function applyMiddleware(e,t,r,n){return r.reduce(((e,r)=>{if(r.applyBeforeValidation!==n){return e}if(r.mutates){if(r.applied)return e;r.applied=true}if(isPromise(e)){return e.then((e=>Promise.all([e,r(e,t)]))).then((([e,t])=>Object.assign(e,t)))}else{const n=r(e,t);return isPromise(n)?n.then((t=>Object.assign(e,t))):Object.assign(e,n)}}),e)}function maybeAsyncResult(e,t,r=e=>{throw e}){try{const r=isFunction(e)?e():e;return isPromise(r)?r.then((e=>t(e))):t(r)}catch(e){return r(e)}}function isFunction(e){return typeof e==="function"}const se=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,r,n){this.requireCache=new Set;this.handlers={};this.aliasMap={};this.frozens=[];this.shim=n;this.usage=e;this.globalMiddleware=r;this.validation=t}addDirectory(e,t,r,n){n=n||{};this.requireCache.add(r);const o=this.shim.path.resolve(this.shim.path.dirname(r),e);const i=this.shim.readdirSync(o,{recursive:n.recurse?true:false});if(!Array.isArray(n.extensions))n.extensions=["js"];const u=typeof n.visit==="function"?n.visit:e=>e;for(const e of i){const r=e.toString();if(n.exclude){let e=false;if(typeof n.exclude==="function"){e=n.exclude(r)}else{e=n.exclude.test(r)}if(e)continue}if(n.include){let e=false;if(typeof n.include==="function"){e=n.include(r)}else{e=n.include.test(r)}if(!e)continue}let i=false;for(const e of n.extensions){if(r.endsWith(e))i=true}if(i){const e=this.shim.path.join(o,r);const n=t(e);const i=Object.create(null,Object.getOwnPropertyDescriptors({...n}));const s=u(i,e,r);if(s){if(this.requireCache.has(e))continue;else this.requireCache.add(e);if(!i.command){i.command=this.shim.path.basename(e,this.shim.path.extname(e))}this.addHandler(i)}}}}addHandler(e,t,r,n,o,i){let u=[];const s=commandMiddlewareFactory(o);n=n||(()=>{});if(Array.isArray(e)){if(isCommandAndAliases(e)){[e,...u]=e}else{for(const t of e){this.addHandler(t)}}}else if(isCommandHandlerDefinition(e)){let t=Array.isArray(e.command)||typeof e.command==="string"?e.command:null;if(t===null){throw new Error(`No command name given for module: ${this.shim.inspect(e)}`)}if(e.aliases)t=[].concat(t).concat(e.aliases);this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(r)){this.addHandler([e].concat(u),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e==="string"){const o=parseCommand(e);u=u.map((e=>parseCommand(e).cmd));let a=false;const c=[o.cmd].concat(u).filter((e=>{if(se.test(e)){a=true;return false}return true}));if(c.length===0&&a)c.push("$0");if(a){o.cmd=c[0];u=c.slice(1);e=e.replace(se,o.cmd)}u.forEach((e=>{this.aliasMap[e]=o.cmd}));if(t!==false){this.usage.command(e,t,a,u,i)}this.handlers[o.cmd]={original:e,description:t,handler:n,builder:r||{},middlewares:s,deprecated:i,demanded:o.demanded,optional:o.optional};if(a)this.defaultCommand=this.handlers[o.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,n,o,i){const u=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand;const s=t.getInternalMethods().getContext();const a=s.commands.slice();const c=!e;if(e){s.commands.push(e);s.fullCommands.push(u.original)}const l=this.applyBuilderUpdateUsageAndParse(c,u,t,r.aliases,a,n,o,i);return isPromise(l)?l.then((e=>this.applyMiddlewareAndGetResult(c,u,e.innerArgv,s,o,e.aliases,t))):this.applyMiddlewareAndGetResult(c,u,l.innerArgv,s,o,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,n,o,i,u,s){const a=t.builder;let c=r;if(isCommandBuilderCallback(a)){r.getInternalMethods().getUsageInstance().freeze();const l=a(r.getInternalMethods().reset(n),s);if(isPromise(l)){return l.then((n=>{c=isYargsInstance(n)?n:r;return this.parseAndUpdateUsage(e,t,c,o,i,u)}))}}else if(isCommandBuilderOptionDefinitions(a)){r.getInternalMethods().getUsageInstance().freeze();c=r.getInternalMethods().reset(n);Object.keys(t.builder).forEach((e=>{c.option(e,a[e])}))}return this.parseAndUpdateUsage(e,t,c,o,i,u)}parseAndUpdateUsage(e,t,r,n,o,i){if(e)r.getInternalMethods().getUsageInstance().unfreeze(true);if(this.shouldUpdateUsage(r)){r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(n,t),t.description)}const u=r.getInternalMethods().runYargsParserAndExecuteCommands(null,undefined,true,o,i);return isPromise(u)?u.then((e=>({aliases:r.parsed.aliases,innerArgv:e}))):{aliases:r.parsed.aliases,innerArgv:u}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const r=se.test(t.original)?t.original.replace(se,"").trim():t.original;const n=e.filter((e=>!se.test(e)));n.push(r);return`$0 ${n.join(" ")}`}handleValidationAndGetResult(e,t,r,n,o,i,u,s){if(!i.getInternalMethods().getHasOutput()){const t=i.getInternalMethods().runValidation(o,s,i.parsed.error,e);r=maybeAsyncResult(r,(e=>{t(e);return e}))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();const n=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(r,n,false,false);r=applyMiddleware(r,i,u,false);r=maybeAsyncResult(r,(e=>{const r=t.handler(e);return isPromise(r)?r.then((()=>e)):e}));if(!e){i.getInternalMethods().getUsageInstance().cacheHelpMessage()}if(isPromise(r)&&!i.getInternalMethods().hasParseCallback()){r.catch((e=>{try{i.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}}))}}if(!e){n.commands.pop();n.fullCommands.pop()}return r}applyMiddlewareAndGetResult(e,t,r,n,o,i,u){let s={};if(o)return r;if(!u.getInternalMethods().getHasOutput()){s=this.populatePositionals(t,r,n,u)}const a=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);const c=applyMiddleware(r,u,a,true);return isPromise(c)?c.then((r=>this.handleValidationAndGetResult(e,t,r,n,i,u,a,s))):this.handleValidationAndGetResult(e,t,c,n,i,u,a,s)}populatePositionals(e,t,r,n){t._=t._.slice(r.commands.length);const o=e.demanded.slice(0);const i=e.optional.slice(0);const u={};this.validation.positionalCount(o.length,t._.length);while(o.length){const e=o.shift();this.populatePositional(e,t,u)}while(i.length){const e=i.shift();this.populatePositional(e,t,u)}t._=r.commands.concat(t._.map((e=>""+e)));this.postProcessPositionals(t,u,this.cmdToParseOptions(e.original),n);return u}populatePositional(e,t,r){const n=e.cmd[0];if(e.variadic){r[n]=t._.splice(0).map(String)}else{if(t._.length)r[n]=[String(t._.shift())]}}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}};const r=parseCommand(e);r.demanded.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n;t.demand[r]=true}));r.optional.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n}));return t}postProcessPositionals(e,t,r,n){const o=Object.assign({},n.getOptions());o.default=Object.assign(r.default,o.default);for(const e of Object.keys(r.alias)){o.alias[e]=(o.alias[e]||[]).concat(r.alias[e])}o.array=o.array.concat(r.array);o.config={};const i=[];Object.keys(t).forEach((e=>{t[e].map((t=>{if(o.configuration["unknown-options-as-args"])o.key[e]=true;i.push(`--${e}`);i.push(t)}))}));if(!i.length)return;const u=Object.assign({},o.configuration,{"populate--":false});const s=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:u}));if(s.error){n.getInternalMethods().getUsageInstance().fail(s.error.message,s.error)}else{const r=Object.keys(t);Object.keys(t).forEach((e=>{r.push(...s.aliases[e])}));Object.keys(s.argv).forEach((o=>{if(r.includes(o)){if(!t[o])t[o]=s.argv[o];if(!this.isInConfigs(n,o)&&!this.isDefaulted(n,o)&&Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(s.argv,o)&&(Array.isArray(e[o])||Array.isArray(s.argv[o]))){e[o]=[].concat(e[o],s.argv[o])}else{e[o]=s.argv[o]}}}))}}isDefaulted(e,t){const{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:r}=e.getOptions();return r.some((e=>Object.prototype.hasOwnProperty.call(e,t)))||r.some((e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t))))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const t=se.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t)){return t(e,true)}else if(!isCommandBuilderDefinition(t)){Object.keys(t).forEach((r=>{e.option(r,t[r])}))}return undefined}extractDesc({describe:e,description:t,desc:r}){for(const n of[e,t,r]){if(typeof n==="string"||n===false)return n;assertNotStrictEqual(n,true,this.shim)}return false}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,undefined,this.shim);({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e)}reset(){this.handlers={};this.aliasMap={};this.defaultCommand=undefined;this.requireCache=new Set;return this}}function command(e,t,r,n){return new CommandInstance(e,t,r,n)}function isCommandBuilderDefinition(e){return typeof e==="object"&&!!e.builder&&typeof e.handler==="function"}function isCommandAndAliases(e){return e.every((e=>typeof e==="string"))}function isCommandBuilderCallback(e){return typeof e==="function"}function isCommandBuilderOptionDefinitions(e){return typeof e==="object"}function isCommandHandlerDefinition(e){return typeof e==="object"&&!Array.isArray(e)}function objFilter(e={},t=()=>true){const r={};objectKeys(e).forEach((n=>{if(t(n,e[n])){r[n]=e[n]}}));return r}function setBlocking(e){if(typeof process==="undefined")return;[process.stdout,process.stderr].forEach((t=>{const r=t;if(r._handle&&r.isTTY&&typeof r._handle.setBlocking==="function"){r._handle.setBlocking(e)}}))}function isBoolean(e){return typeof e==="boolean"}function usage(e,t){const r=t.y18n.__;const n={};const o=[];n.failFn=function failFn(e){o.push(e)};let i=null;let u=null;let s=true;n.showHelpOnFail=function showHelpOnFailFn(t=true,r){const[o,a]=typeof t==="string"?[true,t]:[t,r];if(e.getInternalMethods().isGlobalContext()){u=a}i=a;s=o;return n};let a=false;n.fail=function fail(t,r){const c=e.getInternalMethods().getLoggerInstance();if(o.length){for(let e=o.length-1;e>=0;--e){const i=o[e];if(isBoolean(i)){if(r)throw r;else if(t)throw Error(t)}else{i(t,r,n)}}}else{if(e.getExitProcess())setBlocking(true);if(!a){a=true;if(s){e.showHelp("error");c.error()}if(t||r)c.error(t||r);const n=i||u;if(n){if(t||r)c.error("");c.error(n)}}r=r||new YError(t);if(e.getExitProcess()){return e.exit(1)}else if(e.getInternalMethods().hasParseCallback()){return e.exit(1,r)}else{throw r}}};let c=[];let l=false;n.usage=(e,t)=>{if(e===null){l=true;c=[];return n}l=false;c.push([e,t||""]);return n};n.getUsage=()=>c;n.getUsageDisabled=()=>l;n.getPositionalGroupName=()=>r("Positionals:");let D=[];n.example=(e,t)=>{D.push([e,t||""])};let f=[];n.command=function command(e,t,r,n,o=false){if(r){f=f.map((e=>{e[2]=false;return e}))}f.push([e,t||"",r,n,o])};n.getCommands=()=>f;let d={};n.describe=function describe(e,t){if(Array.isArray(e)){e.forEach((e=>{n.describe(e,t)}))}else if(typeof e==="object"){Object.keys(e).forEach((t=>{n.describe(t,e[t])}))}else{d[e]=t}};n.getDescriptions=()=>d;let p=[];n.epilog=e=>{p.push(e)};let h=false;let g;n.wrap=e=>{h=true;g=e};n.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!h){g=windowWidth();h=true}return g};const m="__yargsString__:";n.deferY18nLookup=e=>m+e;n.help=function help(){if(y)return y;normalizeAliases();const o=e.customScriptName?e.$0:t.path.basename(e.$0);const i=e.getDemandedOptions();const u=e.getDemandedCommands();const s=e.getDeprecatedOptions();const a=e.getGroups();const h=e.getOptions();let g=[];g=g.concat(Object.keys(d));g=g.concat(Object.keys(i));g=g.concat(Object.keys(u));g=g.concat(Object.keys(h.default));g=g.filter(filterHiddenOptions);g=Object.keys(g.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const F=n.getWrap();const b=t.cliui({width:F,wrap:!!F});if(!l){if(c.length){c.forEach((e=>{b.div({text:`${e[0].replace(/\$0/g,o)}`});if(e[1]){b.div({text:`${e[1]}`,padding:[1,0,0,0]})}}));b.div()}else if(f.length){let e=null;if(u._){e=`${o} <${r("command")}>\n`}else{e=`${o} [${r("command")}]\n`}b.div(`${e}`)}}if(f.length>1||f.length===1&&!f[0][2]){b.div(r("Commands:"));const t=e.getInternalMethods().getContext();const n=t.commands.length?`${t.commands.join(" ")} `:"";if(e.getInternalMethods().getParserConfiguration()["sort-commands"]===true){f=f.sort(((e,t)=>e[0].localeCompare(t[0])))}const i=o?`${o} `:"";f.forEach((e=>{const t=`${i}${n}${e[0].replace(/^\$0 ?/,"")}`;b.span({text:t,padding:[0,2,0,2],width:maxWidth(f,F,`${o}${n}`)+4},{text:e[1]});const u=[];if(e[2])u.push(`[${r("default")}]`);if(e[3]&&e[3].length){u.push(`[${r("aliases:")} ${e[3].join(", ")}]`)}if(e[4]){if(typeof e[4]==="string"){u.push(`[${r("deprecated: %s",e[4])}]`)}else{u.push(`[${r("deprecated")}]`)}}if(u.length){b.div({text:u.join(" "),padding:[0,0,0,2],align:"right"})}else{b.div()}}));b.div()}const E=(Object.keys(h.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter((t=>!e.parsed.newAliases[t]&&E.every((e=>(h.alias[e]||[]).indexOf(t)===-1))));const C=r("Options:");if(!a[C])a[C]=[];addUngroupedKeys(g,h.alias,a,C);const isLongSwitch=e=>/^--/.test(getText(e));const v=Object.keys(a).filter((e=>a[e].length>0)).map((e=>{const t=a[e].filter(filterHiddenOptions).map((e=>{if(E.includes(e))return e;for(let t=0,r;(r=E[t])!==undefined;t++){if((h.alias[r]||[]).includes(e))return r}return e}));return{groupName:e,normalizedKeys:t}})).filter((({normalizedKeys:e})=>e.length>0)).map((({groupName:e,normalizedKeys:t})=>{const r=t.reduce(((t,r)=>{t[r]=[r].concat(h.alias[r]||[]).map((t=>{if(e===n.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?h.boolean.includes(r)?"-":"--":t.length>1?"--":"-")+t}})).sort(((e,t)=>isLongSwitch(e)===isLongSwitch(t)?0:isLongSwitch(e)?1:-1)).join(", ");return t}),{});return{groupName:e,normalizedKeys:t,switches:r}}));const w=v.filter((({groupName:e})=>e!==n.getPositionalGroupName())).some((({normalizedKeys:e,switches:t})=>!e.every((e=>isLongSwitch(t[e])))));if(w){v.filter((({groupName:e})=>e!==n.getPositionalGroupName())).forEach((({normalizedKeys:e,switches:t})=>{e.forEach((e=>{if(isLongSwitch(t[e])){t[e]=addIndentation(t[e],"-x, ".length)}}))}))}v.forEach((({groupName:t,normalizedKeys:o,switches:u})=>{b.div(t);o.forEach((t=>{const o=u[t];let a=d[t]||"";let c=null;if(a.includes(m))a=r(a.substring(m.length));if(h.boolean.includes(t))c=`[${r("boolean")}]`;if(h.count.includes(t))c=`[${r("count")}]`;if(h.string.includes(t))c=`[${r("string")}]`;if(h.normalize.includes(t))c=`[${r("string")}]`;if(h.array.includes(t))c=`[${r("array")}]`;if(h.number.includes(t))c=`[${r("number")}]`;const deprecatedExtra=e=>typeof e==="string"?`[${r("deprecated: %s",e)}]`:`[${r("deprecated")}]`;const l=[t in s?deprecatedExtra(s[t]):null,c,t in i?`[${r("required")}]`:null,h.choices&&h.choices[t]?`[${r("choices:")} ${n.stringifiedValues(h.choices[t])}]`:null,defaultString(h.default[t],h.defaultDescription[t])].filter(Boolean).join(" ");b.span({text:getText(o),padding:[0,2,0,2+getIndentation(o)],width:maxWidth(u,F)+4},a);const D=e.getInternalMethods().getUsageConfiguration()["hide-types"]===true;if(l&&!D)b.div({text:l,padding:[0,0,0,2],align:"right"});else b.div()}));b.div()}));if(D.length){b.div(r("Examples:"));D.forEach((e=>{e[0]=e[0].replace(/\$0/g,o)}));D.forEach((e=>{if(e[1]===""){b.div({text:e[0],padding:[0,2,0,2]})}else{b.div({text:e[0],padding:[0,2,0,2],width:maxWidth(D,F)+4},{text:e[1]})}}));b.div()}if(p.length>0){const e=p.map((e=>e.replace(/\$0/g,o))).join("\n");b.div(`${e}\n`)}return b.toString().replace(/\s*$/,"")};function maxWidth(e,r,n){let o=0;if(!Array.isArray(e)){e=Object.values(e).map((e=>[e]))}e.forEach((e=>{o=Math.max(t.stringWidth(n?`${n} ${getText(e[0])}`:getText(e[0]))+getIndentation(e[0]),o)}));if(r)o=Math.min(o,parseInt((r*.5).toString(),10));return o}function normalizeAliases(){const t=e.getDemandedOptions();const r=e.getOptions();(Object.keys(r.alias)||[]).forEach((o=>{r.alias[o].forEach((i=>{if(d[i])n.describe(o,d[i]);if(i in t)e.demandOption(o,t[i]);if(r.boolean.includes(i))e.boolean(o);if(r.count.includes(i))e.count(o);if(r.string.includes(i))e.string(o);if(r.normalize.includes(i))e.normalize(o);if(r.array.includes(i))e.array(o);if(r.number.includes(i))e.number(o)}))}))}let y;n.cacheHelpMessage=function(){y=this.help()};n.clearCachedHelpMessage=function(){y=undefined};n.hasCachedHelpMessage=function(){return!!y};function addUngroupedKeys(e,t,r,n){let o=[];let i=null;Object.keys(r).forEach((e=>{o=o.concat(r[e])}));e.forEach((e=>{i=[e].concat(t[e]);if(!i.some((e=>o.indexOf(e)!==-1))){r[n].push(e)}}));return o}function filterHiddenOptions(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}n.showHelp=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const o=typeof t==="function"?t:r[t];o(n.help())};n.functionDescription=e=>{const n=e.name?t.Parser.decamelize(e.name,"-"):r("generated-value");return["(",n,")"].join("")};n.stringifiedValues=function stringifiedValues(e,t){let r="";const n=t||", ";const o=[].concat(e);if(!e||!o.length)return r;o.forEach((e=>{if(r.length)r+=n;r+=JSON.stringify(e)}));return r};function defaultString(e,t){let n=`[${r("default:")} `;if(e===undefined&&!t)return null;if(t){n+=t}else{switch(typeof e){case"string":n+=`"${e}"`;break;case"object":n+=JSON.stringify(e);break;default:n+=e}}return`${n}]`}function windowWidth(){const e=80;if(t.process.stdColumns){return Math.min(e,t.process.stdColumns)}else{return e}}let F=null;n.version=e=>{F=e};n.showVersion=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const n=typeof t==="function"?t:r[t];n(F)};n.reset=function reset(e){i=null;a=false;c=[];l=false;p=[];D=[];f=[];d=objFilter(d,(t=>!e[t]));return n};const b=[];n.freeze=function freeze(){b.push({failMessage:i,failureOutput:a,usages:c,usageDisabled:l,epilogs:p,examples:D,commands:f,descriptions:d})};n.unfreeze=function unfreeze(e=false){const t=b.pop();if(!t)return;if(e){d={...t.descriptions,...d};f=[...t.commands,...f];c=[...t.usages,...c];D=[...t.examples,...D];p=[...t.epilogs,...p]}else{({failMessage:i,failureOutput:a,usages:c,usageDisabled:l,epilogs:p,examples:D,commands:f,descriptions:d}=t)}};return n}function isIndentedText(e){return typeof e==="object"}function addIndentation(e,t){return isIndentedText(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function getIndentation(e){return isIndentedText(e)?e.indentation:0}function getText(e){return isIndentedText(e)?e.text:e}const ae=`###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="\${COMP_WORDS[COMP_CWORD]}"\n args=("\${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk\n mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")\n mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |\n awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')\n\n # if no match was found, fall back to filename completion\n if [ \${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n`;const ce=`#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))\n IFS=$si\n if [[ \${#reply} -gt 0 ]]; then\n _describe 'values' reply\n else\n _default\n fi\n}\nif [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then\n _{{app_name}}_yargs_completions "$@"\nelse\n compdef _{{app_name}}_yargs_completions {{app_name}}\nfi\n###-end-{{app_name}}-completions-###\n`;class Completion{constructor(e,t,r,n){var o,i,u;this.yargs=e;this.usage=t;this.command=r;this.shim=n;this.completionKey="get-yargs-completions";this.aliases=null;this.customCompletionFunction=null;this.indexAfterLastReset=0;this.zshShell=(u=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&u!==void 0?u:false}defaultCompletion(e,t,r,n){const o=this.command.getCommandHandlers();for(let t=0,r=e.length;t<r;++t){if(o[e[t]]&&o[e[t]].builder){const r=o[e[t]].builder;if(isCommandBuilderCallback(r)){this.indexAfterLastReset=t+1;const e=this.yargs.getInternalMethods().reset();r(e,true);return e.argv}}}const i=[];this.commandCompletions(i,e,r);this.optionCompletions(i,e,t,r);this.choicesFromOptionsCompletions(i,e,t,r);this.choicesFromPositionalsCompletions(i,e,t,r);n(null,i)}commandCompletions(e,t,r){const n=this.yargs.getInternalMethods().getContext().commands;if(!r.match(/^-/)&&n[n.length-1]!==r&&!this.previousArgHasChoices(t)){this.usage.getCommands().forEach((r=>{const n=parseCommand(r[0]).cmd;if(t.indexOf(n)===-1){if(!this.zshShell){e.push(n)}else{const t=r[1]||"";e.push(n.replace(/:/g,"\\:")+":"+t)}}}))}}optionCompletions(e,t,r,n){if((n.match(/^-/)||n===""&&e.length===0)&&!this.previousArgHasChoices(t)){const r=this.yargs.getOptions();const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(r.key).forEach((i=>{const u=!!r.configuration["boolean-negation"]&&r.boolean.includes(i);const s=o.includes(i);if(!s&&!r.hiddenOptions.includes(i)&&!this.argsContainKey(t,i,u)){this.completeOptionKey(i,e,n,u&&!!r.default[i])}}))}}choicesFromOptionsCompletions(e,t,r,n){if(this.previousArgHasChoices(t)){const r=this.getPreviousArgChoices(t);if(r&&r.length>0){e.push(...r.map((e=>e.replace(/:/g,"\\:"))))}}}choicesFromPositionalsCompletions(e,t,r,n){if(n===""&&e.length>0&&this.previousArgHasChoices(t)){return}const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];const i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1);const u=o[r._.length-i-1];if(!u){return}const s=this.yargs.getOptions().choices[u]||[];for(const t of s){if(t.startsWith(n)){e.push(t.replace(/:/g,"\\:"))}}}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1];let r="";if(!t.startsWith("-")&&e.length>1){r=t;t=e[e.length-2]}if(!t.startsWith("-"))return;const n=t.replace(/^-+/,"");const o=this.yargs.getOptions();const i=[n,...this.yargs.getAliases()[n]||[]];let u;for(const e of i){if(Object.prototype.hasOwnProperty.call(o.key,e)&&Array.isArray(o.choices[e])){u=o.choices[e];break}}if(u){return u.filter((e=>!r||e.startsWith(r)))}}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==undefined&&t.length>0}argsContainKey(e,t,r){const argsContains=t=>e.indexOf((/^[^0-9]$/.test(t)?"-":"--")+t)!==-1;if(argsContains(t))return true;if(r&&argsContains(`no-${t}`))return true;if(this.aliases){for(const e of this.aliases[t]){if(argsContains(e))return true}}return false}completeOptionKey(e,t,r,n){var o,i,u,s;let a=e;if(this.zshShell){const t=this.usage.getDescriptions();const r=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find((e=>{const r=t[e];return typeof r==="string"&&r.length>0}));const n=r?t[r]:undefined;const c=(s=(u=t[e])!==null&&u!==void 0?u:n)!==null&&s!==void 0?s:"";a=`${e.replace(/:/g,"\\:")}:${c.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const startsByTwoDashes=e=>/^--/.test(e);const isShortOption=e=>/^[^0-9]$/.test(e);const c=!startsByTwoDashes(r)&&isShortOption(e)?"-":"--";t.push(c+a);if(n){t.push(c+"no-"+a)}}customCompletion(e,t,r,n){assertNotStrictEqual(this.customCompletionFunction,null,this.shim);if(isSyncCompletionFunction(this.customCompletionFunction)){const e=this.customCompletionFunction(r,t);if(isPromise(e)){return e.then((e=>{this.shim.process.nextTick((()=>{n(null,e)}))})).catch((e=>{this.shim.process.nextTick((()=>{n(e,undefined)}))}))}return n(null,e)}else if(isFallbackCompletionFunction(this.customCompletionFunction)){return this.customCompletionFunction(r,t,((o=n)=>this.defaultCompletion(e,t,r,o)),(e=>{n(null,e)}))}else{return this.customCompletionFunction(r,t,(e=>{n(null,e)}))}}getCompletion(e,t){const r=e.length?e[e.length-1]:"";const n=this.yargs.parse(e,true);const o=this.customCompletionFunction?n=>this.customCompletion(e,n,r,t):n=>this.defaultCompletion(e,n,r,t);return isPromise(n)?n.then(o):o(n)}generateCompletionScript(e,t){let r=this.zshShell?ce:ae;const n=this.shim.path.basename(e);if(e.match(/\.js$/))e=`./${e}`;r=r.replace(/{{app_name}}/g,n);r=r.replace(/{{completion_command}}/g,t);return r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(e,t,r,n){return new Completion(e,t,r,n)}function isSyncCompletionFunction(e){return e.length<3}function isFallbackCompletionFunction(e){return e.length>3}function levenshtein(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++){r[n]=[n]}let o;for(o=0;o<=e.length;o++){r[0][o]=o}for(n=1;n<=t.length;n++){for(o=1;o<=e.length;o++){if(t.charAt(n-1)===e.charAt(o-1)){r[n][o]=r[n-1][o-1]}else{if(n>1&&o>1&&t.charAt(n-2)===e.charAt(o-1)&&t.charAt(n-1)===e.charAt(o-2)){r[n][o]=r[n-2][o-2]+1}else{r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1))}}}}return r[t.length][e.length]}const le=["$0","--","_"];function validation(e,t,r){const n=r.y18n.__;const o=r.y18n.__n;const i={};i.nonOptionCount=function nonOptionCount(r){const n=e.getDemandedCommands();const i=r._.length+(r["--"]?r["--"].length:0);const u=i-e.getInternalMethods().getContext().commands.length;if(n._&&(u<n._.min||u>n._.max)){if(u<n._.min){if(n._.minMsg!==undefined){t.fail(n._.minMsg?n._.minMsg.replace(/\$0/g,u.toString()).replace(/\$1/,n._.min.toString()):null)}else{t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",u,u.toString(),n._.min.toString()))}}else if(u>n._.max){if(n._.maxMsg!==undefined){t.fail(n._.maxMsg?n._.maxMsg.replace(/\$0/g,u.toString()).replace(/\$1/,n._.max.toString()):null)}else{t.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",u,u.toString(),n._.max.toString()))}}}};i.positionalCount=function positionalCount(e,r){if(r<e){t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r+"",e+""))}};i.requiredArguments=function requiredArguments(e,r){let n=null;for(const t of Object.keys(r)){if(!Object.prototype.hasOwnProperty.call(e,t)||typeof e[t]==="undefined"){n=n||{};n[t]=r[t]}}if(n){const e=[];for(const t of Object.keys(n)){const r=n[t];if(r&&e.indexOf(r)<0){e.push(r)}}const r=e.length?`\n${e.join("\n")}`:"";t.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(n).length,Object.keys(n).join(", ")+r))}};i.unknownArguments=function unknownArguments(r,n,u,s,a=true){var c;const l=e.getInternalMethods().getCommandInstance().getCommands();const D=[];const f=e.getInternalMethods().getContext();Object.keys(r).forEach((t=>{if(!le.includes(t)&&!Object.prototype.hasOwnProperty.call(u,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!i.isValidAndSomeAliasIsNotNew(t,n)){D.push(t)}}));if(a&&(f.commands.length>0||l.length>0||s)){r._.slice(f.commands.length).forEach((e=>{if(!l.includes(""+e)){D.push(""+e)}}))}if(a){const t=e.getDemandedCommands();const n=((c=t._)===null||c===void 0?void 0:c.max)||0;const o=f.commands.length+n;if(o<r._.length){r._.slice(o).forEach((e=>{e=String(e);if(!f.commands.includes(e)&&!D.includes(e)){D.push(e)}}))}}if(D.length){t.fail(o("Unknown argument: %s","Unknown arguments: %s",D.length,D.map((e=>e.trim()?e:`"${e}"`)).join(", ")))}};i.unknownCommands=function unknownCommands(r){const n=e.getInternalMethods().getCommandInstance().getCommands();const i=[];const u=e.getInternalMethods().getContext();if(u.commands.length>0||n.length>0){r._.slice(u.commands.length).forEach((e=>{if(!n.includes(""+e)){i.push(""+e)}}))}if(i.length>0){t.fail(o("Unknown command: %s","Unknown commands: %s",i.length,i.join(", ")));return true}else{return false}};i.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(t,r){if(!Object.prototype.hasOwnProperty.call(r,t)){return false}const n=e.parsed.newAliases;return[t,...r[t]].some((e=>!Object.prototype.hasOwnProperty.call(n,e)||!n[t]))};i.limitedChoices=function limitedChoices(r){const o=e.getOptions();const i={};if(!Object.keys(o.choices).length)return;Object.keys(r).forEach((e=>{if(le.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(o.choices,e)){[].concat(r[e]).forEach((t=>{if(o.choices[e].indexOf(t)===-1&&t!==undefined){i[e]=(i[e]||[]).concat(t)}}))}}));const u=Object.keys(i);if(!u.length)return;let s=n("Invalid values:");u.forEach((e=>{s+=`\n ${n("Argument: %s, Given: %s, Choices: %s",e,t.stringifiedValues(i[e]),t.stringifiedValues(o.choices[e]))}`}));t.fail(s)};let u={};i.implies=function implies(t,n){argsert("<string|object> [array|number|string]",[t,n],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.implies(e,t[e])}))}else{e.global(t);if(!u[t]){u[t]=[]}if(Array.isArray(n)){n.forEach((e=>i.implies(t,e)))}else{assertNotStrictEqual(n,undefined,r);u[t].push(n)}}};i.getImplied=function getImplied(){return u};function keyExists(e,t){const r=Number(t);t=isNaN(r)?t:r;if(typeof t==="number"){t=e._.length>=t}else if(t.match(/^--no-.+/)){t=t.match(/^--no-(.+)/)[1];t=!Object.prototype.hasOwnProperty.call(e,t)}else{t=Object.prototype.hasOwnProperty.call(e,t)}return t}i.implications=function implications(e){const r=[];Object.keys(u).forEach((t=>{const n=t;(u[t]||[]).forEach((t=>{let o=n;const i=t;o=keyExists(e,o);t=keyExists(e,t);if(o&&!t){r.push(` ${n} -> ${i}`)}}))}));if(r.length){let e=`${n("Implications failed:")}\n`;r.forEach((t=>{e+=t}));t.fail(e)}};let s={};i.conflicts=function conflicts(t,r){argsert("<string|object> [array|string]",[t,r],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.conflicts(e,t[e])}))}else{e.global(t);if(!s[t]){s[t]=[]}if(Array.isArray(r)){r.forEach((e=>i.conflicts(t,e)))}else{s[t].push(r)}}};i.getConflicting=()=>s;i.conflicting=function conflictingFn(o){Object.keys(o).forEach((e=>{if(s[e]){s[e].forEach((r=>{if(r&&o[e]!==undefined&&o[r]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,r))}}))}}));if(e.getInternalMethods().getParserConfiguration()["strip-dashed"]){Object.keys(s).forEach((e=>{s[e].forEach((i=>{if(i&&o[r.Parser.camelCase(e)]!==undefined&&o[r.Parser.camelCase(i)]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,i))}}))}))}};i.recommendCommands=function recommendCommands(e,r){const o=3;r=r.sort(((e,t)=>t.length-e.length));let i=null;let u=Infinity;for(let t=0,n;(n=r[t])!==undefined;t++){const t=levenshtein(e,n);if(t<=o&&t<u){u=t;i=n}}if(i)t.fail(n("Did you mean %s?",i))};i.reset=function reset(e){u=objFilter(u,(t=>!e[t]));s=objFilter(s,(t=>!e[t]));return i};const a=[];i.freeze=function freeze(){a.push({implied:u,conflicting:s})};i.unfreeze=function unfreeze(){const e=a.pop();assertNotStrictEqual(e,undefined,r);({implied:u,conflicting:s}=e)};return i}let De=[];let fe;function applyExtends(e,t,r,n){fe=n;let o={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!=="string")return o;const i=/\.json|\..*rc$/.test(e.extends);let u=null;if(!i){try{u=import.meta.resolve(e.extends)}catch(t){return e}}else{u=getPathToDefaultConfig(t,e.extends)}checkForCircularExtends(u);De.push(u);o=i?JSON.parse(fe.readFileSync(u,"utf8")):n.require(e.extends);delete e.extends;o=applyExtends(o,fe.path.dirname(u),r,fe)}De=[];return r?mergeDeep(o,e):Object.assign({},o,e)}function checkForCircularExtends(e){if(De.indexOf(e)>-1){throw new YError(`Circular extended configurations: '${e}'.`)}}function getPathToDefaultConfig(e,t){return fe.path.resolve(e,t)}function mergeDeep(e,t){const r={};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}Object.assign(r,e);for(const n of Object.keys(t)){if(isObject(t[n])&&isObject(r[n])){r[n]=mergeDeep(e[n],t[n])}else{r[n]=t[n]}}return r}var de=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r};var pe=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var he,ge,me,ye,Fe,be,Ee,Ce,ve,we,Ae,Oe,Se,Be,je,ke,xe,Pe,_e,Ie,Te,Ne,Me,Re,Ue,$e,Le,We,Ke,ze,Ge,He,Ve,Je,qe;function YargsFactory(e){return(t=[],r=e.process.cwd(),n)=>{const o=new YargsInstance(t,r,n,e);Object.defineProperty(o,"argv",{get:()=>o.parse(),enumerable:true});o.help();o.version();return o}}const Ye=Symbol("copyDoubleDash");const Xe=Symbol("copyDoubleDash");const Qe=Symbol("deleteFromParserHintObject");const Ze=Symbol("emitWarning");const et=Symbol("freeze");const tt=Symbol("getDollarZero");const rt=Symbol("getParserConfiguration");const nt=Symbol("getUsageConfiguration");const ot=Symbol("guessLocale");const it=Symbol("guessVersion");const ut=Symbol("parsePositionalNumbers");const st=Symbol("pkgUp");const at=Symbol("populateParserHintArray");const ct=Symbol("populateParserHintSingleValueDictionary");const lt=Symbol("populateParserHintArrayDictionary");const Dt=Symbol("populateParserHintDictionary");const ft=Symbol("sanitizeKey");const dt=Symbol("setKey");const pt=Symbol("unfreeze");const ht=Symbol("validateAsync");const gt=Symbol("getCommandInstance");const mt=Symbol("getContext");const yt=Symbol("getHasOutput");const Ft=Symbol("getLoggerInstance");const bt=Symbol("getParseContext");const Et=Symbol("getUsageInstance");const Ct=Symbol("getValidationInstance");const vt=Symbol("hasParseCallback");const wt=Symbol("isGlobalContext");const At=Symbol("postProcess");const Ot=Symbol("rebase");const St=Symbol("reset");const Bt=Symbol("runYargsParserAndExecuteCommands");const jt=Symbol("runValidation");const kt=Symbol("setHasOutput");const xt=Symbol("kTrackManuallySetKeys");const Pt="en_US";class YargsInstance{constructor(e=[],t,r,n){this.customScriptName=false;this.parsed=false;he.set(this,void 0);ge.set(this,void 0);me.set(this,{commands:[],fullCommands:[]});ye.set(this,null);Fe.set(this,null);be.set(this,"show-hidden");Ee.set(this,null);Ce.set(this,true);ve.set(this,{});we.set(this,true);Ae.set(this,[]);Oe.set(this,void 0);Se.set(this,{});Be.set(this,false);je.set(this,null);ke.set(this,true);xe.set(this,void 0);Pe.set(this,"");_e.set(this,void 0);Ie.set(this,void 0);Te.set(this,{});Ne.set(this,null);Me.set(this,null);Re.set(this,{});Ue.set(this,{});$e.set(this,void 0);Le.set(this,false);We.set(this,void 0);Ke.set(this,false);ze.set(this,false);Ge.set(this,false);He.set(this,void 0);Ve.set(this,{});Je.set(this,null);qe.set(this,void 0);de(this,We,n,"f");de(this,$e,e,"f");de(this,ge,t,"f");de(this,Ie,r,"f");de(this,Oe,new GlobalMiddleware(this),"f");this.$0=this[tt]();this[St]();de(this,he,pe(this,he,"f"),"f");de(this,He,pe(this,He,"f"),"f");de(this,qe,pe(this,qe,"f"),"f");de(this,_e,pe(this,_e,"f"),"f");pe(this,_e,"f").showHiddenOpt=pe(this,be,"f");de(this,xe,this[Xe](),"f");pe(this,We,"f").y18n.setLocale(Pt)}addHelpOpt(e,t){const r="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(pe(this,je,"f")){this[Qe](pe(this,je,"f"));de(this,je,null,"f")}if(e===false&&t===undefined)return this;de(this,je,typeof e==="string"?e:r,"f");this.boolean(pe(this,je,"f"));this.describe(pe(this,je,"f"),t||pe(this,He,"f").deferY18nLookup("Show help"));return this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){argsert("[string|boolean] [string]",[e,t],arguments.length);if(e===false&&t===undefined)return this;const r=typeof e==="string"?e:pe(this,be,"f");this.boolean(r);this.describe(r,t||pe(this,He,"f").deferY18nLookup("Show hidden options"));pe(this,_e,"f").showHiddenOpt=r;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[lt](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("<array|string>",[e],arguments.length);this[at]("array",e);this[xt](e);return this}boolean(e){argsert("<array|string>",[e],arguments.length);this[at]("boolean",e);this[xt](e);return this}check(e,t){argsert("<function> [boolean]",[e,t],arguments.length);this.middleware(((t,r)=>maybeAsyncResult((()=>e(t,r.getOptions())),(r=>{if(!r){pe(this,He,"f").fail(pe(this,We,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof r==="string"||r instanceof Error){pe(this,He,"f").fail(r.toString(),r)}return t}),(e=>{pe(this,He,"f").fail(e.message?e.message:e.toString(),e);return t}))),false,t);return this}choices(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[lt](this.choices.bind(this),"choices",e,t);return this}coerce(e,t){argsert("<object|string|array> [function]",[e,t],arguments.length);if(Array.isArray(e)){if(!t){throw new YError("coerce callback must be provided")}for(const r of e){this.coerce(r,t)}return this}else if(typeof e==="object"){for(const t of Object.keys(e)){this.coerce(t,e[t])}return this}if(!t){throw new YError("coerce callback must be provided")}const r=e;pe(this,_e,"f").key[r]=true;pe(this,Oe,"f").addCoerceMiddleware(((e,n)=>{var o;const i=(o=n.getAliases()[r])!==null&&o!==void 0?o:[];const u=[r,...i].filter((t=>Object.prototype.hasOwnProperty.call(e,t)));if(u.length===0){return e}return maybeAsyncResult((()=>t(e[u[0]])),(t=>{u.forEach((r=>{e[r]=t}));return e}),(e=>{throw new YError(e.message)}))}),r);return this}conflicts(e,t){argsert("<string|object> [string|array]",[e,t],arguments.length);pe(this,qe,"f").conflicts(e,t);return this}config(e="config",t,r){argsert("[object|string] [string|function] [function]",[e,t,r],arguments.length);if(typeof e==="object"&&!Array.isArray(e)){e=applyExtends(e,pe(this,ge,"f"),this[rt]()["deep-merge-config"]||false,pe(this,We,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){r=t;t=undefined}this.describe(e,t||pe(this,He,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{pe(this,_e,"f").config[e]=r||true}));return this}completion(e,t,r){argsert("[string] [string|boolean|function] [function]",[e,t,r],arguments.length);if(typeof t==="function"){r=t;t=undefined}de(this,Fe,e||pe(this,Fe,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(pe(this,Fe,"f"),t);if(r)pe(this,ye,"f").registerFunction(r);return this}command(e,t,r,n,o,i){argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,n,o,i],arguments.length);pe(this,he,"f").addHandler(e,t,r,n,o,i);return this}commands(e,t,r,n,o,i){return this.command(e,t,r,n,o,i)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const r=pe(this,Ie,"f")||pe(this,We,"f").require;pe(this,he,"f").addDirectory(e,r,pe(this,We,"f").getCallerFile(),t);return this}count(e){argsert("<array|string>",[e],arguments.length);this[at]("count",e);this[xt](e);return this}default(e,t,r){argsert("<object|string|array> [*] [string]",[e,t,r],arguments.length);if(r){assertSingleKey(e,pe(this,We,"f"));pe(this,_e,"f").defaultDescription[e]=r}if(typeof t==="function"){assertSingleKey(e,pe(this,We,"f"));if(!pe(this,_e,"f").defaultDescription[e])pe(this,_e,"f").defaultDescription[e]=pe(this,He,"f").functionDescription(t);t=t.call()}this[ct](this.default.bind(this),"default",e,t);return this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,n){argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,n],arguments.length);if(typeof t!=="number"){r=t;t=Infinity}this.global("_",false);pe(this,_e,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:n};return this}demand(e,t,r){if(Array.isArray(t)){t.forEach((e=>{assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandOption(e,r)}));t=Infinity}else if(typeof t!=="number"){r=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandCommand(e,t,r,r)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(r,true,pe(this,We,"f"));this.demandOption(e,r)}))}else{if(typeof r==="string"){this.demandOption(e,r)}else if(r===true||typeof r==="undefined"){this.demandOption(e)}}return this}demandOption(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[ct](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert("<string> [string|boolean]",[e,t],arguments.length);pe(this,_e,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[dt](e,true);pe(this,He,"f").describe(e,t);return this}detectLocale(e){argsert("<boolean>",[e],arguments.length);de(this,Ce,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete pe(this,_e,"f").envPrefix;else pe(this,_e,"f").envPrefix=e||"";return this}epilogue(e){argsert("<string>",[e],arguments.length);pe(this,He,"f").epilog(e);return this}epilog(e){return this.epilogue(e)}example(e,t){argsert("<string|array> [string]",[e,t],arguments.length);if(Array.isArray(e)){e.forEach((e=>this.example(...e)))}else{pe(this,He,"f").example(e,t)}return this}exit(e,t){de(this,Be,true,"f");de(this,Ee,t,"f");if(pe(this,we,"f"))pe(this,We,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);de(this,we,e,"f");return this}fail(e){argsert("<function|boolean>",[e],arguments.length);if(typeof e==="boolean"&&e!==false){throw new YError("Invalid first argument. Expected function or boolean 'false'")}pe(this,He,"f").failFn(e);return this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){argsert("<array> [function]",[e,t],arguments.length);if(!t){return new Promise(((t,r)=>{pe(this,ye,"f").getCompletion(e,((e,n)=>{if(e)r(e);else t(n)}))}))}else{return pe(this,ye,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return pe(this,_e,"f").demandedOptions}getDemandedCommands(){argsert([],0);return pe(this,_e,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return pe(this,_e,"f").deprecatedOptions}getDetectLocale(){return pe(this,Ce,"f")}getExitProcess(){return pe(this,we,"f")}getGroups(){return Object.assign({},pe(this,Se,"f"),pe(this,Ue,"f"))}getHelp(){de(this,Be,true,"f");if(!pe(this,He,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[Bt](pe(this,$e,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>pe(this,He,"f").help()))}}const e=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>pe(this,He,"f").help()))}}return Promise.resolve(pe(this,He,"f").help())}getOptions(){return pe(this,_e,"f")}getStrict(){return pe(this,Ke,"f")}getStrictCommands(){return pe(this,ze,"f")}getStrictOptions(){return pe(this,Ge,"f")}global(e,t){argsert("<string|array> [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){pe(this,_e,"f").local=pe(this,_e,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!pe(this,_e,"f").local.includes(e))pe(this,_e,"f").local.push(e)}))}return this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const r=pe(this,Ue,"f")[t]||pe(this,Se,"f")[t];if(pe(this,Ue,"f")[t]){delete pe(this,Ue,"f")[t]}const n={};pe(this,Se,"f")[t]=(r||[]).concat(e).filter((e=>{if(n[e])return false;return n[e]=true}));return this}hide(e){argsert("<string>",[e],arguments.length);pe(this,_e,"f").hiddenOptions.push(e);return this}implies(e,t){argsert("<string|object> [number|string|array]",[e,t],arguments.length);pe(this,qe,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[ot]();return pe(this,We,"f").y18n.getLocale()}de(this,Ce,false,"f");pe(this,We,"f").y18n.setLocale(e);return this}middleware(e,t,r){return pe(this,Oe,"f").addMiddleware(e,!!t,r)}nargs(e,t){argsert("<string|object|array> [number]",[e,t],arguments.length);this[ct](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("<array|string>",[e],arguments.length);this[at]("normalize",e);return this}number(e){argsert("<array|string>",[e],arguments.length);this[at]("number",e);this[xt](e);return this}option(e,t){argsert("<string|object> [object]",[e,t],arguments.length);if(typeof e==="object"){Object.keys(e).forEach((t=>{this.options(t,e[t])}))}else{if(typeof t!=="object"){t={}}this[xt](e);if(pe(this,Je,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[Ze](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),undefined,"versionWarning")}pe(this,_e,"f").key[e]=true;if(t.alias)this.alias(e,t.alias);const r=t.deprecate||t.deprecated;if(r){this.deprecateOption(e,r)}const n=t.demand||t.required||t.require;if(n){this.demand(e,n)}if(t.demandOption){this.demandOption(e,typeof t.demandOption==="string"?t.demandOption:undefined)}if(t.conflicts){this.conflicts(e,t.conflicts)}if("default"in t){this.default(e,t.default)}if(t.implies!==undefined){this.implies(e,t.implies)}if(t.nargs!==undefined){this.nargs(e,t.nargs)}if(t.config){this.config(e,t.configParser)}if(t.normalize){this.normalize(e)}if(t.choices){this.choices(e,t.choices)}if(t.coerce){this.coerce(e,t.coerce)}if(t.group){this.group(e,t.group)}if(t.boolean||t.type==="boolean"){this.boolean(e);if(t.alias)this.boolean(t.alias)}if(t.array||t.type==="array"){this.array(e);if(t.alias)this.array(t.alias)}if(t.number||t.type==="number"){this.number(e);if(t.alias)this.number(t.alias)}if(t.string||t.type==="string"){this.string(e);if(t.alias)this.string(t.alias)}if(t.count||t.type==="count"){this.count(e)}if(typeof t.global==="boolean"){this.global(e,t.global)}if(t.defaultDescription){pe(this,_e,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const o=t.describe||t.description||t.desc;const i=pe(this,He,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(i,e)||typeof o==="string"){this.describe(e,o)}if(t.hidden){this.hide(e)}if(t.requiresArg){this.requiresArg(e)}}return this}options(e,t){return this.option(e,t)}parse(e,t,r){argsert("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length);this[et]();if(typeof e==="undefined"){e=pe(this,$e,"f")}if(typeof t==="object"){de(this,Me,t,"f");t=r}if(typeof t==="function"){de(this,Ne,t,"f");t=false}if(!t)de(this,$e,e,"f");if(pe(this,Ne,"f"))de(this,we,false,"f");const n=this[Bt](e,!!t);const o=this.parsed;pe(this,ye,"f").setParsed(this.parsed);if(isPromise(n)){return n.then((e=>{if(pe(this,Ne,"f"))pe(this,Ne,"f").call(this,pe(this,Ee,"f"),e,pe(this,Pe,"f"));return e})).catch((e=>{if(pe(this,Ne,"f")){pe(this,Ne,"f")(e,this.parsed.argv,pe(this,Pe,"f"))}throw e})).finally((()=>{this[pt]();this.parsed=o}))}else{if(pe(this,Ne,"f"))pe(this,Ne,"f").call(this,pe(this,Ee,"f"),n,pe(this,Pe,"f"));this[pt]();this.parsed=o}return n}parseAsync(e,t,r){const n=this.parse(e,t,r);return!isPromise(n)?Promise.resolve(n):n}parseSync(e,t,r){const n=this.parse(e,t,r);if(isPromise(n)){throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware")}return n}parserConfiguration(e){argsert("<object>",[e],arguments.length);de(this,Te,e,"f");return this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let r=null;const n=this[st](t||pe(this,ge,"f"));if(n[e]&&typeof n[e]==="object"){r=applyExtends(n[e],t||pe(this,ge,"f"),this[rt]()["deep-merge-config"]||false,pe(this,We,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(r)}return this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,((e,t)=>{if(e==="type"&&!["string","number","boolean"].includes(t))return false;return r.includes(e)}));const n=pe(this,me,"f").fullCommands[pe(this,me,"f").fullCommands.length-1];const o=n?pe(this,he,"f").cmdToParseOptions(n):{array:[],alias:{},default:{},demand:{}};objectKeys(o).forEach((r=>{const n=o[r];if(Array.isArray(n)){if(n.indexOf(e)!==-1)t[r]=true}else{if(n[e]&&!(r in t))t[r]=n[e]}}));this.group(e,pe(this,He,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);de(this,Le,e,"f");return this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){argsert("<array|string|object> [number]",[e],arguments.length);if(typeof e==="string"&&pe(this,_e,"f").narg[e]){return this}else{this[ct](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;pe(this,xe,"f").log(pe(this,ye,"f").generateCompletionScript(e,t||pe(this,Fe,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);de(this,Be,true,"f");if(!pe(this,He,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[Bt](pe(this,$e,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{pe(this,He,"f").showHelp(e)}));return this}}const t=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{pe(this,He,"f").showHelp(e)}));return this}}pe(this,He,"f").showHelp(e);return this}scriptName(e){this.customScriptName=true;this.$0=e;return this}showHelpOnFail(e,t){argsert("[boolean|string] [string]",[e,t],arguments.length);pe(this,He,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);pe(this,He,"f").showVersion(e);return this}skipValidation(e){argsert("<array|string>",[e],arguments.length);this[at]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);de(this,Ke,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);de(this,ze,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);de(this,Ge,e!==false,"f");return this}string(e){argsert("<array|string>",[e],arguments.length);this[at]("string",e);this[xt](e);return this}terminalWidth(){argsert([],0);return pe(this,We,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("<object>",[e],arguments.length);de(this,Ce,false,"f");pe(this,We,"f").y18n.updateLocale(e);return this}usage(e,t,r,n){argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,n],arguments.length);if(t!==undefined){assertNotStrictEqual(e,null,pe(this,We,"f"));if((e||"").match(/^\$0( |$)/)){return this.command(e,t,r,n)}else{throw new YError(".usage() description must start with $0 if being used as alias for .command()")}}else{pe(this,He,"f").usage(e);return this}}usageConfiguration(e){argsert("<object>",[e],arguments.length);de(this,Ve,e,"f");return this}version(e,t,r){const n="version";argsert("[boolean|string] [string] [string]",[e,t,r],arguments.length);if(pe(this,Je,"f")){this[Qe](pe(this,Je,"f"));pe(this,He,"f").version(undefined);de(this,Je,null,"f")}if(arguments.length===0){r=this[it]();e=n}else if(arguments.length===1){if(e===false){return this}r=e;e=n}else if(arguments.length===2){r=t;t=undefined}de(this,Je,typeof e==="string"?e:n,"f");t=t||pe(this,He,"f").deferY18nLookup("Show version number");pe(this,He,"f").version(r||undefined);this.boolean(pe(this,Je,"f"));this.describe(pe(this,Je,"f"),t);return this}wrap(e){argsert("<number|null|undefined>",[e],arguments.length);pe(this,He,"f").wrap(e);return this}[(he=new WeakMap,ge=new WeakMap,me=new WeakMap,ye=new WeakMap,Fe=new WeakMap,be=new WeakMap,Ee=new WeakMap,Ce=new WeakMap,ve=new WeakMap,we=new WeakMap,Ae=new WeakMap,Oe=new WeakMap,Se=new WeakMap,Be=new WeakMap,je=new WeakMap,ke=new WeakMap,xe=new WeakMap,Pe=new WeakMap,_e=new WeakMap,Ie=new WeakMap,Te=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Re=new WeakMap,Ue=new WeakMap,$e=new WeakMap,Le=new WeakMap,We=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,Je=new WeakMap,qe=new WeakMap,Ye)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[Xe](){return{log:(...e)=>{if(!this[vt]())console.log(...e);de(this,Be,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[vt]())console.error(...e);de(this,Be,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")}}}[Qe](e){objectKeys(pe(this,_e,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const r=pe(this,_e,"f")[t];if(Array.isArray(r)){if(r.includes(e))r.splice(r.indexOf(e),1)}else if(typeof r==="object"){delete r[e]}}));delete pe(this,He,"f").getDescriptions()[e]}[Ze](e,t,r){if(!pe(this,ve,"f")[r]){pe(this,We,"f").process.emitWarning(e,t);pe(this,ve,"f")[r]=true}}[et](){pe(this,Ae,"f").push({options:pe(this,_e,"f"),configObjects:pe(this,_e,"f").configObjects.slice(0),exitProcess:pe(this,we,"f"),groups:pe(this,Se,"f"),strict:pe(this,Ke,"f"),strictCommands:pe(this,ze,"f"),strictOptions:pe(this,Ge,"f"),completionCommand:pe(this,Fe,"f"),output:pe(this,Pe,"f"),exitError:pe(this,Ee,"f"),hasOutput:pe(this,Be,"f"),parsed:this.parsed,parseFn:pe(this,Ne,"f"),parseContext:pe(this,Me,"f")});pe(this,He,"f").freeze();pe(this,qe,"f").freeze();pe(this,he,"f").freeze();pe(this,Oe,"f").freeze()}[tt](){let e="";let t;if(/\b(node|iojs|electron)(\.exe)?$/.test(pe(this,We,"f").process.argv()[0])){t=pe(this,We,"f").process.argv().slice(1,2)}else{t=pe(this,We,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[Ot](pe(this,ge,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e})).join(" ").trim();if(pe(this,We,"f").getEnv("_")&&pe(this,We,"f").getProcessArgvBin()===pe(this,We,"f").getEnv("_")){e=pe(this,We,"f").getEnv("_").replace(`${pe(this,We,"f").path.dirname(pe(this,We,"f").process.execPath())}/`,"")}return e}[rt](){return pe(this,Te,"f")}[nt](){return pe(this,Ve,"f")}[ot](){if(!pe(this,Ce,"f"))return;const e=pe(this,We,"f").getEnv("LC_ALL")||pe(this,We,"f").getEnv("LC_MESSAGES")||pe(this,We,"f").getEnv("LANG")||pe(this,We,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[it](){const e=this[st]();return e.version||"unknown"}[ut](e){const t=e["--"]?e["--"]:e._;for(let e=0,r;(r=t[e])!==undefined;e++){if(pe(this,We,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))){t[e]=Number(r)}}return e}[st](e){const t=e||"*";if(pe(this,Re,"f")[t])return pe(this,Re,"f")[t];let r={};try{let t=e||pe(this,We,"f").mainFilename;if(pe(this,We,"f").path.extname(t)){t=pe(this,We,"f").path.dirname(t)}const n=pe(this,We,"f").findUp(t,((e,t)=>{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(n,undefined,pe(this,We,"f"));r=JSON.parse(pe(this,We,"f").readFileSync(n,"utf8"))}catch(e){}pe(this,Re,"f")[t]=r||{};return pe(this,Re,"f")[t]}[at](e,t){t=[].concat(t);t.forEach((t=>{t=this[ft](t);pe(this,_e,"f")[e].push(t)}))}[ct](e,t,r,n){this[Dt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=r}))}[lt](e,t,r,n){this[Dt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=(pe(this,_e,"f")[e][t]||[]).concat(r)}))}[Dt](e,t,r,n,o){if(Array.isArray(r)){r.forEach((t=>{e(t,n)}))}else if((e=>typeof e==="object")(r)){for(const t of objectKeys(r)){e(t,r[t])}}else{o(t,this[ft](r),n)}}[ft](e){if(e==="__proto__")return"___proto___";return e}[dt](e,t){this[ct](this[dt].bind(this),"key",e,t);return this}[pt](){var e,t,r,n,o,i,u,s,a,c,l,D;const f=pe(this,Ae,"f").pop();assertNotStrictEqual(f,undefined,pe(this,We,"f"));let d;e=this,t=this,r=this,n=this,o=this,i=this,u=this,s=this,a=this,c=this,l=this,D=this,({options:{set value(t){de(e,_e,t,"f")}}.value,configObjects:d,exitProcess:{set value(e){de(t,we,e,"f")}}.value,groups:{set value(e){de(r,Se,e,"f")}}.value,output:{set value(e){de(n,Pe,e,"f")}}.value,exitError:{set value(e){de(o,Ee,e,"f")}}.value,hasOutput:{set value(e){de(i,Be,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){de(u,Ke,e,"f")}}.value,strictCommands:{set value(e){de(s,ze,e,"f")}}.value,strictOptions:{set value(e){de(a,Ge,e,"f")}}.value,completionCommand:{set value(e){de(c,Fe,e,"f")}}.value,parseFn:{set value(e){de(l,Ne,e,"f")}}.value,parseContext:{set value(e){de(D,Me,e,"f")}}.value}=f);pe(this,_e,"f").configObjects=d;pe(this,He,"f").unfreeze();pe(this,qe,"f").unfreeze();pe(this,he,"f").unfreeze();pe(this,Oe,"f").unfreeze()}[ht](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[gt].bind(this),getContext:this[mt].bind(this),getHasOutput:this[yt].bind(this),getLoggerInstance:this[Ft].bind(this),getParseContext:this[bt].bind(this),getParserConfiguration:this[rt].bind(this),getUsageConfiguration:this[nt].bind(this),getUsageInstance:this[Et].bind(this),getValidationInstance:this[Ct].bind(this),hasParseCallback:this[vt].bind(this),isGlobalContext:this[wt].bind(this),postProcess:this[At].bind(this),reset:this[St].bind(this),runValidation:this[jt].bind(this),runYargsParserAndExecuteCommands:this[Bt].bind(this),setHasOutput:this[kt].bind(this)}}[gt](){return pe(this,he,"f")}[mt](){return pe(this,me,"f")}[yt](){return pe(this,Be,"f")}[Ft](){return pe(this,xe,"f")}[bt](){return pe(this,Me,"f")||{}}[Et](){return pe(this,He,"f")}[Ct](){return pe(this,qe,"f")}[vt](){return!!pe(this,Ne,"f")}[wt](){return pe(this,ke,"f")}[At](e,t,r,n){if(r)return e;if(isPromise(e))return e;if(!t){e=this[Ye](e)}const o=this[rt]()["parse-positional-numbers"]||this[rt]()["parse-positional-numbers"]===undefined;if(o){e=this[ut](e)}if(n){e=applyMiddleware(e,this,pe(this,Oe,"f").getMiddleware(),false)}return e}[St](e={}){de(this,_e,pe(this,_e,"f")||{},"f");const t={};t.local=pe(this,_e,"f").local||[];t.configObjects=pe(this,_e,"f").configObjects||[];const r={};t.local.forEach((t=>{r[t]=true;(e[t]||[]).forEach((e=>{r[e]=true}))}));Object.assign(pe(this,Ue,"f"),Object.keys(pe(this,Se,"f")).reduce(((e,t)=>{const n=pe(this,Se,"f")[t].filter((e=>!(e in r)));if(n.length>0){e[t]=n}return e}),{}));de(this,Se,{},"f");const n=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"];const o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];n.forEach((e=>{t[e]=(pe(this,_e,"f")[e]||[]).filter((e=>!r[e]))}));o.forEach((e=>{t[e]=objFilter(pe(this,_e,"f")[e],(e=>!r[e]))}));t.envPrefix=pe(this,_e,"f").envPrefix;de(this,_e,t,"f");de(this,He,pe(this,He,"f")?pe(this,He,"f").reset(r):usage(this,pe(this,We,"f")),"f");de(this,qe,pe(this,qe,"f")?pe(this,qe,"f").reset(r):validation(this,pe(this,He,"f"),pe(this,We,"f")),"f");de(this,he,pe(this,he,"f")?pe(this,he,"f").reset():command(pe(this,He,"f"),pe(this,qe,"f"),pe(this,Oe,"f"),pe(this,We,"f")),"f");if(!pe(this,ye,"f"))de(this,ye,completion(this,pe(this,He,"f"),pe(this,he,"f"),pe(this,We,"f")),"f");pe(this,Oe,"f").reset();de(this,Fe,null,"f");de(this,Pe,"","f");de(this,Ee,null,"f");de(this,Be,false,"f");this.parsed=false;return this}[Ot](e,t){return pe(this,We,"f").path.relative(e,t)}[Bt](e,t,r,n=0,o=false){var i,u,s,a;let c=!!r||o;e=e||pe(this,$e,"f");pe(this,_e,"f").__=pe(this,We,"f").y18n.__;pe(this,_e,"f").configuration=this[rt]();const l=!!pe(this,_e,"f").configuration["populate--"];const D=Object.assign({},pe(this,_e,"f").configuration,{"populate--":true});const f=pe(this,We,"f").Parser.detailed(e,Object.assign({},pe(this,_e,"f"),{configuration:{"parse-positional-numbers":false,...D}}));const d=Object.assign(f.argv,pe(this,Me,"f"));let p=undefined;const h=f.aliases;let g=false;let m=false;Object.keys(d).forEach((e=>{if(e===pe(this,je,"f")&&d[e]){g=true}else if(e===pe(this,Je,"f")&&d[e]){m=true}}));d.$0=this.$0;this.parsed=f;if(n===0){pe(this,He,"f").clearCachedHelpMessage()}try{this[ot]();if(t){return this[At](d,l,!!r,false)}if(pe(this,je,"f")){const e=[pe(this,je,"f")].concat(h[pe(this,je,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+d._[d._.length-1])){d._.pop();g=true}}de(this,ke,false,"f");const D=pe(this,he,"f").getCommands();const y=((i=pe(this,ye,"f"))===null||i===void 0?void 0:i.completionKey)?[(u=pe(this,ye,"f"))===null||u===void 0?void 0:u.completionKey,...(a=this.getAliases()[(s=pe(this,ye,"f"))===null||s===void 0?void 0:s.completionKey])!==null&&a!==void 0?a:[]].some((e=>Object.prototype.hasOwnProperty.call(d,e))):false;const F=g||y||o;if(d._.length){if(D.length){let e;for(let t=n||0,i;d._[t]!==undefined;t++){i=String(d._[t]);if(D.includes(i)&&i!==pe(this,Fe,"f")){const e=pe(this,he,"f").runCommand(i,this,f,t+1,o,g||m||o);return this[At](e,l,!!r,false)}else if(!e&&i!==pe(this,Fe,"f")){e=i;break}}if(!pe(this,he,"f").hasDefaultCommand()&&pe(this,Le,"f")&&e&&!F){pe(this,qe,"f").recommendCommands(e,D)}}if(pe(this,Fe,"f")&&d._.includes(pe(this,Fe,"f"))&&!y){if(pe(this,we,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(pe(this,he,"f").hasDefaultCommand()&&!F){const e=pe(this,he,"f").runCommand(null,this,f,0,o,g||m||o);return this[At](e,l,!!r,false)}if(y){if(pe(this,we,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${pe(this,ye,"f").completionKey}`)+1);pe(this,ye,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{pe(this,xe,"f").log(e)}));this.exit(0)}));return this[At](d,!l,!!r,false)}if(!pe(this,Be,"f")){if(g){if(pe(this,we,"f"))setBlocking(true);c=true;this.showHelp((e=>{pe(this,xe,"f").log(e);this.exit(0)}))}else if(m){if(pe(this,we,"f"))setBlocking(true);c=true;pe(this,He,"f").showVersion("log");this.exit(0)}}if(!c&&pe(this,_e,"f").skipValidation.length>0){c=Object.keys(d).some((e=>pe(this,_e,"f").skipValidation.indexOf(e)>=0&&d[e]===true))}if(!c){if(f.error)throw new YError(f.error.message);if(!y){const e=this[jt](h,{},f.error);if(!r){p=applyMiddleware(d,this,pe(this,Oe,"f").getMiddleware(),true)}p=this[ht](e,p!==null&&p!==void 0?p:d);if(isPromise(p)&&!r){p=p.then((()=>applyMiddleware(d,this,pe(this,Oe,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)pe(this,He,"f").fail(e.message,e);else throw e}return this[At](p!==null&&p!==void 0?p:d,l,!!r,true)}[jt](e,t,r,n){const o={...this.getDemandedOptions()};return i=>{if(r)throw new YError(r.message);pe(this,qe,"f").nonOptionCount(i);pe(this,qe,"f").requiredArguments(i,o);let u=false;if(pe(this,ze,"f")){u=pe(this,qe,"f").unknownCommands(i)}if(pe(this,Ke,"f")&&!u){pe(this,qe,"f").unknownArguments(i,e,t,!!n)}else if(pe(this,Ge,"f")){pe(this,qe,"f").unknownArguments(i,e,{},false,false)}pe(this,qe,"f").limitedChoices(i);pe(this,qe,"f").implications(i);pe(this,qe,"f").conflicting(i)}}[kt](){de(this,Be,true,"f")}[xt](e){if(typeof e==="string"){pe(this,_e,"f").key[e]=true}else{for(const t of e){pe(this,_e,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const _t=YargsFactory(ie);const It=_t}};var r={};function __nccwpck_require__(e){var n=r[e];if(n!==undefined){return n.exports}var o=r[e]={exports:{}};var i=true;try{t[e](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete r[e]}return o.exports}(()=>{var e=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var t=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var r=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=e=>{if(e&&e.d<1){e.d=1;e.forEach((e=>e.r--));e.forEach((e=>e.r--?e.r++:e()))}};var wrapDeps=n=>n.map((n=>{if(n!==null&&typeof n==="object"){if(n[e])return n;if(n.then){var o=[];o.d=0;n.then((e=>{i[t]=e;resolveQueue(o)}),(e=>{i[r]=e;resolveQueue(o)}));var i={};i[e]=e=>e(o);return i}}var u={};u[e]=e=>{};u[t]=n;return u}));__nccwpck_require__.a=(n,o,i)=>{var u;i&&((u=[]).d=-1);var s=new Set;var a=n.exports;var c;var l;var D;var f=new Promise(((e,t)=>{D=t;l=e}));f[t]=a;f[e]=e=>(u&&e(u),s.forEach(e),f["catch"]((e=>{})));n.exports=f;o((n=>{c=wrapDeps(n);var o;var getResult=()=>c.map((e=>{if(e[r])throw e[r];return e[t]}));var i=new Promise((t=>{o=()=>t(getResult);o.r=0;var fnQueue=e=>e!==u&&!s.has(e)&&(s.add(e),e&&!e.d&&(o.r++,e.push(o)));c.map((t=>t[e](fnQueue)))}));return o.r?i:getResult()}),(e=>(e?D(f[r]=e):l(a),resolveQueue(u))));u&&u.d<0&&(u.d=0)}})();(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var n=__nccwpck_require__(1719);n=await n;
|
|
34
|
+
var L,$,W;const K=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):20;const z=($=(L=process===null||process===void 0?void 0:process.versions)===null||L===void 0?void 0:L.node)!==null&&$!==void 0?$:(W=process===null||process===void 0?void 0:process.version)===null||W===void 0?void 0:W.slice(1);if(z){const e=Number(z.match(/^([^.]+)/)[1]);if(e<K){throw Error(`yargs parser supports a minimum Node.js version of ${K}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}}const G=process?process.env:{};const H=U.createRequire?(0,U.createRequire)(import.meta.url):undefined;const V=new YargsParser({cwd:process.cwd,env:()=>G,format:T.format,normalize:I.normalize,resolve:I.resolve,require:e=>{if(typeof H!=="undefined"){return H(e)}else if(e.match(/\.json$/)){return JSON.parse((0,B.readFileSync)(e,"utf8"))}else{throw Error("only .json config files are supported in ESM")}}});const J=function Parser(e,t){const r=V.parse(e.slice(),t);return r.argv};J.detailed=function(e,t){return V.parse(e.slice(),t)};J.camelCase=camelCase;J.decamelize=decamelize;J.looksLikeNumber=looksLikeNumber;const q=J;function getProcessArgvBinIndex(){if(isBundledElectronApp())return 0;return 1}function isBundledElectronApp(){return isElectronApp()&&!process.defaultApp}function isElectronApp(){return!!process.versions.electron}function hideBin(e){return e.slice(getProcessArgvBinIndex()+1)}function getProcessArgvBin(){return process.argv[getProcessArgvBinIndex()]}const Y={fs:{readFileSync:B.readFileSync,writeFile:B.writeFile},format:T.format,resolve:I.resolve,exists:e=>{try{return(0,B.statSync)(e).isFile()}catch(e){return false}}};let X;class Y18N{constructor(e){e=e||{};this.directory=e.directory||"./locales";this.updateFiles=typeof e.updateFiles==="boolean"?e.updateFiles:true;this.locale=e.locale||"en";this.fallbackToLanguage=typeof e.fallbackToLanguage==="boolean"?e.fallbackToLanguage:true;this.cache=Object.create(null);this.writeQueue=[]}__(...e){if(typeof arguments[0]!=="string"){return this._taggedLiteral(arguments[0],...arguments)}const t=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();cb=cb||function(){};if(!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]=t;this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}return X.format.apply(X.format,[this.cache[this.locale][t]||t].concat(e))}__n(){const e=Array.prototype.slice.call(arguments);const t=e.shift();const r=e.shift();const n=e.shift();let cb=function(){};if(typeof e[e.length-1]==="function")cb=e.pop();if(!this.cache[this.locale])this._readLocaleFile();let o=n===1?t:r;if(this.cache[this.locale][t]){const e=this.cache[this.locale][t];o=e[n===1?"one":"other"]}if(!this.cache[this.locale][t]&&this.updateFiles){this.cache[this.locale][t]={one:t,other:r};this._enqueueWrite({directory:this.directory,locale:this.locale,cb:cb})}else{cb()}const i=[o];if(~o.indexOf("%d"))i.push(n);return X.format.apply(X.format,i.concat(e))}setLocale(e){this.locale=e}getLocale(){return this.locale}updateLocale(e){if(!this.cache[this.locale])this._readLocaleFile();for(const t in e){if(Object.prototype.hasOwnProperty.call(e,t)){this.cache[this.locale][t]=e[t]}}}_taggedLiteral(e,...t){let r="";e.forEach((function(e,n){const o=t[n+1];r+=e;if(typeof o!=="undefined"){r+="%s"}}));return this.__.apply(this,[r].concat([].slice.call(t,1)))}_enqueueWrite(e){this.writeQueue.push(e);if(this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){const e=this;const t=this.writeQueue[0];const r=t.directory;const n=t.locale;const o=t.cb;const i=this._resolveLocaleFile(r,n);const s=JSON.stringify(this.cache[n],null,2);X.fs.writeFile(i,s,"utf-8",(function(t){e.writeQueue.shift();if(e.writeQueue.length>0)e._processWriteQueue();o(t)}))}_readLocaleFile(){let e={};const t=this._resolveLocaleFile(this.directory,this.locale);try{if(X.fs.readFileSync){e=JSON.parse(X.fs.readFileSync(t,"utf-8"))}}catch(r){if(r instanceof SyntaxError){r.message="syntax error in "+t}if(r.code==="ENOENT")e={};else throw r}this.cache[this.locale]=e}_resolveLocaleFile(e,t){let r=X.resolve(e,"./",t+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(r)&&~t.lastIndexOf("_")){const n=X.resolve(e,"./",t.split("_")[0]+".json");if(this._fileExistsSync(n))r=n}return r}_fileExistsSync(e){return X.exists(e)}}function y18n(e,t){X=t;const r=new Y18N(e);return{__:r.__.bind(r),__n:r.__n.bind(r),setLocale:r.setLocale.bind(r),getLocale:r.getLocale.bind(r),updateLocale:r.updateLocale.bind(r),locale:r.locale}}const y18n_y18n=e=>y18n(e,Y);const Q=y18n_y18n;var Z=n(103);const ee=e(import.meta.url)("node:fs");const te=(0,N.fileURLToPath)(import.meta.url);const re=te.substring(0,te.lastIndexOf("node_modules"));const ne=(0,U.createRequire)(import.meta.url);const oe={assert:{notStrictEqual:o.notStrictEqual,strictEqual:o.strictEqual},cliui:ui,findUp:sync,getEnv:e=>process.env[e],inspect:T.inspect,getProcessArgvBin:getProcessArgvBin,mainFilename:re||process.cwd(),Parser:q,path:{basename:I.basename,dirname:I.dirname,extname:I.extname,relative:I.relative,resolve:I.resolve,join:I.join},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(e,t)=>process.emitWarning(e,t),execPath:()=>process.execPath,exit:e=>{process.exit(e)},nextTick:process.nextTick,stdColumns:typeof process.stdout.columns!=="undefined"?process.stdout.columns:null},readFileSync:ee.readFileSync,readdirSync:ee.readdirSync,require:ne,getCallerFile:()=>{const e=Z(3);return e.match(/^file:\/\//)?(0,N.fileURLToPath)(e):e},stringWidth:stringWidth,y18n:Q({directory:(0,I.resolve)(te,"../../../locales"),updateFiles:false})};function assertNotStrictEqual(e,t,r,n){r.assert.notStrictEqual(e,t,n)}function assertSingleKey(e,t){t.assert.strictEqual(typeof e,"string")}function objectKeys(e){return Object.keys(e)}function isPromise(e){return!!e&&!!e.then&&typeof e.then==="function"}class YError extends Error{constructor(e){super(e||"yargs error");this.name="YError";if(Error.captureStackTrace){Error.captureStackTrace(this,YError)}}}function parseCommand(e){const t=e.replace(/\s{2,}/g," ");const r=t.split(/\s+(?![^[]*]|[^<]*>)/);const n=/\.*[\][<>]/g;const o=r.shift();if(!o)throw new Error(`No command found in: ${e}`);const i={cmd:o.replace(n,""),demanded:[],optional:[]};r.forEach(((e,t)=>{let o=false;e=e.replace(/\s/g,"");if(/\.+[\]>]/.test(e)&&t===r.length-1)o=true;if(/^\[/.test(e)){i.optional.push({cmd:e.replace(n,"").split("|"),variadic:o})}else{i.demanded.push({cmd:e.replace(n,"").split("|"),variadic:o})}}));return i}const ie=["first","second","third","fourth","fifth","sixth"];function argsert(e,t,r){function parseArgs(){return typeof e==="object"?[{demanded:[],optional:[]},e,t]:[parseCommand(`cmd ${e}`),t,r]}try{let e=0;const[t,r,n]=parseArgs();const o=[].slice.call(r);while(o.length&&o[o.length-1]===undefined)o.pop();const i=n||o.length;if(i<t.demanded.length){throw new YError(`Not enough arguments provided. Expected ${t.demanded.length} but received ${o.length}.`)}const s=t.demanded.length+t.optional.length;if(i>s){throw new YError(`Too many arguments provided. Expected max ${s} but received ${i}.`)}t.demanded.forEach((t=>{const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}));t.optional.forEach((t=>{if(o.length===0)return;const r=o.shift();const n=guessType(r);const i=t.cmd.filter((e=>e===n||e==="*"));if(i.length===0)argumentTypeError(n,t.cmd,e);e+=1}))}catch(e){console.warn(e.stack)}}function guessType(e){if(Array.isArray(e)){return"array"}else if(e===null){return"null"}return typeof e}function argumentTypeError(e,t,r){throw new YError(`Invalid ${ie[r]||"manyith"} argument. Expected ${t.join(" or ")} but received ${e}.`)}class GlobalMiddleware{constructor(e){this.globalMiddleware=[];this.frozens=[];this.yargs=e}addMiddleware(e,t,r=true,n=false){argsert("<array|function> [boolean] [boolean] [boolean]",[e,t,r],arguments.length);if(Array.isArray(e)){for(let n=0;n<e.length;n++){if(typeof e[n]!=="function"){throw Error("middleware must be a function")}const o=e[n];o.applyBeforeValidation=t;o.global=r}Array.prototype.push.apply(this.globalMiddleware,e)}else if(typeof e==="function"){const o=e;o.applyBeforeValidation=t;o.global=r;o.mutates=n;this.globalMiddleware.push(e)}return this.yargs}addCoerceMiddleware(e,t){const r=this.yargs.getAliases();this.globalMiddleware=this.globalMiddleware.filter((e=>{const n=[...r[t]||[],t];if(!e.option)return true;else return!n.includes(e.option)}));e.option=t;return this.addMiddleware(e,true,true,true)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const e=this.frozens.pop();if(e!==undefined)this.globalMiddleware=e}reset(){this.globalMiddleware=this.globalMiddleware.filter((e=>e.global))}}function commandMiddlewareFactory(e){if(!e)return[];return e.map((e=>{e.applyBeforeValidation=false;return e}))}function applyMiddleware(e,t,r,n){return r.reduce(((e,r)=>{if(r.applyBeforeValidation!==n){return e}if(r.mutates){if(r.applied)return e;r.applied=true}if(isPromise(e)){return e.then((e=>Promise.all([e,r(e,t)]))).then((([e,t])=>Object.assign(e,t)))}else{const n=r(e,t);return isPromise(n)?n.then((t=>Object.assign(e,t))):Object.assign(e,n)}}),e)}function maybeAsyncResult(e,t,r=e=>{throw e}){try{const r=isFunction(e)?e():e;return isPromise(r)?r.then((e=>t(e))):t(r)}catch(e){return r(e)}}function isFunction(e){return typeof e==="function"}const se=/(^\*)|(^\$0)/;class CommandInstance{constructor(e,t,r,n){this.requireCache=new Set;this.handlers={};this.aliasMap={};this.frozens=[];this.shim=n;this.usage=e;this.globalMiddleware=r;this.validation=t}addDirectory(e,t,r,n){n=n||{};this.requireCache.add(r);const o=this.shim.path.resolve(this.shim.path.dirname(r),e);const i=this.shim.readdirSync(o,{recursive:n.recurse?true:false});if(!Array.isArray(n.extensions))n.extensions=["js"];const s=typeof n.visit==="function"?n.visit:e=>e;for(const e of i){const r=e.toString();if(n.exclude){let e=false;if(typeof n.exclude==="function"){e=n.exclude(r)}else{e=n.exclude.test(r)}if(e)continue}if(n.include){let e=false;if(typeof n.include==="function"){e=n.include(r)}else{e=n.include.test(r)}if(!e)continue}let i=false;for(const e of n.extensions){if(r.endsWith(e))i=true}if(i){const e=this.shim.path.join(o,r);const n=t(e);const i=Object.create(null,Object.getOwnPropertyDescriptors({...n}));const a=s(i,e,r);if(a){if(this.requireCache.has(e))continue;else this.requireCache.add(e);if(!i.command){i.command=this.shim.path.basename(e,this.shim.path.extname(e))}this.addHandler(i)}}}}addHandler(e,t,r,n,o,i){let s=[];const a=commandMiddlewareFactory(o);n=n||(()=>{});if(Array.isArray(e)){if(isCommandAndAliases(e)){[e,...s]=e}else{for(const t of e){this.addHandler(t)}}}else if(isCommandHandlerDefinition(e)){let t=Array.isArray(e.command)||typeof e.command==="string"?e.command:null;if(t===null){throw new Error(`No command name given for module: ${this.shim.inspect(e)}`)}if(e.aliases)t=[].concat(t).concat(e.aliases);this.addHandler(t,this.extractDesc(e),e.builder,e.handler,e.middlewares,e.deprecated);return}else if(isCommandBuilderDefinition(r)){this.addHandler([e].concat(s),t,r.builder,r.handler,r.middlewares,r.deprecated);return}if(typeof e==="string"){const o=parseCommand(e);s=s.map((e=>parseCommand(e).cmd));let u=false;const c=[o.cmd].concat(s).filter((e=>{if(se.test(e)){u=true;return false}return true}));if(c.length===0&&u)c.push("$0");if(u){o.cmd=c[0];s=c.slice(1);e=e.replace(se,o.cmd)}s.forEach((e=>{this.aliasMap[e]=o.cmd}));if(t!==false){this.usage.command(e,t,u,s,i)}this.handlers[o.cmd]={original:e,description:t,handler:n,builder:r||{},middlewares:a,deprecated:i,demanded:o.demanded,optional:o.optional};if(u)this.defaultCommand=this.handlers[o.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(e,t,r,n,o,i){const s=this.handlers[e]||this.handlers[this.aliasMap[e]]||this.defaultCommand;const a=t.getInternalMethods().getContext();const u=a.commands.slice();const c=!e;if(e){a.commands.push(e);a.fullCommands.push(s.original)}const l=this.applyBuilderUpdateUsageAndParse(c,s,t,r.aliases,u,n,o,i);return isPromise(l)?l.then((e=>this.applyMiddlewareAndGetResult(c,s,e.innerArgv,a,o,e.aliases,t))):this.applyMiddlewareAndGetResult(c,s,l.innerArgv,a,o,l.aliases,t)}applyBuilderUpdateUsageAndParse(e,t,r,n,o,i,s,a){const u=t.builder;let c=r;if(isCommandBuilderCallback(u)){r.getInternalMethods().getUsageInstance().freeze();const l=u(r.getInternalMethods().reset(n),a);if(isPromise(l)){return l.then((n=>{c=isYargsInstance(n)?n:r;return this.parseAndUpdateUsage(e,t,c,o,i,s)}))}}else if(isCommandBuilderOptionDefinitions(u)){r.getInternalMethods().getUsageInstance().freeze();c=r.getInternalMethods().reset(n);Object.keys(t.builder).forEach((e=>{c.option(e,u[e])}))}return this.parseAndUpdateUsage(e,t,c,o,i,s)}parseAndUpdateUsage(e,t,r,n,o,i){if(e)r.getInternalMethods().getUsageInstance().unfreeze(true);if(this.shouldUpdateUsage(r)){r.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(n,t),t.description)}const s=r.getInternalMethods().runYargsParserAndExecuteCommands(null,undefined,true,o,i);return isPromise(s)?s.then((e=>({aliases:r.parsed.aliases,innerArgv:e}))):{aliases:r.parsed.aliases,innerArgv:s}}shouldUpdateUsage(e){return!e.getInternalMethods().getUsageInstance().getUsageDisabled()&&e.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler(e,t){const r=se.test(t.original)?t.original.replace(se,"").trim():t.original;const n=e.filter((e=>!se.test(e)));n.push(r);return`$0 ${n.join(" ")}`}handleValidationAndGetResult(e,t,r,n,o,i,s,a){if(!i.getInternalMethods().getHasOutput()){const t=i.getInternalMethods().runValidation(o,a,i.parsed.error,e);r=maybeAsyncResult(r,(e=>{t(e);return e}))}if(t.handler&&!i.getInternalMethods().getHasOutput()){i.getInternalMethods().setHasOutput();const n=!!i.getOptions().configuration["populate--"];i.getInternalMethods().postProcess(r,n,false,false);r=applyMiddleware(r,i,s,false);r=maybeAsyncResult(r,(e=>{const r=t.handler(e);return isPromise(r)?r.then((()=>e)):e}));if(!e){i.getInternalMethods().getUsageInstance().cacheHelpMessage()}if(isPromise(r)&&!i.getInternalMethods().hasParseCallback()){r.catch((e=>{try{i.getInternalMethods().getUsageInstance().fail(null,e)}catch(e){}}))}}if(!e){n.commands.pop();n.fullCommands.pop()}return r}applyMiddlewareAndGetResult(e,t,r,n,o,i,s){let a={};if(o)return r;if(!s.getInternalMethods().getHasOutput()){a=this.populatePositionals(t,r,n,s)}const u=this.globalMiddleware.getMiddleware().slice(0).concat(t.middlewares);const c=applyMiddleware(r,s,u,true);return isPromise(c)?c.then((r=>this.handleValidationAndGetResult(e,t,r,n,i,s,u,a))):this.handleValidationAndGetResult(e,t,c,n,i,s,u,a)}populatePositionals(e,t,r,n){t._=t._.slice(r.commands.length);const o=e.demanded.slice(0);const i=e.optional.slice(0);const s={};this.validation.positionalCount(o.length,t._.length);while(o.length){const e=o.shift();this.populatePositional(e,t,s)}while(i.length){const e=i.shift();this.populatePositional(e,t,s)}t._=r.commands.concat(t._.map((e=>""+e)));this.postProcessPositionals(t,s,this.cmdToParseOptions(e.original),n);return s}populatePositional(e,t,r){const n=e.cmd[0];if(e.variadic){r[n]=t._.splice(0).map(String)}else{if(t._.length)r[n]=[String(t._.shift())]}}cmdToParseOptions(e){const t={array:[],default:{},alias:{},demand:{}};const r=parseCommand(e);r.demanded.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n;t.demand[r]=true}));r.optional.forEach((e=>{const[r,...n]=e.cmd;if(e.variadic){t.array.push(r);t.default[r]=[]}t.alias[r]=n}));return t}postProcessPositionals(e,t,r,n){const o=Object.assign({},n.getOptions());o.default=Object.assign(r.default,o.default);for(const e of Object.keys(r.alias)){o.alias[e]=(o.alias[e]||[]).concat(r.alias[e])}o.array=o.array.concat(r.array);o.config={};const i=[];Object.keys(t).forEach((e=>{t[e].map((t=>{if(o.configuration["unknown-options-as-args"])o.key[e]=true;i.push(`--${e}`);i.push(t)}))}));if(!i.length)return;const s=Object.assign({},o.configuration,{"populate--":false});const a=this.shim.Parser.detailed(i,Object.assign({},o,{configuration:s}));if(a.error){n.getInternalMethods().getUsageInstance().fail(a.error.message,a.error)}else{const r=Object.keys(t);Object.keys(t).forEach((e=>{r.push(...a.aliases[e])}));Object.keys(a.argv).forEach((o=>{if(r.includes(o)){if(!t[o])t[o]=a.argv[o];if(!this.isInConfigs(n,o)&&!this.isDefaulted(n,o)&&Object.prototype.hasOwnProperty.call(e,o)&&Object.prototype.hasOwnProperty.call(a.argv,o)&&(Array.isArray(e[o])||Array.isArray(a.argv[o]))){e[o]=[].concat(e[o],a.argv[o])}else{e[o]=a.argv[o]}}}))}}isDefaulted(e,t){const{default:r}=e.getOptions();return Object.prototype.hasOwnProperty.call(r,t)||Object.prototype.hasOwnProperty.call(r,this.shim.Parser.camelCase(t))}isInConfigs(e,t){const{configObjects:r}=e.getOptions();return r.some((e=>Object.prototype.hasOwnProperty.call(e,t)))||r.some((e=>Object.prototype.hasOwnProperty.call(e,this.shim.Parser.camelCase(t))))}runDefaultBuilderOn(e){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(e)){const t=se.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");e.getInternalMethods().getUsageInstance().usage(t,this.defaultCommand.description)}const t=this.defaultCommand.builder;if(isCommandBuilderCallback(t)){return t(e,true)}else if(!isCommandBuilderDefinition(t)){Object.keys(t).forEach((r=>{e.option(r,t[r])}))}return undefined}extractDesc({describe:e,description:t,desc:r}){for(const n of[e,t,r]){if(typeof n==="string"||n===false)return n;assertNotStrictEqual(n,true,this.shim)}return false}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const e=this.frozens.pop();assertNotStrictEqual(e,undefined,this.shim);({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=e)}reset(){this.handlers={};this.aliasMap={};this.defaultCommand=undefined;this.requireCache=new Set;return this}}function command(e,t,r,n){return new CommandInstance(e,t,r,n)}function isCommandBuilderDefinition(e){return typeof e==="object"&&!!e.builder&&typeof e.handler==="function"}function isCommandAndAliases(e){return e.every((e=>typeof e==="string"))}function isCommandBuilderCallback(e){return typeof e==="function"}function isCommandBuilderOptionDefinitions(e){return typeof e==="object"}function isCommandHandlerDefinition(e){return typeof e==="object"&&!Array.isArray(e)}function objFilter(e={},t=()=>true){const r={};objectKeys(e).forEach((n=>{if(t(n,e[n])){r[n]=e[n]}}));return r}function setBlocking(e){if(typeof process==="undefined")return;[process.stdout,process.stderr].forEach((t=>{const r=t;if(r._handle&&r.isTTY&&typeof r._handle.setBlocking==="function"){r._handle.setBlocking(e)}}))}function isBoolean(e){return typeof e==="boolean"}function usage(e,t){const r=t.y18n.__;const n={};const o=[];n.failFn=function failFn(e){o.push(e)};let i=null;let s=null;let a=true;n.showHelpOnFail=function showHelpOnFailFn(t=true,r){const[o,u]=typeof t==="string"?[true,t]:[t,r];if(e.getInternalMethods().isGlobalContext()){s=u}i=u;a=o;return n};let u=false;n.fail=function fail(t,r){const c=e.getInternalMethods().getLoggerInstance();if(o.length){for(let e=o.length-1;e>=0;--e){const i=o[e];if(isBoolean(i)){if(r)throw r;else if(t)throw Error(t)}else{i(t,r,n)}}}else{if(e.getExitProcess())setBlocking(true);if(!u){u=true;if(a){e.showHelp("error");c.error()}if(t||r)c.error(t||r);const n=i||s;if(n){if(t||r)c.error("");c.error(n)}}r=r||new YError(t);if(e.getExitProcess()){return e.exit(1)}else if(e.getInternalMethods().hasParseCallback()){return e.exit(1,r)}else{throw r}}};let c=[];let l=false;n.usage=(e,t)=>{if(e===null){l=true;c=[];return n}l=false;c.push([e,t||""]);return n};n.getUsage=()=>c;n.getUsageDisabled=()=>l;n.getPositionalGroupName=()=>r("Positionals:");let f=[];n.example=(e,t)=>{f.push([e,t||""])};let d=[];n.command=function command(e,t,r,n,o=false){if(r){d=d.map((e=>{e[2]=false;return e}))}d.push([e,t||"",r,n,o])};n.getCommands=()=>d;let p={};n.describe=function describe(e,t){if(Array.isArray(e)){e.forEach((e=>{n.describe(e,t)}))}else if(typeof e==="object"){Object.keys(e).forEach((t=>{n.describe(t,e[t])}))}else{p[e]=t}};n.getDescriptions=()=>p;let h=[];n.epilog=e=>{h.push(e)};let m=false;let g;n.wrap=e=>{m=true;g=e};n.getWrap=()=>{if(t.getEnv("YARGS_DISABLE_WRAP")){return null}if(!m){g=windowWidth();m=true}return g};const D="__yargsString__:";n.deferY18nLookup=e=>D+e;n.help=function help(){if(y)return y;normalizeAliases();const o=e.customScriptName?e.$0:t.path.basename(e.$0);const i=e.getDemandedOptions();const s=e.getDemandedCommands();const a=e.getDeprecatedOptions();const u=e.getGroups();const m=e.getOptions();let g=[];g=g.concat(Object.keys(p));g=g.concat(Object.keys(i));g=g.concat(Object.keys(s));g=g.concat(Object.keys(m.default));g=g.filter(filterHiddenOptions);g=Object.keys(g.reduce(((e,t)=>{if(t!=="_")e[t]=true;return e}),{}));const b=n.getWrap();const E=t.cliui({width:b,wrap:!!b});if(!l){if(c.length){c.forEach((e=>{E.div({text:`${e[0].replace(/\$0/g,o)}`});if(e[1]){E.div({text:`${e[1]}`,padding:[1,0,0,0]})}}));E.div()}else if(d.length){let e=null;if(s._){e=`${o} <${r("command")}>\n`}else{e=`${o} [${r("command")}]\n`}E.div(`${e}`)}}if(d.length>1||d.length===1&&!d[0][2]){E.div(r("Commands:"));const t=e.getInternalMethods().getContext();const n=t.commands.length?`${t.commands.join(" ")} `:"";if(e.getInternalMethods().getParserConfiguration()["sort-commands"]===true){d=d.sort(((e,t)=>e[0].localeCompare(t[0])))}const i=o?`${o} `:"";d.forEach((e=>{const t=`${i}${n}${e[0].replace(/^\$0 ?/,"")}`;E.span({text:t,padding:[0,2,0,2],width:maxWidth(d,b,`${o}${n}`)+4},{text:e[1]});const s=[];if(e[2])s.push(`[${r("default")}]`);if(e[3]&&e[3].length){s.push(`[${r("aliases:")} ${e[3].join(", ")}]`)}if(e[4]){if(typeof e[4]==="string"){s.push(`[${r("deprecated: %s",e[4])}]`)}else{s.push(`[${r("deprecated")}]`)}}if(s.length){E.div({text:s.join(" "),padding:[0,0,0,2],align:"right"})}else{E.div()}}));E.div()}const v=(Object.keys(m.alias)||[]).concat(Object.keys(e.parsed.newAliases)||[]);g=g.filter((t=>!e.parsed.newAliases[t]&&v.every((e=>(m.alias[e]||[]).indexOf(t)===-1))));const w=r("Options:");if(!u[w])u[w]=[];addUngroupedKeys(g,m.alias,u,w);const isLongSwitch=e=>/^--/.test(getText(e));const F=Object.keys(u).filter((e=>u[e].length>0)).map((e=>{const t=u[e].filter(filterHiddenOptions).map((e=>{if(v.includes(e))return e;for(let t=0,r;(r=v[t])!==undefined;t++){if((m.alias[r]||[]).includes(e))return r}return e}));return{groupName:e,normalizedKeys:t}})).filter((({normalizedKeys:e})=>e.length>0)).map((({groupName:e,normalizedKeys:t})=>{const r=t.reduce(((t,r)=>{t[r]=[r].concat(m.alias[r]||[]).map((t=>{if(e===n.getPositionalGroupName())return t;else{return(/^[0-9]$/.test(t)?m.boolean.includes(r)?"-":"--":t.length>1?"--":"-")+t}})).sort(((e,t)=>isLongSwitch(e)===isLongSwitch(t)?0:isLongSwitch(e)?1:-1)).join(", ");return t}),{});return{groupName:e,normalizedKeys:t,switches:r}}));const C=F.filter((({groupName:e})=>e!==n.getPositionalGroupName())).some((({normalizedKeys:e,switches:t})=>!e.every((e=>isLongSwitch(t[e])))));if(C){F.filter((({groupName:e})=>e!==n.getPositionalGroupName())).forEach((({normalizedKeys:e,switches:t})=>{e.forEach((e=>{if(isLongSwitch(t[e])){t[e]=addIndentation(t[e],"-x, ".length)}}))}))}F.forEach((({groupName:t,normalizedKeys:o,switches:s})=>{E.div(t);o.forEach((t=>{const o=s[t];let u=p[t]||"";let c=null;if(u.includes(D))u=r(u.substring(D.length));if(m.boolean.includes(t))c=`[${r("boolean")}]`;if(m.count.includes(t))c=`[${r("count")}]`;if(m.string.includes(t))c=`[${r("string")}]`;if(m.normalize.includes(t))c=`[${r("string")}]`;if(m.array.includes(t))c=`[${r("array")}]`;if(m.number.includes(t))c=`[${r("number")}]`;const deprecatedExtra=e=>typeof e==="string"?`[${r("deprecated: %s",e)}]`:`[${r("deprecated")}]`;const l=[t in a?deprecatedExtra(a[t]):null,c,t in i?`[${r("required")}]`:null,m.choices&&m.choices[t]?`[${r("choices:")} ${n.stringifiedValues(m.choices[t])}]`:null,defaultString(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");E.span({text:getText(o),padding:[0,2,0,2+getIndentation(o)],width:maxWidth(s,b)+4},u);const f=e.getInternalMethods().getUsageConfiguration()["hide-types"]===true;if(l&&!f)E.div({text:l,padding:[0,0,0,2],align:"right"});else E.div()}));E.div()}));if(f.length){E.div(r("Examples:"));f.forEach((e=>{e[0]=e[0].replace(/\$0/g,o)}));f.forEach((e=>{if(e[1]===""){E.div({text:e[0],padding:[0,2,0,2]})}else{E.div({text:e[0],padding:[0,2,0,2],width:maxWidth(f,b)+4},{text:e[1]})}}));E.div()}if(h.length>0){const e=h.map((e=>e.replace(/\$0/g,o))).join("\n");E.div(`${e}\n`)}return E.toString().replace(/\s*$/,"")};function maxWidth(e,r,n){let o=0;if(!Array.isArray(e)){e=Object.values(e).map((e=>[e]))}e.forEach((e=>{o=Math.max(t.stringWidth(n?`${n} ${getText(e[0])}`:getText(e[0]))+getIndentation(e[0]),o)}));if(r)o=Math.min(o,parseInt((r*.5).toString(),10));return o}function normalizeAliases(){const t=e.getDemandedOptions();const r=e.getOptions();(Object.keys(r.alias)||[]).forEach((o=>{r.alias[o].forEach((i=>{if(p[i])n.describe(o,p[i]);if(i in t)e.demandOption(o,t[i]);if(r.boolean.includes(i))e.boolean(o);if(r.count.includes(i))e.count(o);if(r.string.includes(i))e.string(o);if(r.normalize.includes(i))e.normalize(o);if(r.array.includes(i))e.array(o);if(r.number.includes(i))e.number(o)}))}))}let y;n.cacheHelpMessage=function(){y=this.help()};n.clearCachedHelpMessage=function(){y=undefined};n.hasCachedHelpMessage=function(){return!!y};function addUngroupedKeys(e,t,r,n){let o=[];let i=null;Object.keys(r).forEach((e=>{o=o.concat(r[e])}));e.forEach((e=>{i=[e].concat(t[e]);if(!i.some((e=>o.indexOf(e)!==-1))){r[n].push(e)}}));return o}function filterHiddenOptions(t){return e.getOptions().hiddenOptions.indexOf(t)<0||e.parsed.argv[e.getOptions().showHiddenOpt]}n.showHelp=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const o=typeof t==="function"?t:r[t];o(n.help())};n.functionDescription=e=>{const n=e.name?t.Parser.decamelize(e.name,"-"):r("generated-value");return["(",n,")"].join("")};n.stringifiedValues=function stringifiedValues(e,t){let r="";const n=t||", ";const o=[].concat(e);if(!e||!o.length)return r;o.forEach((e=>{if(r.length)r+=n;r+=JSON.stringify(e)}));return r};function defaultString(e,t){let n=`[${r("default:")} `;if(e===undefined&&!t)return null;if(t){n+=t}else{switch(typeof e){case"string":n+=`"${e}"`;break;case"object":n+=JSON.stringify(e);break;default:n+=e}}return`${n}]`}function windowWidth(){const e=80;if(t.process.stdColumns){return Math.min(e,t.process.stdColumns)}else{return e}}let b=null;n.version=e=>{b=e};n.showVersion=t=>{const r=e.getInternalMethods().getLoggerInstance();if(!t)t="error";const n=typeof t==="function"?t:r[t];n(b)};n.reset=function reset(e){i=null;u=false;c=[];l=false;h=[];f=[];d=[];p=objFilter(p,(t=>!e[t]));return n};const E=[];n.freeze=function freeze(){E.push({failMessage:i,failureOutput:u,usages:c,usageDisabled:l,epilogs:h,examples:f,commands:d,descriptions:p})};n.unfreeze=function unfreeze(e=false){const t=E.pop();if(!t)return;if(e){p={...t.descriptions,...p};d=[...t.commands,...d];c=[...t.usages,...c];f=[...t.examples,...f];h=[...t.epilogs,...h]}else{({failMessage:i,failureOutput:u,usages:c,usageDisabled:l,epilogs:h,examples:f,commands:d,descriptions:p}=t)}};return n}function isIndentedText(e){return typeof e==="object"}function addIndentation(e,t){return isIndentedText(e)?{text:e.text,indentation:e.indentation+t}:{text:e,indentation:t}}function getIndentation(e){return isIndentedText(e)?e.indentation:0}function getText(e){return isIndentedText(e)?e.text:e}const ae=`###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="\${COMP_WORDS[COMP_CWORD]}"\n args=("\${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n # see https://stackoverflow.com/a/40944195/7080036 for the spaces-handling awk\n mapfile -t type_list < <({{app_path}} --get-yargs-completions "\${args[@]}")\n mapfile -t COMPREPLY < <(compgen -W "$( printf '%q ' "\${type_list[@]}" )" -- "\${cur_word}" |\n awk '/ / { print "\\""$0"\\"" } /^[^ ]+$/ { print $0 }')\n\n # if no match was found, fall back to filename completion\n if [ \${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n`;const ue=`#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))\n IFS=$si\n if [[ \${#reply} -gt 0 ]]; then\n _describe 'values' reply\n else\n _default\n fi\n}\nif [[ "'\${zsh_eval_context[-1]}" == "loadautofunc" ]]; then\n _{{app_name}}_yargs_completions "$@"\nelse\n compdef _{{app_name}}_yargs_completions {{app_name}}\nfi\n###-end-{{app_name}}-completions-###\n`;class Completion{constructor(e,t,r,n){var o,i,s;this.yargs=e;this.usage=t;this.command=r;this.shim=n;this.completionKey="get-yargs-completions";this.aliases=null;this.customCompletionFunction=null;this.indexAfterLastReset=0;this.zshShell=(s=((o=this.shim.getEnv("SHELL"))===null||o===void 0?void 0:o.includes("zsh"))||((i=this.shim.getEnv("ZSH_NAME"))===null||i===void 0?void 0:i.includes("zsh")))!==null&&s!==void 0?s:false}defaultCompletion(e,t,r,n){const o=this.command.getCommandHandlers();for(let t=0,r=e.length;t<r;++t){if(o[e[t]]&&o[e[t]].builder){const r=o[e[t]].builder;if(isCommandBuilderCallback(r)){this.indexAfterLastReset=t+1;const e=this.yargs.getInternalMethods().reset();r(e,true);return e.argv}}}const i=[];this.commandCompletions(i,e,r);this.optionCompletions(i,e,t,r);this.choicesFromOptionsCompletions(i,e,t,r);this.choicesFromPositionalsCompletions(i,e,t,r);n(null,i)}commandCompletions(e,t,r){const n=this.yargs.getInternalMethods().getContext().commands;if(!r.match(/^-/)&&n[n.length-1]!==r&&!this.previousArgHasChoices(t)){this.usage.getCommands().forEach((r=>{const n=parseCommand(r[0]).cmd;if(t.indexOf(n)===-1){if(!this.zshShell){e.push(n)}else{const t=r[1]||"";e.push(n.replace(/:/g,"\\:")+":"+t)}}}))}}optionCompletions(e,t,r,n){if((n.match(/^-/)||n===""&&e.length===0)&&!this.previousArgHasChoices(t)){const r=this.yargs.getOptions();const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(r.key).forEach((i=>{const s=!!r.configuration["boolean-negation"]&&r.boolean.includes(i);const a=o.includes(i);if(!a&&!r.hiddenOptions.includes(i)&&!this.argsContainKey(t,i,s)){this.completeOptionKey(i,e,n,s&&!!r.default[i])}}))}}choicesFromOptionsCompletions(e,t,r,n){if(this.previousArgHasChoices(t)){const r=this.getPreviousArgChoices(t);if(r&&r.length>0){e.push(...r.map((e=>e.replace(/:/g,"\\:"))))}}}choicesFromPositionalsCompletions(e,t,r,n){if(n===""&&e.length>0&&this.previousArgHasChoices(t)){return}const o=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];const i=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1);const s=o[r._.length-i-1];if(!s){return}const a=this.yargs.getOptions().choices[s]||[];for(const t of a){if(t.startsWith(n)){e.push(t.replace(/:/g,"\\:"))}}}getPreviousArgChoices(e){if(e.length<1)return;let t=e[e.length-1];let r="";if(!t.startsWith("-")&&e.length>1){r=t;t=e[e.length-2]}if(!t.startsWith("-"))return;const n=t.replace(/^-+/,"");const o=this.yargs.getOptions();const i=[n,...this.yargs.getAliases()[n]||[]];let s;for(const e of i){if(Object.prototype.hasOwnProperty.call(o.key,e)&&Array.isArray(o.choices[e])){s=o.choices[e];break}}if(s){return s.filter((e=>!r||e.startsWith(r)))}}previousArgHasChoices(e){const t=this.getPreviousArgChoices(e);return t!==undefined&&t.length>0}argsContainKey(e,t,r){const argsContains=t=>e.indexOf((/^[^0-9]$/.test(t)?"-":"--")+t)!==-1;if(argsContains(t))return true;if(r&&argsContains(`no-${t}`))return true;if(this.aliases){for(const e of this.aliases[t]){if(argsContains(e))return true}}return false}completeOptionKey(e,t,r,n){var o,i,s,a;let u=e;if(this.zshShell){const t=this.usage.getDescriptions();const r=(i=(o=this===null||this===void 0?void 0:this.aliases)===null||o===void 0?void 0:o[e])===null||i===void 0?void 0:i.find((e=>{const r=t[e];return typeof r==="string"&&r.length>0}));const n=r?t[r]:undefined;const c=(a=(s=t[e])!==null&&s!==void 0?s:n)!==null&&a!==void 0?a:"";u=`${e.replace(/:/g,"\\:")}:${c.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}const startsByTwoDashes=e=>/^--/.test(e);const isShortOption=e=>/^[^0-9]$/.test(e);const c=!startsByTwoDashes(r)&&isShortOption(e)?"-":"--";t.push(c+u);if(n){t.push(c+"no-"+u)}}customCompletion(e,t,r,n){assertNotStrictEqual(this.customCompletionFunction,null,this.shim);if(isSyncCompletionFunction(this.customCompletionFunction)){const e=this.customCompletionFunction(r,t);if(isPromise(e)){return e.then((e=>{this.shim.process.nextTick((()=>{n(null,e)}))})).catch((e=>{this.shim.process.nextTick((()=>{n(e,undefined)}))}))}return n(null,e)}else if(isFallbackCompletionFunction(this.customCompletionFunction)){return this.customCompletionFunction(r,t,((o=n)=>this.defaultCompletion(e,t,r,o)),(e=>{n(null,e)}))}else{return this.customCompletionFunction(r,t,(e=>{n(null,e)}))}}getCompletion(e,t){const r=e.length?e[e.length-1]:"";const n=this.yargs.parse(e,true);const o=this.customCompletionFunction?n=>this.customCompletion(e,n,r,t):n=>this.defaultCompletion(e,n,r,t);return isPromise(n)?n.then(o):o(n)}generateCompletionScript(e,t){let r=this.zshShell?ue:ae;const n=this.shim.path.basename(e);if(e.match(/\.js$/))e=`./${e}`;r=r.replace(/{{app_name}}/g,n);r=r.replace(/{{completion_command}}/g,t);return r.replace(/{{app_path}}/g,e)}registerFunction(e){this.customCompletionFunction=e}setParsed(e){this.aliases=e.aliases}}function completion(e,t,r,n){return new Completion(e,t,r,n)}function isSyncCompletionFunction(e){return e.length<3}function isFallbackCompletionFunction(e){return e.length>3}function levenshtein(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;const r=[];let n;for(n=0;n<=t.length;n++){r[n]=[n]}let o;for(o=0;o<=e.length;o++){r[0][o]=o}for(n=1;n<=t.length;n++){for(o=1;o<=e.length;o++){if(t.charAt(n-1)===e.charAt(o-1)){r[n][o]=r[n-1][o-1]}else{if(n>1&&o>1&&t.charAt(n-2)===e.charAt(o-1)&&t.charAt(n-1)===e.charAt(o-2)){r[n][o]=r[n-2][o-2]+1}else{r[n][o]=Math.min(r[n-1][o-1]+1,Math.min(r[n][o-1]+1,r[n-1][o]+1))}}}}return r[t.length][e.length]}const ce=["$0","--","_"];function validation(e,t,r){const n=r.y18n.__;const o=r.y18n.__n;const i={};i.nonOptionCount=function nonOptionCount(r){const n=e.getDemandedCommands();const i=r._.length+(r["--"]?r["--"].length:0);const s=i-e.getInternalMethods().getContext().commands.length;if(n._&&(s<n._.min||s>n._.max)){if(s<n._.min){if(n._.minMsg!==undefined){t.fail(n._.minMsg?n._.minMsg.replace(/\$0/g,s.toString()).replace(/\$1/,n._.min.toString()):null)}else{t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s.toString(),n._.min.toString()))}}else if(s>n._.max){if(n._.maxMsg!==undefined){t.fail(n._.maxMsg?n._.maxMsg.replace(/\$0/g,s.toString()).replace(/\$1/,n._.max.toString()):null)}else{t.fail(o("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",s,s.toString(),n._.max.toString()))}}}};i.positionalCount=function positionalCount(e,r){if(r<e){t.fail(o("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r+"",e+""))}};i.requiredArguments=function requiredArguments(e,r){let n=null;for(const t of Object.keys(r)){if(!Object.prototype.hasOwnProperty.call(e,t)||typeof e[t]==="undefined"){n=n||{};n[t]=r[t]}}if(n){const e=[];for(const t of Object.keys(n)){const r=n[t];if(r&&e.indexOf(r)<0){e.push(r)}}const r=e.length?`\n${e.join("\n")}`:"";t.fail(o("Missing required argument: %s","Missing required arguments: %s",Object.keys(n).length,Object.keys(n).join(", ")+r))}};i.unknownArguments=function unknownArguments(r,n,s,a,u=true){var c;const l=e.getInternalMethods().getCommandInstance().getCommands();const f=[];const d=e.getInternalMethods().getContext();Object.keys(r).forEach((t=>{if(!ce.includes(t)&&!Object.prototype.hasOwnProperty.call(s,t)&&!Object.prototype.hasOwnProperty.call(e.getInternalMethods().getParseContext(),t)&&!i.isValidAndSomeAliasIsNotNew(t,n)){f.push(t)}}));if(u&&(d.commands.length>0||l.length>0||a)){r._.slice(d.commands.length).forEach((e=>{if(!l.includes(""+e)){f.push(""+e)}}))}if(u){const t=e.getDemandedCommands();const n=((c=t._)===null||c===void 0?void 0:c.max)||0;const o=d.commands.length+n;if(o<r._.length){r._.slice(o).forEach((e=>{e=String(e);if(!d.commands.includes(e)&&!f.includes(e)){f.push(e)}}))}}if(f.length){t.fail(o("Unknown argument: %s","Unknown arguments: %s",f.length,f.map((e=>e.trim()?e:`"${e}"`)).join(", ")))}};i.unknownCommands=function unknownCommands(r){const n=e.getInternalMethods().getCommandInstance().getCommands();const i=[];const s=e.getInternalMethods().getContext();if(s.commands.length>0||n.length>0){r._.slice(s.commands.length).forEach((e=>{if(!n.includes(""+e)){i.push(""+e)}}))}if(i.length>0){t.fail(o("Unknown command: %s","Unknown commands: %s",i.length,i.join(", ")));return true}else{return false}};i.isValidAndSomeAliasIsNotNew=function isValidAndSomeAliasIsNotNew(t,r){if(!Object.prototype.hasOwnProperty.call(r,t)){return false}const n=e.parsed.newAliases;return[t,...r[t]].some((e=>!Object.prototype.hasOwnProperty.call(n,e)||!n[t]))};i.limitedChoices=function limitedChoices(r){const o=e.getOptions();const i={};if(!Object.keys(o.choices).length)return;Object.keys(r).forEach((e=>{if(ce.indexOf(e)===-1&&Object.prototype.hasOwnProperty.call(o.choices,e)){[].concat(r[e]).forEach((t=>{if(o.choices[e].indexOf(t)===-1&&t!==undefined){i[e]=(i[e]||[]).concat(t)}}))}}));const s=Object.keys(i);if(!s.length)return;let a=n("Invalid values:");s.forEach((e=>{a+=`\n ${n("Argument: %s, Given: %s, Choices: %s",e,t.stringifiedValues(i[e]),t.stringifiedValues(o.choices[e]))}`}));t.fail(a)};let s={};i.implies=function implies(t,n){argsert("<string|object> [array|number|string]",[t,n],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.implies(e,t[e])}))}else{e.global(t);if(!s[t]){s[t]=[]}if(Array.isArray(n)){n.forEach((e=>i.implies(t,e)))}else{assertNotStrictEqual(n,undefined,r);s[t].push(n)}}};i.getImplied=function getImplied(){return s};function keyExists(e,t){const r=Number(t);t=isNaN(r)?t:r;if(typeof t==="number"){t=e._.length>=t}else if(t.match(/^--no-.+/)){t=t.match(/^--no-(.+)/)[1];t=!Object.prototype.hasOwnProperty.call(e,t)}else{t=Object.prototype.hasOwnProperty.call(e,t)}return t}i.implications=function implications(e){const r=[];Object.keys(s).forEach((t=>{const n=t;(s[t]||[]).forEach((t=>{let o=n;const i=t;o=keyExists(e,o);t=keyExists(e,t);if(o&&!t){r.push(` ${n} -> ${i}`)}}))}));if(r.length){let e=`${n("Implications failed:")}\n`;r.forEach((t=>{e+=t}));t.fail(e)}};let a={};i.conflicts=function conflicts(t,r){argsert("<string|object> [array|string]",[t,r],arguments.length);if(typeof t==="object"){Object.keys(t).forEach((e=>{i.conflicts(e,t[e])}))}else{e.global(t);if(!a[t]){a[t]=[]}if(Array.isArray(r)){r.forEach((e=>i.conflicts(t,e)))}else{a[t].push(r)}}};i.getConflicting=()=>a;i.conflicting=function conflictingFn(o){Object.keys(o).forEach((e=>{if(a[e]){a[e].forEach((r=>{if(r&&o[e]!==undefined&&o[r]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,r))}}))}}));if(e.getInternalMethods().getParserConfiguration()["strip-dashed"]){Object.keys(a).forEach((e=>{a[e].forEach((i=>{if(i&&o[r.Parser.camelCase(e)]!==undefined&&o[r.Parser.camelCase(i)]!==undefined){t.fail(n("Arguments %s and %s are mutually exclusive",e,i))}}))}))}};i.recommendCommands=function recommendCommands(e,r){const o=3;r=r.sort(((e,t)=>t.length-e.length));let i=null;let s=Infinity;for(let t=0,n;(n=r[t])!==undefined;t++){const t=levenshtein(e,n);if(t<=o&&t<s){s=t;i=n}}if(i)t.fail(n("Did you mean %s?",i))};i.reset=function reset(e){s=objFilter(s,(t=>!e[t]));a=objFilter(a,(t=>!e[t]));return i};const u=[];i.freeze=function freeze(){u.push({implied:s,conflicting:a})};i.unfreeze=function unfreeze(){const e=u.pop();assertNotStrictEqual(e,undefined,r);({implied:s,conflicting:a}=e)};return i}let le=[];let fe;function applyExtends(e,t,r,n){fe=n;let o={};if(Object.prototype.hasOwnProperty.call(e,"extends")){if(typeof e.extends!=="string")return o;const i=/\.json|\..*rc$/.test(e.extends);let s=null;if(!i){try{s=import.meta.resolve(e.extends)}catch(t){return e}}else{s=getPathToDefaultConfig(t,e.extends)}checkForCircularExtends(s);le.push(s);o=i?JSON.parse(fe.readFileSync(s,"utf8")):n.require(e.extends);delete e.extends;o=applyExtends(o,fe.path.dirname(s),r,fe)}le=[];return r?mergeDeep(o,e):Object.assign({},o,e)}function checkForCircularExtends(e){if(le.indexOf(e)>-1){throw new YError(`Circular extended configurations: '${e}'.`)}}function getPathToDefaultConfig(e,t){return fe.path.resolve(e,t)}function mergeDeep(e,t){const r={};function isObject(e){return e&&typeof e==="object"&&!Array.isArray(e)}Object.assign(r,e);for(const n of Object.keys(t)){if(isObject(t[n])&&isObject(r[n])){r[n]=mergeDeep(e[n],t[n])}else{r[n]=t[n]}}return r}var de=undefined&&undefined.__classPrivateFieldSet||function(e,t,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof t==="function"?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(e,r):o?o.value=r:t.set(e,r),r};var pe=undefined&&undefined.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t==="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)};var he,me,ge,De,ye,be,Ee,ve,we,Fe,Ce,Ae,Oe,Se,je,ke,xe,Pe,_e,Ie,Be,Te,Ne,Me,Re,Ue,Le,$e,We,Ke,ze,Ge,He,Ve,Je;function YargsFactory(e){return(t=[],r=e.process.cwd(),n)=>{const o=new YargsInstance(t,r,n,e);Object.defineProperty(o,"argv",{get:()=>o.parse(),enumerable:true});o.help();o.version();return o}}const qe=Symbol("copyDoubleDash");const Ye=Symbol("copyDoubleDash");const Xe=Symbol("deleteFromParserHintObject");const Qe=Symbol("emitWarning");const Ze=Symbol("freeze");const et=Symbol("getDollarZero");const tt=Symbol("getParserConfiguration");const rt=Symbol("getUsageConfiguration");const nt=Symbol("guessLocale");const ot=Symbol("guessVersion");const it=Symbol("parsePositionalNumbers");const st=Symbol("pkgUp");const at=Symbol("populateParserHintArray");const ut=Symbol("populateParserHintSingleValueDictionary");const ct=Symbol("populateParserHintArrayDictionary");const lt=Symbol("populateParserHintDictionary");const ft=Symbol("sanitizeKey");const dt=Symbol("setKey");const pt=Symbol("unfreeze");const ht=Symbol("validateAsync");const mt=Symbol("getCommandInstance");const gt=Symbol("getContext");const Dt=Symbol("getHasOutput");const yt=Symbol("getLoggerInstance");const bt=Symbol("getParseContext");const Et=Symbol("getUsageInstance");const vt=Symbol("getValidationInstance");const wt=Symbol("hasParseCallback");const Ft=Symbol("isGlobalContext");const Ct=Symbol("postProcess");const At=Symbol("rebase");const Ot=Symbol("reset");const St=Symbol("runYargsParserAndExecuteCommands");const jt=Symbol("runValidation");const kt=Symbol("setHasOutput");const xt=Symbol("kTrackManuallySetKeys");const Pt="en_US";class YargsInstance{constructor(e=[],t,r,n){this.customScriptName=false;this.parsed=false;he.set(this,void 0);me.set(this,void 0);ge.set(this,{commands:[],fullCommands:[]});De.set(this,null);ye.set(this,null);be.set(this,"show-hidden");Ee.set(this,null);ve.set(this,true);we.set(this,{});Fe.set(this,true);Ce.set(this,[]);Ae.set(this,void 0);Oe.set(this,{});Se.set(this,false);je.set(this,null);ke.set(this,true);xe.set(this,void 0);Pe.set(this,"");_e.set(this,void 0);Ie.set(this,void 0);Be.set(this,{});Te.set(this,null);Ne.set(this,null);Me.set(this,{});Re.set(this,{});Ue.set(this,void 0);Le.set(this,false);$e.set(this,void 0);We.set(this,false);Ke.set(this,false);ze.set(this,false);Ge.set(this,void 0);He.set(this,{});Ve.set(this,null);Je.set(this,void 0);de(this,$e,n,"f");de(this,Ue,e,"f");de(this,me,t,"f");de(this,Ie,r,"f");de(this,Ae,new GlobalMiddleware(this),"f");this.$0=this[et]();this[Ot]();de(this,he,pe(this,he,"f"),"f");de(this,Ge,pe(this,Ge,"f"),"f");de(this,Je,pe(this,Je,"f"),"f");de(this,_e,pe(this,_e,"f"),"f");pe(this,_e,"f").showHiddenOpt=pe(this,be,"f");de(this,xe,this[Ye](),"f");pe(this,$e,"f").y18n.setLocale(Pt)}addHelpOpt(e,t){const r="help";argsert("[string|boolean] [string]",[e,t],arguments.length);if(pe(this,je,"f")){this[Xe](pe(this,je,"f"));de(this,je,null,"f")}if(e===false&&t===undefined)return this;de(this,je,typeof e==="string"?e:r,"f");this.boolean(pe(this,je,"f"));this.describe(pe(this,je,"f"),t||pe(this,Ge,"f").deferY18nLookup("Show help"));return this}help(e,t){return this.addHelpOpt(e,t)}addShowHiddenOpt(e,t){argsert("[string|boolean] [string]",[e,t],arguments.length);if(e===false&&t===undefined)return this;const r=typeof e==="string"?e:pe(this,be,"f");this.boolean(r);this.describe(r,t||pe(this,Ge,"f").deferY18nLookup("Show hidden options"));pe(this,_e,"f").showHiddenOpt=r;return this}showHidden(e,t){return this.addShowHiddenOpt(e,t)}alias(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[ct](this.alias.bind(this),"alias",e,t);return this}array(e){argsert("<array|string>",[e],arguments.length);this[at]("array",e);this[xt](e);return this}boolean(e){argsert("<array|string>",[e],arguments.length);this[at]("boolean",e);this[xt](e);return this}check(e,t){argsert("<function> [boolean]",[e,t],arguments.length);this.middleware(((t,r)=>maybeAsyncResult((()=>e(t,r.getOptions())),(r=>{if(!r){pe(this,Ge,"f").fail(pe(this,$e,"f").y18n.__("Argument check failed: %s",e.toString()))}else if(typeof r==="string"||r instanceof Error){pe(this,Ge,"f").fail(r.toString(),r)}return t}),(e=>{pe(this,Ge,"f").fail(e.message?e.message:e.toString(),e);return t}))),false,t);return this}choices(e,t){argsert("<object|string|array> [string|array]",[e,t],arguments.length);this[ct](this.choices.bind(this),"choices",e,t);return this}coerce(e,t){argsert("<object|string|array> [function]",[e,t],arguments.length);if(Array.isArray(e)){if(!t){throw new YError("coerce callback must be provided")}for(const r of e){this.coerce(r,t)}return this}else if(typeof e==="object"){for(const t of Object.keys(e)){this.coerce(t,e[t])}return this}if(!t){throw new YError("coerce callback must be provided")}const r=e;pe(this,_e,"f").key[r]=true;pe(this,Ae,"f").addCoerceMiddleware(((e,n)=>{var o;const i=(o=n.getAliases()[r])!==null&&o!==void 0?o:[];const s=[r,...i].filter((t=>Object.prototype.hasOwnProperty.call(e,t)));if(s.length===0){return e}return maybeAsyncResult((()=>t(e[s[0]])),(t=>{s.forEach((r=>{e[r]=t}));return e}),(e=>{throw new YError(e.message)}))}),r);return this}conflicts(e,t){argsert("<string|object> [string|array]",[e,t],arguments.length);pe(this,Je,"f").conflicts(e,t);return this}config(e="config",t,r){argsert("[object|string] [string|function] [function]",[e,t,r],arguments.length);if(typeof e==="object"&&!Array.isArray(e)){e=applyExtends(e,pe(this,me,"f"),this[tt]()["deep-merge-config"]||false,pe(this,$e,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(e);return this}if(typeof t==="function"){r=t;t=undefined}this.describe(e,t||pe(this,Ge,"f").deferY18nLookup("Path to JSON config file"));(Array.isArray(e)?e:[e]).forEach((e=>{pe(this,_e,"f").config[e]=r||true}));return this}completion(e,t,r){argsert("[string] [string|boolean|function] [function]",[e,t,r],arguments.length);if(typeof t==="function"){r=t;t=undefined}de(this,ye,e||pe(this,ye,"f")||"completion","f");if(!t&&t!==false){t="generate completion script"}this.command(pe(this,ye,"f"),t);if(r)pe(this,De,"f").registerFunction(r);return this}command(e,t,r,n,o,i){argsert("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[e,t,r,n,o,i],arguments.length);pe(this,he,"f").addHandler(e,t,r,n,o,i);return this}commands(e,t,r,n,o,i){return this.command(e,t,r,n,o,i)}commandDir(e,t){argsert("<string> [object]",[e,t],arguments.length);const r=pe(this,Ie,"f")||pe(this,$e,"f").require;pe(this,he,"f").addDirectory(e,r,pe(this,$e,"f").getCallerFile(),t);return this}count(e){argsert("<array|string>",[e],arguments.length);this[at]("count",e);this[xt](e);return this}default(e,t,r){argsert("<object|string|array> [*] [string]",[e,t,r],arguments.length);if(r){assertSingleKey(e,pe(this,$e,"f"));pe(this,_e,"f").defaultDescription[e]=r}if(typeof t==="function"){assertSingleKey(e,pe(this,$e,"f"));if(!pe(this,_e,"f").defaultDescription[e])pe(this,_e,"f").defaultDescription[e]=pe(this,Ge,"f").functionDescription(t);t=t.call()}this[ut](this.default.bind(this),"default",e,t);return this}defaults(e,t,r){return this.default(e,t,r)}demandCommand(e=1,t,r,n){argsert("[number] [number|string] [string|null|undefined] [string|null|undefined]",[e,t,r,n],arguments.length);if(typeof t!=="number"){r=t;t=Infinity}this.global("_",false);pe(this,_e,"f").demandedCommands._={min:e,max:t,minMsg:r,maxMsg:n};return this}demand(e,t,r){if(Array.isArray(t)){t.forEach((e=>{assertNotStrictEqual(r,true,pe(this,$e,"f"));this.demandOption(e,r)}));t=Infinity}else if(typeof t!=="number"){r=t;t=Infinity}if(typeof e==="number"){assertNotStrictEqual(r,true,pe(this,$e,"f"));this.demandCommand(e,t,r,r)}else if(Array.isArray(e)){e.forEach((e=>{assertNotStrictEqual(r,true,pe(this,$e,"f"));this.demandOption(e,r)}))}else{if(typeof r==="string"){this.demandOption(e,r)}else if(r===true||typeof r==="undefined"){this.demandOption(e)}}return this}demandOption(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[ut](this.demandOption.bind(this),"demandedOptions",e,t);return this}deprecateOption(e,t){argsert("<string> [string|boolean]",[e,t],arguments.length);pe(this,_e,"f").deprecatedOptions[e]=t;return this}describe(e,t){argsert("<object|string|array> [string]",[e,t],arguments.length);this[dt](e,true);pe(this,Ge,"f").describe(e,t);return this}detectLocale(e){argsert("<boolean>",[e],arguments.length);de(this,ve,e,"f");return this}env(e){argsert("[string|boolean]",[e],arguments.length);if(e===false)delete pe(this,_e,"f").envPrefix;else pe(this,_e,"f").envPrefix=e||"";return this}epilogue(e){argsert("<string>",[e],arguments.length);pe(this,Ge,"f").epilog(e);return this}epilog(e){return this.epilogue(e)}example(e,t){argsert("<string|array> [string]",[e,t],arguments.length);if(Array.isArray(e)){e.forEach((e=>this.example(...e)))}else{pe(this,Ge,"f").example(e,t)}return this}exit(e,t){de(this,Se,true,"f");de(this,Ee,t,"f");if(pe(this,Fe,"f"))pe(this,$e,"f").process.exit(e)}exitProcess(e=true){argsert("[boolean]",[e],arguments.length);de(this,Fe,e,"f");return this}fail(e){argsert("<function|boolean>",[e],arguments.length);if(typeof e==="boolean"&&e!==false){throw new YError("Invalid first argument. Expected function or boolean 'false'")}pe(this,Ge,"f").failFn(e);return this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(e,t){argsert("<array> [function]",[e,t],arguments.length);if(!t){return new Promise(((t,r)=>{pe(this,De,"f").getCompletion(e,((e,n)=>{if(e)r(e);else t(n)}))}))}else{return pe(this,De,"f").getCompletion(e,t)}}getDemandedOptions(){argsert([],0);return pe(this,_e,"f").demandedOptions}getDemandedCommands(){argsert([],0);return pe(this,_e,"f").demandedCommands}getDeprecatedOptions(){argsert([],0);return pe(this,_e,"f").deprecatedOptions}getDetectLocale(){return pe(this,ve,"f")}getExitProcess(){return pe(this,Fe,"f")}getGroups(){return Object.assign({},pe(this,Oe,"f"),pe(this,Re,"f"))}getHelp(){de(this,Se,true,"f");if(!pe(this,Ge,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[St](pe(this,Ue,"f"),undefined,undefined,0,true);if(isPromise(e)){return e.then((()=>pe(this,Ge,"f").help()))}}const e=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(e)){return e.then((()=>pe(this,Ge,"f").help()))}}return Promise.resolve(pe(this,Ge,"f").help())}getOptions(){return pe(this,_e,"f")}getStrict(){return pe(this,We,"f")}getStrictCommands(){return pe(this,Ke,"f")}getStrictOptions(){return pe(this,ze,"f")}global(e,t){argsert("<string|array> [boolean]",[e,t],arguments.length);e=[].concat(e);if(t!==false){pe(this,_e,"f").local=pe(this,_e,"f").local.filter((t=>e.indexOf(t)===-1))}else{e.forEach((e=>{if(!pe(this,_e,"f").local.includes(e))pe(this,_e,"f").local.push(e)}))}return this}group(e,t){argsert("<string|array> <string>",[e,t],arguments.length);const r=pe(this,Re,"f")[t]||pe(this,Oe,"f")[t];if(pe(this,Re,"f")[t]){delete pe(this,Re,"f")[t]}const n={};pe(this,Oe,"f")[t]=(r||[]).concat(e).filter((e=>{if(n[e])return false;return n[e]=true}));return this}hide(e){argsert("<string>",[e],arguments.length);pe(this,_e,"f").hiddenOptions.push(e);return this}implies(e,t){argsert("<string|object> [number|string|array]",[e,t],arguments.length);pe(this,Je,"f").implies(e,t);return this}locale(e){argsert("[string]",[e],arguments.length);if(e===undefined){this[nt]();return pe(this,$e,"f").y18n.getLocale()}de(this,ve,false,"f");pe(this,$e,"f").y18n.setLocale(e);return this}middleware(e,t,r){return pe(this,Ae,"f").addMiddleware(e,!!t,r)}nargs(e,t){argsert("<string|object|array> [number]",[e,t],arguments.length);this[ut](this.nargs.bind(this),"narg",e,t);return this}normalize(e){argsert("<array|string>",[e],arguments.length);this[at]("normalize",e);return this}number(e){argsert("<array|string>",[e],arguments.length);this[at]("number",e);this[xt](e);return this}option(e,t){argsert("<string|object> [object]",[e,t],arguments.length);if(typeof e==="object"){Object.keys(e).forEach((t=>{this.options(t,e[t])}))}else{if(typeof t!=="object"){t={}}this[xt](e);if(pe(this,Ve,"f")&&(e==="version"||(t===null||t===void 0?void 0:t.alias)==="version")){this[Qe](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join("\n"),undefined,"versionWarning")}pe(this,_e,"f").key[e]=true;if(t.alias)this.alias(e,t.alias);const r=t.deprecate||t.deprecated;if(r){this.deprecateOption(e,r)}const n=t.demand||t.required||t.require;if(n){this.demand(e,n)}if(t.demandOption){this.demandOption(e,typeof t.demandOption==="string"?t.demandOption:undefined)}if(t.conflicts){this.conflicts(e,t.conflicts)}if("default"in t){this.default(e,t.default)}if(t.implies!==undefined){this.implies(e,t.implies)}if(t.nargs!==undefined){this.nargs(e,t.nargs)}if(t.config){this.config(e,t.configParser)}if(t.normalize){this.normalize(e)}if(t.choices){this.choices(e,t.choices)}if(t.coerce){this.coerce(e,t.coerce)}if(t.group){this.group(e,t.group)}if(t.boolean||t.type==="boolean"){this.boolean(e);if(t.alias)this.boolean(t.alias)}if(t.array||t.type==="array"){this.array(e);if(t.alias)this.array(t.alias)}if(t.number||t.type==="number"){this.number(e);if(t.alias)this.number(t.alias)}if(t.string||t.type==="string"){this.string(e);if(t.alias)this.string(t.alias)}if(t.count||t.type==="count"){this.count(e)}if(typeof t.global==="boolean"){this.global(e,t.global)}if(t.defaultDescription){pe(this,_e,"f").defaultDescription[e]=t.defaultDescription}if(t.skipValidation){this.skipValidation(e)}const o=t.describe||t.description||t.desc;const i=pe(this,Ge,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(i,e)||typeof o==="string"){this.describe(e,o)}if(t.hidden){this.hide(e)}if(t.requiresArg){this.requiresArg(e)}}return this}options(e,t){return this.option(e,t)}parse(e,t,r){argsert("[string|array] [function|boolean|object] [function]",[e,t,r],arguments.length);this[Ze]();if(typeof e==="undefined"){e=pe(this,Ue,"f")}if(typeof t==="object"){de(this,Ne,t,"f");t=r}if(typeof t==="function"){de(this,Te,t,"f");t=false}if(!t)de(this,Ue,e,"f");if(pe(this,Te,"f"))de(this,Fe,false,"f");const n=this[St](e,!!t);const o=this.parsed;pe(this,De,"f").setParsed(this.parsed);if(isPromise(n)){return n.then((e=>{if(pe(this,Te,"f"))pe(this,Te,"f").call(this,pe(this,Ee,"f"),e,pe(this,Pe,"f"));return e})).catch((e=>{if(pe(this,Te,"f")){pe(this,Te,"f")(e,this.parsed.argv,pe(this,Pe,"f"))}throw e})).finally((()=>{this[pt]();this.parsed=o}))}else{if(pe(this,Te,"f"))pe(this,Te,"f").call(this,pe(this,Ee,"f"),n,pe(this,Pe,"f"));this[pt]();this.parsed=o}return n}parseAsync(e,t,r){const n=this.parse(e,t,r);return!isPromise(n)?Promise.resolve(n):n}parseSync(e,t,r){const n=this.parse(e,t,r);if(isPromise(n)){throw new YError(".parseSync() must not be used with asynchronous builders, handlers, or middleware")}return n}parserConfiguration(e){argsert("<object>",[e],arguments.length);de(this,Be,e,"f");return this}pkgConf(e,t){argsert("<string> [string]",[e,t],arguments.length);let r=null;const n=this[st](t||pe(this,me,"f"));if(n[e]&&typeof n[e]==="object"){r=applyExtends(n[e],t||pe(this,me,"f"),this[tt]()["deep-merge-config"]||false,pe(this,$e,"f"));pe(this,_e,"f").configObjects=(pe(this,_e,"f").configObjects||[]).concat(r)}return this}positional(e,t){argsert("<string> <object>",[e,t],arguments.length);const r=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];t=objFilter(t,((e,t)=>{if(e==="type"&&!["string","number","boolean"].includes(t))return false;return r.includes(e)}));const n=pe(this,ge,"f").fullCommands[pe(this,ge,"f").fullCommands.length-1];const o=n?pe(this,he,"f").cmdToParseOptions(n):{array:[],alias:{},default:{},demand:{}};objectKeys(o).forEach((r=>{const n=o[r];if(Array.isArray(n)){if(n.indexOf(e)!==-1)t[r]=true}else{if(n[e]&&!(r in t))t[r]=n[e]}}));this.group(e,pe(this,Ge,"f").getPositionalGroupName());return this.option(e,t)}recommendCommands(e=true){argsert("[boolean]",[e],arguments.length);de(this,Le,e,"f");return this}required(e,t,r){return this.demand(e,t,r)}require(e,t,r){return this.demand(e,t,r)}requiresArg(e){argsert("<array|string|object> [number]",[e],arguments.length);if(typeof e==="string"&&pe(this,_e,"f").narg[e]){return this}else{this[ut](this.requiresArg.bind(this),"narg",e,NaN)}return this}showCompletionScript(e,t){argsert("[string] [string]",[e,t],arguments.length);e=e||this.$0;pe(this,xe,"f").log(pe(this,De,"f").generateCompletionScript(e,t||pe(this,ye,"f")||"completion"));return this}showHelp(e){argsert("[string|function]",[e],arguments.length);de(this,Se,true,"f");if(!pe(this,Ge,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[St](pe(this,Ue,"f"),undefined,undefined,0,true);if(isPromise(t)){t.then((()=>{pe(this,Ge,"f").showHelp(e)}));return this}}const t=pe(this,he,"f").runDefaultBuilderOn(this);if(isPromise(t)){t.then((()=>{pe(this,Ge,"f").showHelp(e)}));return this}}pe(this,Ge,"f").showHelp(e);return this}scriptName(e){this.customScriptName=true;this.$0=e;return this}showHelpOnFail(e,t){argsert("[boolean|string] [string]",[e,t],arguments.length);pe(this,Ge,"f").showHelpOnFail(e,t);return this}showVersion(e){argsert("[string|function]",[e],arguments.length);pe(this,Ge,"f").showVersion(e);return this}skipValidation(e){argsert("<array|string>",[e],arguments.length);this[at]("skipValidation",e);return this}strict(e){argsert("[boolean]",[e],arguments.length);de(this,We,e!==false,"f");return this}strictCommands(e){argsert("[boolean]",[e],arguments.length);de(this,Ke,e!==false,"f");return this}strictOptions(e){argsert("[boolean]",[e],arguments.length);de(this,ze,e!==false,"f");return this}string(e){argsert("<array|string>",[e],arguments.length);this[at]("string",e);this[xt](e);return this}terminalWidth(){argsert([],0);return pe(this,$e,"f").process.stdColumns}updateLocale(e){return this.updateStrings(e)}updateStrings(e){argsert("<object>",[e],arguments.length);de(this,ve,false,"f");pe(this,$e,"f").y18n.updateLocale(e);return this}usage(e,t,r,n){argsert("<string|null|undefined> [string|boolean] [function|object] [function]",[e,t,r,n],arguments.length);if(t!==undefined){assertNotStrictEqual(e,null,pe(this,$e,"f"));if((e||"").match(/^\$0( |$)/)){return this.command(e,t,r,n)}else{throw new YError(".usage() description must start with $0 if being used as alias for .command()")}}else{pe(this,Ge,"f").usage(e);return this}}usageConfiguration(e){argsert("<object>",[e],arguments.length);de(this,He,e,"f");return this}version(e,t,r){const n="version";argsert("[boolean|string] [string] [string]",[e,t,r],arguments.length);if(pe(this,Ve,"f")){this[Xe](pe(this,Ve,"f"));pe(this,Ge,"f").version(undefined);de(this,Ve,null,"f")}if(arguments.length===0){r=this[ot]();e=n}else if(arguments.length===1){if(e===false){return this}r=e;e=n}else if(arguments.length===2){r=t;t=undefined}de(this,Ve,typeof e==="string"?e:n,"f");t=t||pe(this,Ge,"f").deferY18nLookup("Show version number");pe(this,Ge,"f").version(r||undefined);this.boolean(pe(this,Ve,"f"));this.describe(pe(this,Ve,"f"),t);return this}wrap(e){argsert("<number|null|undefined>",[e],arguments.length);pe(this,Ge,"f").wrap(e);return this}[(he=new WeakMap,me=new WeakMap,ge=new WeakMap,De=new WeakMap,ye=new WeakMap,be=new WeakMap,Ee=new WeakMap,ve=new WeakMap,we=new WeakMap,Fe=new WeakMap,Ce=new WeakMap,Ae=new WeakMap,Oe=new WeakMap,Se=new WeakMap,je=new WeakMap,ke=new WeakMap,xe=new WeakMap,Pe=new WeakMap,_e=new WeakMap,Ie=new WeakMap,Be=new WeakMap,Te=new WeakMap,Ne=new WeakMap,Me=new WeakMap,Re=new WeakMap,Ue=new WeakMap,Le=new WeakMap,$e=new WeakMap,We=new WeakMap,Ke=new WeakMap,ze=new WeakMap,Ge=new WeakMap,He=new WeakMap,Ve=new WeakMap,Je=new WeakMap,qe)](e){if(!e._||!e["--"])return e;e._.push.apply(e._,e["--"]);try{delete e["--"]}catch(e){}return e}[Ye](){return{log:(...e)=>{if(!this[wt]())console.log(...e);de(this,Se,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")},error:(...e)=>{if(!this[wt]())console.error(...e);de(this,Se,true,"f");if(pe(this,Pe,"f").length)de(this,Pe,pe(this,Pe,"f")+"\n","f");de(this,Pe,pe(this,Pe,"f")+e.join(" "),"f")}}}[Xe](e){objectKeys(pe(this,_e,"f")).forEach((t=>{if((e=>e==="configObjects")(t))return;const r=pe(this,_e,"f")[t];if(Array.isArray(r)){if(r.includes(e))r.splice(r.indexOf(e),1)}else if(typeof r==="object"){delete r[e]}}));delete pe(this,Ge,"f").getDescriptions()[e]}[Qe](e,t,r){if(!pe(this,we,"f")[r]){pe(this,$e,"f").process.emitWarning(e,t);pe(this,we,"f")[r]=true}}[Ze](){pe(this,Ce,"f").push({options:pe(this,_e,"f"),configObjects:pe(this,_e,"f").configObjects.slice(0),exitProcess:pe(this,Fe,"f"),groups:pe(this,Oe,"f"),strict:pe(this,We,"f"),strictCommands:pe(this,Ke,"f"),strictOptions:pe(this,ze,"f"),completionCommand:pe(this,ye,"f"),output:pe(this,Pe,"f"),exitError:pe(this,Ee,"f"),hasOutput:pe(this,Se,"f"),parsed:this.parsed,parseFn:pe(this,Te,"f"),parseContext:pe(this,Ne,"f")});pe(this,Ge,"f").freeze();pe(this,Je,"f").freeze();pe(this,he,"f").freeze();pe(this,Ae,"f").freeze()}[et](){let e="";let t;if(/\b(node|iojs|electron)(\.exe)?$/.test(pe(this,$e,"f").process.argv()[0])){t=pe(this,$e,"f").process.argv().slice(1,2)}else{t=pe(this,$e,"f").process.argv().slice(0,1)}e=t.map((e=>{const t=this[At](pe(this,me,"f"),e);return e.match(/^(\/|([a-zA-Z]:)?\\)/)&&t.length<e.length?t:e})).join(" ").trim();if(pe(this,$e,"f").getEnv("_")&&pe(this,$e,"f").getProcessArgvBin()===pe(this,$e,"f").getEnv("_")){e=pe(this,$e,"f").getEnv("_").replace(`${pe(this,$e,"f").path.dirname(pe(this,$e,"f").process.execPath())}/`,"")}return e}[tt](){return pe(this,Be,"f")}[rt](){return pe(this,He,"f")}[nt](){if(!pe(this,ve,"f"))return;const e=pe(this,$e,"f").getEnv("LC_ALL")||pe(this,$e,"f").getEnv("LC_MESSAGES")||pe(this,$e,"f").getEnv("LANG")||pe(this,$e,"f").getEnv("LANGUAGE")||"en_US";this.locale(e.replace(/[.:].*/,""))}[ot](){const e=this[st]();return e.version||"unknown"}[it](e){const t=e["--"]?e["--"]:e._;for(let e=0,r;(r=t[e])!==undefined;e++){if(pe(this,$e,"f").Parser.looksLikeNumber(r)&&Number.isSafeInteger(Math.floor(parseFloat(`${r}`)))){t[e]=Number(r)}}return e}[st](e){const t=e||"*";if(pe(this,Me,"f")[t])return pe(this,Me,"f")[t];let r={};try{let t=e||pe(this,$e,"f").mainFilename;if(pe(this,$e,"f").path.extname(t)){t=pe(this,$e,"f").path.dirname(t)}const n=pe(this,$e,"f").findUp(t,((e,t)=>{if(t.includes("package.json")){return"package.json"}else{return undefined}}));assertNotStrictEqual(n,undefined,pe(this,$e,"f"));r=JSON.parse(pe(this,$e,"f").readFileSync(n,"utf8"))}catch(e){}pe(this,Me,"f")[t]=r||{};return pe(this,Me,"f")[t]}[at](e,t){t=[].concat(t);t.forEach((t=>{t=this[ft](t);pe(this,_e,"f")[e].push(t)}))}[ut](e,t,r,n){this[lt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=r}))}[ct](e,t,r,n){this[lt](e,t,r,n,((e,t,r)=>{pe(this,_e,"f")[e][t]=(pe(this,_e,"f")[e][t]||[]).concat(r)}))}[lt](e,t,r,n,o){if(Array.isArray(r)){r.forEach((t=>{e(t,n)}))}else if((e=>typeof e==="object")(r)){for(const t of objectKeys(r)){e(t,r[t])}}else{o(t,this[ft](r),n)}}[ft](e){if(e==="__proto__")return"___proto___";return e}[dt](e,t){this[ut](this[dt].bind(this),"key",e,t);return this}[pt](){var e,t,r,n,o,i,s,a,u,c,l,f;const d=pe(this,Ce,"f").pop();assertNotStrictEqual(d,undefined,pe(this,$e,"f"));let p;e=this,t=this,r=this,n=this,o=this,i=this,s=this,a=this,u=this,c=this,l=this,f=this,({options:{set value(t){de(e,_e,t,"f")}}.value,configObjects:p,exitProcess:{set value(e){de(t,Fe,e,"f")}}.value,groups:{set value(e){de(r,Oe,e,"f")}}.value,output:{set value(e){de(n,Pe,e,"f")}}.value,exitError:{set value(e){de(o,Ee,e,"f")}}.value,hasOutput:{set value(e){de(i,Se,e,"f")}}.value,parsed:this.parsed,strict:{set value(e){de(s,We,e,"f")}}.value,strictCommands:{set value(e){de(a,Ke,e,"f")}}.value,strictOptions:{set value(e){de(u,ze,e,"f")}}.value,completionCommand:{set value(e){de(c,ye,e,"f")}}.value,parseFn:{set value(e){de(l,Te,e,"f")}}.value,parseContext:{set value(e){de(f,Ne,e,"f")}}.value}=d);pe(this,_e,"f").configObjects=p;pe(this,Ge,"f").unfreeze();pe(this,Je,"f").unfreeze();pe(this,he,"f").unfreeze();pe(this,Ae,"f").unfreeze()}[ht](e,t){return maybeAsyncResult(t,(t=>{e(t);return t}))}getInternalMethods(){return{getCommandInstance:this[mt].bind(this),getContext:this[gt].bind(this),getHasOutput:this[Dt].bind(this),getLoggerInstance:this[yt].bind(this),getParseContext:this[bt].bind(this),getParserConfiguration:this[tt].bind(this),getUsageConfiguration:this[rt].bind(this),getUsageInstance:this[Et].bind(this),getValidationInstance:this[vt].bind(this),hasParseCallback:this[wt].bind(this),isGlobalContext:this[Ft].bind(this),postProcess:this[Ct].bind(this),reset:this[Ot].bind(this),runValidation:this[jt].bind(this),runYargsParserAndExecuteCommands:this[St].bind(this),setHasOutput:this[kt].bind(this)}}[mt](){return pe(this,he,"f")}[gt](){return pe(this,ge,"f")}[Dt](){return pe(this,Se,"f")}[yt](){return pe(this,xe,"f")}[bt](){return pe(this,Ne,"f")||{}}[Et](){return pe(this,Ge,"f")}[vt](){return pe(this,Je,"f")}[wt](){return!!pe(this,Te,"f")}[Ft](){return pe(this,ke,"f")}[Ct](e,t,r,n){if(r)return e;if(isPromise(e))return e;if(!t){e=this[qe](e)}const o=this[tt]()["parse-positional-numbers"]||this[tt]()["parse-positional-numbers"]===undefined;if(o){e=this[it](e)}if(n){e=applyMiddleware(e,this,pe(this,Ae,"f").getMiddleware(),false)}return e}[Ot](e={}){de(this,_e,pe(this,_e,"f")||{},"f");const t={};t.local=pe(this,_e,"f").local||[];t.configObjects=pe(this,_e,"f").configObjects||[];const r={};t.local.forEach((t=>{r[t]=true;(e[t]||[]).forEach((e=>{r[e]=true}))}));Object.assign(pe(this,Re,"f"),Object.keys(pe(this,Oe,"f")).reduce(((e,t)=>{const n=pe(this,Oe,"f")[t].filter((e=>!(e in r)));if(n.length>0){e[t]=n}return e}),{}));de(this,Oe,{},"f");const n=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"];const o=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];n.forEach((e=>{t[e]=(pe(this,_e,"f")[e]||[]).filter((e=>!r[e]))}));o.forEach((e=>{t[e]=objFilter(pe(this,_e,"f")[e],(e=>!r[e]))}));t.envPrefix=pe(this,_e,"f").envPrefix;de(this,_e,t,"f");de(this,Ge,pe(this,Ge,"f")?pe(this,Ge,"f").reset(r):usage(this,pe(this,$e,"f")),"f");de(this,Je,pe(this,Je,"f")?pe(this,Je,"f").reset(r):validation(this,pe(this,Ge,"f"),pe(this,$e,"f")),"f");de(this,he,pe(this,he,"f")?pe(this,he,"f").reset():command(pe(this,Ge,"f"),pe(this,Je,"f"),pe(this,Ae,"f"),pe(this,$e,"f")),"f");if(!pe(this,De,"f"))de(this,De,completion(this,pe(this,Ge,"f"),pe(this,he,"f"),pe(this,$e,"f")),"f");pe(this,Ae,"f").reset();de(this,ye,null,"f");de(this,Pe,"","f");de(this,Ee,null,"f");de(this,Se,false,"f");this.parsed=false;return this}[At](e,t){return pe(this,$e,"f").path.relative(e,t)}[St](e,t,r,n=0,o=false){var i,s,a,u;let c=!!r||o;e=e||pe(this,Ue,"f");pe(this,_e,"f").__=pe(this,$e,"f").y18n.__;pe(this,_e,"f").configuration=this[tt]();const l=!!pe(this,_e,"f").configuration["populate--"];const f=Object.assign({},pe(this,_e,"f").configuration,{"populate--":true});const d=pe(this,$e,"f").Parser.detailed(e,Object.assign({},pe(this,_e,"f"),{configuration:{"parse-positional-numbers":false,...f}}));const p=Object.assign(d.argv,pe(this,Ne,"f"));let h=undefined;const m=d.aliases;let g=false;let D=false;Object.keys(p).forEach((e=>{if(e===pe(this,je,"f")&&p[e]){g=true}else if(e===pe(this,Ve,"f")&&p[e]){D=true}}));p.$0=this.$0;this.parsed=d;if(n===0){pe(this,Ge,"f").clearCachedHelpMessage()}try{this[nt]();if(t){return this[Ct](p,l,!!r,false)}if(pe(this,je,"f")){const e=[pe(this,je,"f")].concat(m[pe(this,je,"f")]||[]).filter((e=>e.length>1));if(e.includes(""+p._[p._.length-1])){p._.pop();g=true}}de(this,ke,false,"f");const f=pe(this,he,"f").getCommands();const y=((i=pe(this,De,"f"))===null||i===void 0?void 0:i.completionKey)?[(s=pe(this,De,"f"))===null||s===void 0?void 0:s.completionKey,...(u=this.getAliases()[(a=pe(this,De,"f"))===null||a===void 0?void 0:a.completionKey])!==null&&u!==void 0?u:[]].some((e=>Object.prototype.hasOwnProperty.call(p,e))):false;const b=g||y||o;if(p._.length){if(f.length){let e;for(let t=n||0,i;p._[t]!==undefined;t++){i=String(p._[t]);if(f.includes(i)&&i!==pe(this,ye,"f")){const e=pe(this,he,"f").runCommand(i,this,d,t+1,o,g||D||o);return this[Ct](e,l,!!r,false)}else if(!e&&i!==pe(this,ye,"f")){e=i;break}}if(!pe(this,he,"f").hasDefaultCommand()&&pe(this,Le,"f")&&e&&!b){pe(this,Je,"f").recommendCommands(e,f)}}if(pe(this,ye,"f")&&p._.includes(pe(this,ye,"f"))&&!y){if(pe(this,Fe,"f"))setBlocking(true);this.showCompletionScript();this.exit(0)}}if(pe(this,he,"f").hasDefaultCommand()&&!b){const e=pe(this,he,"f").runCommand(null,this,d,0,o,g||D||o);return this[Ct](e,l,!!r,false)}if(y){if(pe(this,Fe,"f"))setBlocking(true);e=[].concat(e);const t=e.slice(e.indexOf(`--${pe(this,De,"f").completionKey}`)+1);pe(this,De,"f").getCompletion(t,((e,t)=>{if(e)throw new YError(e.message);(t||[]).forEach((e=>{pe(this,xe,"f").log(e)}));this.exit(0)}));return this[Ct](p,!l,!!r,false)}if(!pe(this,Se,"f")){if(g){if(pe(this,Fe,"f"))setBlocking(true);c=true;this.showHelp((e=>{pe(this,xe,"f").log(e);this.exit(0)}))}else if(D){if(pe(this,Fe,"f"))setBlocking(true);c=true;pe(this,Ge,"f").showVersion("log");this.exit(0)}}if(!c&&pe(this,_e,"f").skipValidation.length>0){c=Object.keys(p).some((e=>pe(this,_e,"f").skipValidation.indexOf(e)>=0&&p[e]===true))}if(!c){if(d.error)throw new YError(d.error.message);if(!y){const e=this[jt](m,{},d.error);if(!r){h=applyMiddleware(p,this,pe(this,Ae,"f").getMiddleware(),true)}h=this[ht](e,h!==null&&h!==void 0?h:p);if(isPromise(h)&&!r){h=h.then((()=>applyMiddleware(p,this,pe(this,Ae,"f").getMiddleware(),false)))}}}}catch(e){if(e instanceof YError)pe(this,Ge,"f").fail(e.message,e);else throw e}return this[Ct](h!==null&&h!==void 0?h:p,l,!!r,true)}[jt](e,t,r,n){const o={...this.getDemandedOptions()};return i=>{if(r)throw new YError(r.message);pe(this,Je,"f").nonOptionCount(i);pe(this,Je,"f").requiredArguments(i,o);let s=false;if(pe(this,Ke,"f")){s=pe(this,Je,"f").unknownCommands(i)}if(pe(this,We,"f")&&!s){pe(this,Je,"f").unknownArguments(i,e,t,!!n)}else if(pe(this,ze,"f")){pe(this,Je,"f").unknownArguments(i,e,{},false,false)}pe(this,Je,"f").limitedChoices(i);pe(this,Je,"f").implications(i);pe(this,Je,"f").conflicting(i)}}[kt](){de(this,Se,true,"f")}[xt](e){if(typeof e==="string"){pe(this,_e,"f").key[e]=true}else{for(const t of e){pe(this,_e,"f").key[t]=true}}}}function isYargsInstance(e){return!!e&&typeof e.getInternalMethods==="function"}const _t=YargsFactory(oe);const It=_t}};var r={};function __nccwpck_require__(e){var n=r[e];if(n!==undefined){return n.exports}var o=r[e]={exports:{}};var i=true;try{t[e](o,o.exports,__nccwpck_require__);i=false}finally{if(i)delete r[e]}return o.exports}(()=>{var e=typeof Symbol==="function"?Symbol("webpack queues"):"__webpack_queues__";var t=typeof Symbol==="function"?Symbol("webpack exports"):"__webpack_exports__";var r=typeof Symbol==="function"?Symbol("webpack error"):"__webpack_error__";var resolveQueue=e=>{if(e&&e.d<1){e.d=1;e.forEach((e=>e.r--));e.forEach((e=>e.r--?e.r++:e()))}};var wrapDeps=n=>n.map((n=>{if(n!==null&&typeof n==="object"){if(n[e])return n;if(n.then){var o=[];o.d=0;n.then((e=>{i[t]=e;resolveQueue(o)}),(e=>{i[r]=e;resolveQueue(o)}));var i={};i[e]=e=>e(o);return i}}var s={};s[e]=e=>{};s[t]=n;return s}));__nccwpck_require__.a=(n,o,i)=>{var s;i&&((s=[]).d=-1);var a=new Set;var u=n.exports;var c;var l;var f;var d=new Promise(((e,t)=>{f=t;l=e}));d[t]=u;d[e]=e=>(s&&e(s),a.forEach(e),d["catch"]((e=>{})));n.exports=d;o((n=>{c=wrapDeps(n);var o;var getResult=()=>c.map((e=>{if(e[r])throw e[r];return e[t]}));var i=new Promise((t=>{o=()=>t(getResult);o.r=0;var fnQueue=e=>e!==s&&!a.has(e)&&(a.add(e),e&&!e.d&&(o.r++,e.push(o)));c.map((t=>t[e](fnQueue)))}));return o.r?i:getResult()}),(e=>(e?f(d[r]=e):l(u),resolveQueue(s))));s&&s.d<0&&(s.d=0)}})();(()=>{__nccwpck_require__.n=e=>{var t=e&&e.__esModule?()=>e["default"]:()=>e;__nccwpck_require__.d(t,{a:t});return t}})();(()=>{__nccwpck_require__.d=(e,t)=>{for(var r in t){if(__nccwpck_require__.o(t,r)&&!__nccwpck_require__.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:t[r]})}}}})();(()=>{__nccwpck_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var n=__nccwpck_require__(719);n=await n;
|