UNPKG

cloudstudio

Version:

Run VS Code on a remote server.

2 lines 411 kB
/*! For license information please see watchdog.bundle.js.LICENSE.txt */ (()=>{var e={9850:(e,t,r)=>{"use strict";const o=r(1017),n=r(2081),i=r(6939),s=r(4521),a=r(5191),c=r(2106),p=r(8662),d=r(405),{spawnedKill:u,spawnedCancel:l,setupTimeout:f,validateTimeout:m,setExitHandler:y}=r(4027),{handleInput:h,getSpawnedResult:b,makeAllStream:g,validateInputSync:w}=r(433),{mergePromise:v,getSpawnedPromise:k}=r(514),{joinCommand:_,parseCommand:S,getEscapedCommand:P}=r(4586),M=(e,t,r={})=>{const n=i._parse(e,t,r);return e=n.command,t=n.args,(r={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(r=n.options).cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r}).env=(({env:e,extendEnv:t,preferLocal:r,localDir:o,execPath:n})=>{const i=t?{...process.env,...e}:e;return r?a.env({env:i,cwd:o,execPath:n}):i})(r),r.stdio=d(r),"win32"===process.platform&&"cmd"===o.basename(e,".exe")&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},C=(e,t,r)=>"string"==typeof t||Buffer.isBuffer(t)?e.stripFinalNewline?s(t):t:void 0===r?void 0:"",F=(e,t,r)=>{const o=M(e,t,r),i=_(e,t),s=P(e,t);let a;m(o.options);try{a=n.spawn(o.file,o.args,o.options)}catch(e){const t=new n.ChildProcess,r=Promise.reject(p({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:!1,isCanceled:!1,killed:!1}));return v(t,r)}const d=k(a),w=f(a,o.options,d),S=y(a,o.options,w),F={isCanceled:!1};a.kill=u.bind(null,a.kill.bind(a)),a.cancel=l.bind(null,a,F);const D=c((async()=>{const[{error:e,exitCode:t,signal:r,timedOut:n},c,d,u]=await b(a,o.options,S),l=C(o.options,c),f=C(o.options,d),m=C(o.options,u);if(e||0!==t||null!==r){const c=p({error:e,exitCode:t,signal:r,stdout:l,stderr:f,all:m,command:i,escapedCommand:s,parsed:o,timedOut:n,isCanceled:F.isCanceled,killed:a.killed});if(!o.options.reject)return c;throw c}return{command:i,escapedCommand:s,exitCode:0,stdout:l,stderr:f,all:m,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return h(a,o.options.input),a.all=g(a,o.options),v(a,D)};e.exports=F,e.exports.sync=(e,t,r)=>{const o=M(e,t,r),i=_(e,t),s=P(e,t);let a;w(o.options);try{a=n.spawnSync(o.file,o.args,o.options)}catch(e){throw p({error:e,stdout:"",stderr:"",all:"",command:i,escapedCommand:s,parsed:o,timedOut:!1,isCanceled:!1,killed:!1})}const c=C(o.options,a.stdout,a.error),d=C(o.options,a.stderr,a.error);if(a.error||0!==a.status||null!==a.signal){const e=p({stdout:c,stderr:d,error:a.error,signal:a.signal,exitCode:a.status,command:i,escapedCommand:s,parsed:o,timedOut:a.error&&"ETIMEDOUT"===a.error.code,isCanceled:!1,killed:null!==a.signal});if(!o.options.reject)return e;throw e}return{command:i,escapedCommand:s,exitCode:0,stdout:c,stderr:d,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},e.exports.command=(e,t)=>{const[r,...o]=S(e);return F(r,o,t)},e.exports.commandSync=(e,t)=>{const[r,...o]=S(e);return F.sync(r,o,t)},e.exports.node=(e,t,r={})=>{t&&!Array.isArray(t)&&"object"==typeof t&&(r=t,t=[]);const o=d.node(r),n=process.execArgv.filter((e=>!e.startsWith("--inspect"))),{nodePath:i=process.execPath,nodeOptions:s=n}=r;return F(i,[...s,e,...Array.isArray(t)?t:[]],{...r,stdin:void 0,stdout:void 0,stderr:void 0,stdio:o,shell:!1})}},4586:e=>{"use strict";const t=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],r=/^[\w.-]+$/,o=/"/g,n=/ +/g;e.exports={joinCommand:(e,r)=>t(e,r).join(" "),getEscapedCommand:(e,n)=>t(e,n).map((e=>(e=>"string"!=typeof e||r.test(e)?e:`"${e.replace(o,'\\"')}"`)(e))).join(" "),parseCommand:e=>{const t=[];for(const r of e.trim().split(n)){const e=t[t.length-1];e&&e.endsWith("\\")?t[t.length-1]=`${e.slice(0,-1)} ${r}`:t.push(r)}return t}}},8662:(e,t,r)=>{"use strict";const{signalsByName:o}=r(3808);e.exports=({stdout:e,stderr:t,all:r,error:n,signal:i,exitCode:s,command:a,escapedCommand:c,timedOut:p,isCanceled:d,killed:u,parsed:{options:{timeout:l}}})=>{s=null===s?void 0:s;const f=void 0===(i=null===i?void 0:i)?void 0:o[i].description,m=(({timedOut:e,timeout:t,errorCode:r,signal:o,signalDescription:n,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":void 0!==r?`failed with ${r}`:void 0!==o?`was killed with ${o} (${n})`:void 0!==i?`failed with exit code ${i}`:"failed")({timedOut:p,timeout:l,errorCode:n&&n.code,signal:i,signalDescription:f,exitCode:s,isCanceled:d}),y=`Command ${m}: ${a}`,h="[object Error]"===Object.prototype.toString.call(n),b=h?`${y}\n${n.message}`:y,g=[b,t,e].filter(Boolean).join("\n");return h?(n.originalMessage=n.message,n.message=g):n=new Error(g),n.shortMessage=b,n.command=a,n.escapedCommand=c,n.exitCode=s,n.signal=i,n.signalDescription=f,n.stdout=e,n.stderr=t,void 0!==r&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(p),n.isCanceled=d,n.killed=u&&!p,n}},4027:(e,t,r)=>{"use strict";const o=r(2037),n=r(3973),i=(e,{forceKillAfterTimeout:t},r)=>s(e)&&!1!==t&&r,s=e=>e===o.constants.signals.SIGTERM||"string"==typeof e&&"SIGTERM"===e.toUpperCase(),a=({forceKillAfterTimeout:e=!0})=>{if(!0===e)return 5e3;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};e.exports={spawnedKill:(e,t="SIGTERM",r={})=>{const o=e(t);return((e,t,r,o)=>{if(!i(t,r,o))return;const n=a(r),s=setTimeout((()=>{e("SIGKILL")}),n);s.unref&&s.unref()})(e,t,r,o),o},spawnedCancel:(e,t)=>{e.kill()&&(t.isCanceled=!0)},setupTimeout:(e,{timeout:t,killSignal:r="SIGTERM"},o)=>{if(0===t||void 0===t)return o;let n;const i=new Promise(((o,i)=>{n=setTimeout((()=>{((e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))})(e,r,i)}),t)})),s=o.finally((()=>{clearTimeout(n)}));return Promise.race([i,s])},validateTimeout:({timeout:e})=>{if(void 0!==e&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},setExitHandler:async(e,{cleanup:t,detached:r},o)=>{if(!t||r)return o;const i=n((()=>{e.kill()}));return o.finally((()=>{i()}))}}},514:e=>{"use strict";const t=(async()=>{})().constructor.prototype,r=["then","catch","finally"].map((e=>[e,Reflect.getOwnPropertyDescriptor(t,e)]));e.exports={mergePromise:(e,t)=>{for(const[o,n]of r){const r="function"==typeof t?(...e)=>Reflect.apply(n.value,t(),e):n.value.bind(t);Reflect.defineProperty(e,o,{...n,value:r})}return e},getSpawnedPromise:e=>new Promise(((t,r)=>{e.on("exit",((e,r)=>{t({exitCode:e,signal:r})})),e.on("error",(e=>{r(e)})),e.stdin&&e.stdin.on("error",(e=>{r(e)}))}))}},405:e=>{"use strict";const t=["stdin","stdout","stderr"],r=e=>{if(!e)return;const{stdio:r}=e;if(void 0===r)return t.map((t=>e[t]));if((e=>t.some((t=>void 0!==e[t])))(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${t.map((e=>`\`${e}\``)).join(", ")}`);if("string"==typeof r)return r;if(!Array.isArray(r))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof r}\``);const o=Math.max(r.length,t.length);return Array.from({length:o},((e,t)=>r[t]))};e.exports=r,e.exports.node=e=>{const t=r(e);return"ipc"===t?"ipc":void 0===t||"string"==typeof t?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}},433:(e,t,r)=>{"use strict";const o=r(2240),n=r(3743),i=r(1779),s=async(e,t)=>{if(e){e.destroy();try{return await t}catch(e){return e.bufferedData}}},a=(e,{encoding:t,buffer:r,maxBuffer:o})=>{if(e&&r)return t?n(e,{encoding:t,maxBuffer:o}):n.buffer(e,{maxBuffer:o})};e.exports={handleInput:(e,t)=>{void 0!==t&&void 0!==e.stdin&&(o(t)?t.pipe(e.stdin):e.stdin.end(t))},makeAllStream:(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;const r=i();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},getSpawnedResult:async({stdout:e,stderr:t,all:r},{encoding:o,buffer:n,maxBuffer:i},c)=>{const p=a(e,{encoding:o,buffer:n,maxBuffer:i}),d=a(t,{encoding:o,buffer:n,maxBuffer:i}),u=a(r,{encoding:o,buffer:n,maxBuffer:2*i});try{return await Promise.all([c,p,d,u])}catch(o){return Promise.all([{error:o,signal:o.signal,timedOut:o.timedOut},s(e,p),s(t,d),s(r,u)])}},validateInputSync:({input:e})=>{if(o(e))throw new TypeError("The `input` option cannot be a stream in sync mode")}}},6939:(e,t,r)=>{"use strict";const o=r(2081),n=r(9672),i=r(9357);function s(e,t,r){const s=n(e,t,r),a=o.spawn(s.command,s.args,s.options);return i.hookChildProcess(a,s),a}e.exports=s,e.exports.spawn=s,e.exports.sync=function(e,t,r){const s=n(e,t,r),a=o.spawnSync(s.command,s.args,s.options);return a.error=a.error||i.verifyENOENTSync(a.status,s),a},e.exports._parse=n,e.exports._enoent=i},9357:e=>{"use strict";const t="win32"===process.platform;function r(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 o(e,o){return t&&1===e&&!o.file?r(o.original,"spawn"):null}e.exports={hookChildProcess:function(e,r){if(!t)return;const n=e.emit;e.emit=function(t,i){if("exit"===t){const t=o(i,r);if(t)return n.call(e,"error",t)}return n.apply(e,arguments)}},verifyENOENT:o,verifyENOENTSync:function(e,o){return t&&1===e&&!o.file?r(o.original,"spawnSync"):null},notFoundError:r}},9672:(e,t,r)=>{"use strict";const o=r(1017),n=r(7515),i=r(4454),s=r(8313),a="win32"===process.platform,c=/\.(?:com|exe)$/i,p=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;e.exports=function(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null);const d={command:e,args:t=t?t.slice(0):[],options:r=Object.assign({},r),file:void 0,original:{command:e,args:t}};return r.shell?d:function(e){if(!a)return e;const t=function(e){e.file=n(e);const t=e.file&&s(e.file);return t?(e.args.unshift(e.file),e.command=t,n(e)):e.file}(e),r=!c.test(t);if(e.options.forceShell||r){const r=p.test(t);e.command=o.normalize(e.command),e.command=i.command(e.command),e.args=e.args.map((e=>i.argument(e,r)));const n=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${n}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}(d)}},4454:e=>{"use strict";const t=/([()\][%!^"`<>&|;, *?])/g;e.exports.command=function(e){return e.replace(t,"^$1")},e.exports.argument=function(e,r){return e=(e=`"${e=(e=(e=`${e}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(t,"^$1"),r&&(e=e.replace(t,"^$1")),e}},8313:(e,t,r)=>{"use strict";const o=r(7147),n=r(1857);e.exports=function(e){const t=Buffer.alloc(150);let r;try{r=o.openSync(e,"r"),o.readSync(r,t,0,150,0),o.closeSync(r)}catch(e){}return n(t.toString())}},7515:(e,t,r)=>{"use strict";const o=r(1017),n=r(6754),i=r(1915);function s(e,t){const r=e.options.env||process.env,s=process.cwd(),a=null!=e.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(e.options.cwd)}catch(e){}let p;try{p=n.sync(e.command,{path:r[i({env:r})],pathExt:t?o.delimiter:void 0})}catch(e){}finally{c&&process.chdir(s)}return p&&(p=o.resolve(a?e.options.cwd:"",p)),p}e.exports=function(e){return s(e)||s(e,!0)}},1915:e=>{"use strict";const t=(e={})=>{const t=e.env||process.env;return"win32"!==(e.platform||process.platform)?"PATH":Object.keys(t).reverse().find((e=>"PATH"===e.toUpperCase()))||"Path"};e.exports=t,e.exports.default=t},1857:(e,t,r)=>{"use strict";const o=r(5394);e.exports=(e="")=>{const t=e.match(o);if(!t)return null;const[r,n]=t[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return"env"===i?n:n?`${i} ${n}`:i}},5394:e=>{"use strict";e.exports=/^#!(.*)/},6754:(e,t,r)=>{const o="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,n=r(1017),i=o?";":":",s=r(4219),a=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),c=(e,t)=>{const r=t.colon||i,n=e.match(/\//)||o&&e.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],s=o?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=o?s.split(r):[""];return o&&-1!==e.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:n,pathExt:a,pathExtExe:s}},p=(e,t,r)=>{"function"==typeof t&&(r=t,t={}),t||(t={});const{pathEnv:o,pathExt:i,pathExtExe:p}=c(e,t),d=[],u=r=>new Promise(((i,s)=>{if(r===o.length)return t.all&&d.length?i(d):s(a(e));const c=o[r],p=/^".*"$/.test(c)?c.slice(1,-1):c,u=n.join(p,e),f=!p&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;i(l(f,r,0))})),l=(e,r,o)=>new Promise(((n,a)=>{if(o===i.length)return n(u(r+1));const c=i[o];s(e+c,{pathExt:p},((i,s)=>{if(!i&&s){if(!t.all)return n(e+c);d.push(e+c)}return n(l(e,r,o+1))}))}));return r?u(0).then((e=>r(null,e)),r):u(0)};e.exports=p,p.sync=(e,t)=>{t=t||{};const{pathEnv:r,pathExt:o,pathExtExe:i}=c(e,t),p=[];for(let a=0;a<r.length;a++){const c=r[a],d=/^".*"$/.test(c)?c.slice(1,-1):c,u=n.join(d,e),l=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let e=0;e<o.length;e++){const r=l+o[e];try{if(s.sync(r,{pathExt:i})){if(!t.all)return r;p.push(r)}}catch(e){}}}if(t.all&&p.length)return p;if(t.nothrow)return null;throw a(e)}},4185:(e,t,r)=>{"use strict";const{PassThrough:o}=r(2781);e.exports=e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const n="buffer"===r;let i=!1;t?i=!(r||n):r=r||"utf8",n&&(r=null);const s=new o({objectMode:i});r&&s.setEncoding(r);let a=0;const c=[];return s.on("data",(e=>{c.push(e),i?a=c.length:a+=e.length})),s.getBufferedValue=()=>t?c:n?Buffer.concat(c,a):c.join(""),s.getBufferedLength=()=>a,s}},3743:(e,t,r)=>{"use strict";const{constants:o}=r(4300),n=r(2781),{promisify:i}=r(3837),s=r(4185),a=i(n.pipeline);class c extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function p(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};const{maxBuffer:r}=t,n=s(t);return await new Promise(((t,i)=>{const s=e=>{e&&n.getBufferedLength()<=o.MAX_LENGTH&&(e.bufferedData=n.getBufferedValue()),i(e)};(async()=>{try{await a(e,n),t()}catch(e){s(e)}})(),n.on("data",(()=>{n.getBufferedLength()>r&&s(new c)}))})),n.getBufferedValue()}e.exports=p,e.exports.buffer=(e,t)=>p(e,{...t,encoding:"buffer"}),e.exports.array=(e,t)=>p(e,{...t,array:!0}),e.exports.MaxBufferError=c},3909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SIGNALS=void 0,t.SIGNALS=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",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"}]},3808:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.signalsByNumber=t.signalsByName=void 0;var o=r(2037),n=r(8175),i=r(1776);const s=(0,n.getSignals)().reduce((function(e,{name:t,number:r,description:o,supported:n,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:r,description:o,supported:n,action:i,forced:s,standard:a}}}),{});t.signalsByName=s;const a=function(e,t){const r=t.find((({name:t})=>o.constants.signals[t]===e));return void 0!==r?r:t.find((t=>t.number===e))},c=function(){const e=(0,n.getSignals)(),t=i.SIGRTMAX+1,r=Array.from({length:t},((t,r)=>function(e,t){const r=a(e,t);if(void 0===r)return{};const{name:o,description:n,supported:i,action:s,forced:c,standard:p}=r;return{[e]:{name:o,number:e,description:n,supported:i,action:s,forced:c,standard:p}}}(r,e)));return Object.assign({},...r)}();t.signalsByNumber=c},1776:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SIGRTMAX=t.getRealtimeSignals=void 0,t.getRealtimeSignals=function(){const e=n-o+1;return Array.from({length:e},r)};const r=function(e,t){return{name:`SIGRT${t+1}`,number:o+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},o=34,n=64;t.SIGRTMAX=n},8175:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSignals=void 0;var o=r(2037),n=r(3909),i=r(1776);t.getSignals=function(){const e=(0,i.getRealtimeSignals)();return[...n.SIGNALS,...e].map(s)};const s=function({name:e,number:t,description:r,action:n,forced:i=!1,standard:s}){const{signals:{[e]:a}}=o.constants,c=void 0!==a;return{name:e,number:c?a:t,description:r,supported:c,action:n,forced:i,standard:s}}},5053:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AsyncContainerModule:()=>Ge,BindingScopeEnum:()=>b,BindingTypeEnum:()=>g,Container:()=>Be,ContainerModule:()=>Ne,LazyServiceIdentifer:()=>B,METADATA_KEY:()=>at,MetadataReader:()=>T,TargetTypeEnum:()=>w,createTaggedDecorator:()=>Ue,decorate:()=>Ke,getServiceIdentifierAsString:()=>j,id:()=>k,inject:()=>Qe,injectable:()=>ze,interfaces:()=>nt,multiBindToService:()=>ne,multiInject:()=>tt,named:()=>Xe,namedConstraint:()=>Pe,optional:()=>Ze,postConstruct:()=>it,preDestroy:()=>st,tagged:()=>Ye,taggedConstraint:()=>Se,targetName:()=>rt,traverseAncerstors:()=>_e,typeConstraint:()=>Me,unmanaged:()=>et});var o={};r.r(o),r.d(o,{DESIGN_PARAM_TYPES:()=>f,INJECT_TAG:()=>c,MULTI_INJECT_TAG:()=>p,NAMED_TAG:()=>n,NAME_TAG:()=>i,NON_CUSTOM_TAG_KEYS:()=>h,OPTIONAL_TAG:()=>a,PARAM_TYPES:()=>l,POST_CONSTRUCT:()=>m,PRE_DESTROY:()=>y,TAGGED:()=>d,TAGGED_PROP:()=>u,UNMANAGED_TAG:()=>s});var n="named",i="name",s="unmanaged",a="optional",c="inject",p="multi_inject",d="inversify:tagged",u="inversify:tagged_props",l="inversify:paramtypes",f="design:paramtypes",m="post_construct",y="pre_destroy",h=[c,p,i,s,n,a],b={Request:"Request",Singleton:"Singleton",Transient:"Transient"},g={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},w={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},v=0;function k(){return v++}var _=function(){function e(e,t){this.id=k(),this.activated=!1,this.serviceIdentifier=e,this.scope=t,this.type=g.Invalid,this.constraint=function(e){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===b.Singleton&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t},e}(),S="Metadata key was used more than once in a parameter:",P="NULL argument",M="Key Not Found",C="Missing required @injectable annotation in:",F="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",D=function(e,t){return"onDeactivation() error in class "+e+": "+t},T=function(){function e(){}return e.prototype.getConstructorMetadata=function(e){return{compilerGeneratedMetadata:Reflect.getMetadata(l,e),userGeneratedMetadata:Reflect.getMetadata(d,e)||{}}},e.prototype.getPropertiesMetadata=function(e){return Reflect.getMetadata(u,e)||[]},e}();function x(e){return e instanceof RangeError||"Maximum call stack size exceeded"===e.message}function j(e){return"function"==typeof e?e.name:"symbol"==typeof e?e.toString():e}function A(e,t,r){var o="",n=r(e,t);return 0!==n.length&&(o="\nRegistered bindings:",n.forEach((function(e){var t="Object";null!==e.implementationType&&(t=R(e.implementationType)),o=o+"\n "+t,e.constraint.metaData&&(o=o+" - "+e.constraint.metaData)}))),o}function E(e,t){return null!==e.parentRequest&&(e.parentRequest.serviceIdentifier===t||E(e.parentRequest,t))}function O(e){e.childRequests.forEach((function(e){if(E(e,e.serviceIdentifier)){var t=function(e){return function e(t,r){void 0===r&&(r=[]);var o=j(t.serviceIdentifier);return r.push(o),null!==t.parentRequest?e(t.parentRequest,r):r}(e).reverse().join(" --\x3e ")}(e);throw new Error("Circular dependency found: "+t)}O(e)}))}function R(e){if(e.name)return e.name;var t=e.toString(),r=t.match(/^function\s*([^\s(]+)/);return r?r[1]:"Anonymous function: "+t}var $=function(){function e(e){this.id=k(),this.container=e}return e.prototype.addPlan=function(e){this.plan=e},e.prototype.setCurrentRequest=function(e){this.currentRequest=e},e}(),I=function(){function e(e,t){this.key=e,this.value=t}return e.prototype.toString=function(){return this.key===n?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},e}(),L=function(e,t){this.parentContext=e,this.rootRequest=t},B=function(){function e(e){this._cb=e}return e.prototype.unwrap=function(){return this._cb()},e}(),N=function(){function e(e){this.str=e}return e.prototype.startsWith=function(e){return 0===this.str.indexOf(e)},e.prototype.endsWith=function(e){var t,r=e.split("").reverse().join("");return t=this.str.split("").reverse().join(""),this.startsWith.call({str:t},r)},e.prototype.contains=function(e){return-1!==this.str.indexOf(e)},e.prototype.equals=function(e){return this.str===e},e.prototype.value=function(){return this.str},e}(),G=function(){function e(e,t,r,o){this.id=k(),this.type=e,this.serviceIdentifier=r;var i="symbol"==typeof t?t.toString().slice(7,-1):t;this.name=new N(i||""),this.identifier=t,this.metadata=new Array;var s=null;"string"==typeof o?s=new I(n,o):o instanceof I&&(s=o),null!==s&&this.metadata.push(s)}return e.prototype.hasTag=function(e){for(var t=0,r=this.metadata;t<r.length;t++)if(r[t].key===e)return!0;return!1},e.prototype.isArray=function(){return this.hasTag(p)},e.prototype.matchesArray=function(e){return this.matchesTag(p)(e)},e.prototype.isNamed=function(){return this.hasTag(n)},e.prototype.isTagged=function(){return this.metadata.some((function(e){return h.every((function(t){return e.key!==t}))}))},e.prototype.isOptional=function(){return this.matchesTag(a)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter((function(e){return e.key===n}))[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter((function(e){return h.every((function(t){return e.key!==t}))})):null},e.prototype.matchesNamedTag=function(e){return this.matchesTag(n)(e)},e.prototype.matchesTag=function(e){var t=this;return function(r){for(var o=0,n=t.metadata;o<n.length;o++){var i=n[o];if(i.key===e&&i.value===r)return!0}return!1}},e}(),V=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))};function q(e,t,r,o){var n=e.getConstructorMetadata(r),i=n.compilerGeneratedMetadata;if(void 0===i)throw new Error(C+" "+t+".");var s=n.userGeneratedMetadata,a=Object.keys(s),c=0===r.length&&a.length>0,p=a.length>r.length,d=function(e,t,r,o,n){for(var i=[],s=0;s<n;s++){var a=U(s,e,t,r,o);null!==a&&i.push(a)}return i}(o,t,i,s,c||p?a.length:r.length),u=H(e,r,t);return V(V([],d,!0),u,!0)}function U(e,t,r,o,n){var i=n[e.toString()]||[],s=z(i),a=!0!==s.unmanaged,c=o[e];if((c=s.inject||s.multiInject||c)instanceof B&&(c=c.unwrap()),a){if(!t&&(c===Object||c===Function||void 0===c))throw new Error("Missing required @inject or @multiInject annotation in: argument "+e+" in class "+r+".");var p=new G(w.ConstructorArgument,s.targetName,c);return p.metadata=i,p}return null}function W(e,t,r,o){var n=e||t;if(void 0===n){var i=C+" for property "+String(r)+" in class "+o+".";throw new Error(i)}return n}function H(e,t,r){for(var o=e.getPropertiesMetadata(t),n=[],i=Object.getOwnPropertySymbols(o),s=0,a=Object.keys(o).concat(i);s<a.length;s++){var c=a[s],p=o[c],d=z(p),u=d.targetName||c,l=W(d.inject,d.multiInject,c,r),f=new G(w.ClassProperty,u,l);f.metadata=p,n.push(f)}var m=Object.getPrototypeOf(t.prototype).constructor;if(m!==Object){var y=H(e,m,r);n=V(V([],n,!0),y,!0)}return n}function K(e,t){var r=Object.getPrototypeOf(t.prototype).constructor;if(r!==Object){var o=q(e,R(r),r,!0),n=o.map((function(e){return e.metadata.filter((function(e){return e.key===s}))})),i=[].concat.apply([],n).length,a=o.length-i;return a>0?a:K(e,r)}return 0}function z(e){var t={};return e.forEach((function(e){t[e.key.toString()]=e.value})),{inject:t[c],multiInject:t[p],targetName:t[i],unmanaged:t[s]}}var Y=function(){function e(e,t,r,o,n){this.id=k(),this.serviceIdentifier=e,this.parentContext=t,this.parentRequest=r,this.target=n,this.childRequests=[],this.bindings=Array.isArray(o)?o:[o],this.requestScope=null===r?new Map:null}return e.prototype.addChildRequest=function(t,r,o){var n=new e(t,this.parentContext,this,r,o);return this.childRequests.push(n),n},e}();function X(e){return e._bindingDictionary}function J(e,t,r,o,n){var i,s=Z(r.container,n.serviceIdentifier);return 0===s.length&&r.container.options.autoBindInjectable&&"function"==typeof n.serviceIdentifier&&e.getConstructorMetadata(n.serviceIdentifier).compilerGeneratedMetadata&&(r.container.bind(n.serviceIdentifier).toSelf(),s=Z(r.container,n.serviceIdentifier)),i=t?s:s.filter((function(e){var t=new Y(e.serviceIdentifier,r,o,e,n);return e.constraint(t)})),function(e,t,r,o){switch(t.length){case 0:if(r.isOptional())return t;var n=j(e),i="No matching bindings found for serviceIdentifier:";throw i+=function(e,t){if(t.isTagged()||t.isNamed()){var r="",o=t.getNamedTag(),n=t.getCustomTags();return null!==o&&(r+=o.toString()+"\n"),null!==n&&n.forEach((function(e){r+=e.toString()+"\n"}))," "+e+"\n "+e+" - "+r}return" "+e}(n,r),i+=A(o,n,Z),new Error(i);case 1:return t;default:if(r.isArray())return t;throw i="Ambiguous match found for serviceIdentifier: "+(n=j(e)),i+=A(o,n,Z),new Error(i)}}(n.serviceIdentifier,i,n,r.container),i}function Q(e,t,r,o,n,i){var s,a;if(null===n){s=J(e,t,o,null,i),a=new Y(r,o,null,s,i);var c=new L(o,a);o.addPlan(c)}else s=J(e,t,o,n,i),a=n.addChildRequest(i.serviceIdentifier,s,i);s.forEach((function(t){var r=null;if(i.isArray())r=a.addChildRequest(t.serviceIdentifier,t,i);else{if(t.cache)return;r=a}if(t.type===g.Instance&&null!==t.implementationType){var n=function(e,t){return q(e,R(t),t,!1)}(e,t.implementationType);if(!o.container.options.skipBaseClassChecks){var s=K(e,t.implementationType);if(n.length<s){var c=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+e[0]+" must be >= than the number of constructor arguments of its base class."}(R(t.implementationType));throw new Error(c)}}n.forEach((function(t){Q(e,!1,t.serviceIdentifier,o,r,t)}))}}))}function Z(e,t){var r=[],o=X(e);return o.hasKey(t)?r=o.get(t):null!==e.parent&&(r=Z(e.parent,t)),r}function ee(e){return("object"==typeof e&&null!==e||"function"==typeof e)&&"function"==typeof e.then}function te(e){return!!ee(e)||Array.isArray(e)&&e.some(ee)}var re,oe=function(e,t){return r=void 0,o=void 0,i=function(){var r,o;return function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,t];case 1:return r=n.sent(),e.cache=r,[3,3];case 2:throw o=n.sent(),e.cache=null,e.activated=!1,o;case 3:return[2]}}))},new((n=void 0)||(n=Promise))((function(e,t){function s(e){try{c(i.next(e))}catch(e){t(e)}}function a(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,a)}c((i=i.apply(r,o||[])).next())}));var r,o,n,i};!function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"}(re||(re={}));var ne=function(e){return function(t){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return r.forEach((function(r){return e.bind(r).toService(t)}))}}},ie=function(){return ie=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ie.apply(this,arguments)},se=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function a(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((o=o.apply(e,t||[])).next())}))},ae=function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function ce(e){var t,r=new((t=e.constr).bind.apply(t,function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}([void 0],e.constructorInjections,!1)));return e.propertyRequests.forEach((function(t,o){var n=t.target.identifier,i=e.propertyInjections[o];r[n]=i})),r}function pe(e){return se(this,void 0,void 0,(function(){var t,r,o,n;return ae(this,(function(i){for(t=[],r=0,o=e;r<o.length;r++)n=o[r],Array.isArray(n)?t.push(Promise.all(n)):t.push(n);return[2,Promise.all(t)]}))}))}function de(e,t){var r=function(e,t){var r,o;if(Reflect.hasMetadata(m,e)){var n=Reflect.getMetadata(m,e);try{return null===(o=(r=t)[n.value])||void 0===o?void 0:o.call(r)}catch(t){throw new Error("@postConstruct error in class "+e.name+": "+t.message)}}}(e,t);return ee(r)?r.then((function(){return t})):t}var ue=function(e){return function(t){t.parentContext.setCurrentRequest(t);var r=t.bindings,o=t.childRequests,n=t.target&&t.target.isArray(),i=!(t.parentRequest&&t.parentRequest.target&&t.target&&t.parentRequest.target.matchesArray(t.target.serviceIdentifier));if(n&&i)return o.map((function(t){return ue(e)(t)}));if(!t.target.isOptional()||0!==r.length){var s=r[0];return ye(e,t,s)}}},le=function(e,t){var r=function(e){switch(e.type){case g.Factory:return{factory:e.factory,factoryType:re.Factory};case g.Provider:return{factory:e.provider,factoryType:re.Provider};case g.DynamicValue:return{factory:e.dynamicValue,factoryType:re.DynamicValue};default:throw new Error("Unexpected factory type "+e.type)}}(e);return function(o,n){try{return r.factory.bind(e)(t)}catch(e){throw x(e)&&(e=new Error((i=r.factoryType,s=t.currentRequest.serviceIdentifier.toString(),"It looks like there is a circular dependency in one of the '"+i+"' bindings. Please investigate bindings withservice identifier '"+s+"'."))),e}var i,s}()},fe=function(e,t,r){var o,n=t.childRequests;switch(function(e){var t=null;switch(e.type){case g.ConstantValue:case g.Function:t=e.cache;break;case g.Constructor:case g.Instance:t=e.implementationType;break;case g.DynamicValue:t=e.dynamicValue;break;case g.Provider:t=e.provider;break;case g.Factory:t=e.factory}if(null===t){var r=j(e.serviceIdentifier);throw new Error("Invalid binding type: "+r)}}(r),r.type){case g.ConstantValue:case g.Function:o=r.cache;break;case g.Constructor:o=r.implementationType;break;case g.Instance:o=function(e,t,r,o){!function(e,t){e.scope!==b.Singleton&&function(e,t){var r="Class cannot be instantiated in "+(e.scope===b.Request?"request":"transient")+" scope.";if("function"==typeof e.onDeactivation)throw new Error(D(t.name,r));if(Reflect.hasMetadata(y,t))throw new Error("@preDestroy error in class "+t.name+": "+r)}(e,t)}(e,t);var n=function(e,t,r){var o;if(t.length>0){var n=function(e,t){return e.reduce((function(e,r){var o=t(r);return r.target.type===w.ConstructorArgument?e.constructorInjections.push(o):(e.propertyRequests.push(r),e.propertyInjections.push(o)),e.isAsync||(e.isAsync=te(o)),e}),{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}(t,r),i=ie(ie({},n),{constr:e});o=n.isAsync?function(e){return se(this,void 0,void 0,(function(){var t,r;return ae(this,(function(o){switch(o.label){case 0:return[4,pe(e.constructorInjections)];case 1:return t=o.sent(),[4,pe(e.propertyInjections)];case 2:return r=o.sent(),[2,ce(ie(ie({},e),{constructorInjections:t,propertyInjections:r}))]}}))}))}(i):ce(i)}else o=new e;return o}(t,r,o);return ee(n)?n.then((function(e){return de(t,e)})):de(t,n)}(r,r.implementationType,n,ue(e));break;default:o=le(r,t.parentContext)}return o},me=function(e,t,r){var o=function(e,t){return t.scope===b.Singleton&&t.activated?t.cache:t.scope===b.Request&&e.has(t.id)?e.get(t.id):null}(e,t);return null!==o||function(e,t,r){t.scope===b.Singleton&&function(e,t){e.cache=t,e.activated=!0,ee(t)&&oe(e,t)}(t,r),t.scope===b.Request&&function(e,t,r){e.has(t.id)||e.set(t.id,r)}(e,t,r)}(e,t,o=r()),o},ye=function(e,t,r){return me(e,r,(function(){var o=fe(e,t,r);return ee(o)?o.then((function(e){return he(t,r,e)})):he(t,r,o)}))};function he(e,t,r){var o,n=be(e.parentContext,t,r),i=ke(e.parentContext.container),s=i.next();do{o=s.value;var a=e.parentContext,c=e.serviceIdentifier,p=ve(o,c);n=ee(n)?we(p,a,n):ge(p,a,n),s=i.next()}while(!0!==s.done&&!X(o).hasKey(e.serviceIdentifier));return n}var be=function(e,t,r){return"function"==typeof t.onActivation?t.onActivation(e,r):r},ge=function(e,t,r){for(var o=e.next();!o.done;){if(ee(r=o.value(t,r)))return we(e,t,r);o=e.next()}return r},we=function(e,t,r){return o=void 0,n=void 0,s=function(){var o,n;return function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}}(this,(function(i){switch(i.label){case 0:return[4,r];case 1:o=i.sent(),n=e.next(),i.label=2;case 2:return n.done?[3,4]:[4,n.value(t,o)];case 3:return o=i.sent(),n=e.next(),[3,2];case 4:return[2,o]}}))},new((i=void 0)||(i=Promise))((function(e,t){function r(e){try{c(s.next(e))}catch(e){t(e)}}function a(e){try{c(s.throw(e))}catch(e){t(e)}}function c(t){var o;t.done?e(t.value):(o=t.value,o instanceof i?o:new i((function(e){e(o)}))).then(r,a)}c((s=s.apply(o,n||[])).next())}));var o,n,i,s},ve=function(e,t){var r=e._activations;return r.hasKey(t)?r.get(t).values():[].values()},ke=function(e){for(var t=[e],r=e.parent;null!==r;)t.push(r),r=r.parent;return{next:function(){var e=t.pop();return void 0!==e?{done:!1,value:e}:{done:!0,value:void 0}}}},_e=function(e,t){var r=e.parentRequest;return null!==r&&(!!t(r)||_e(r,t))},Se=function(e){return function(t){var r=function(r){return null!==r&&null!==r.target&&r.target.matchesTag(e)(t)};return r.metaData=new I(e,t),r}},Pe=Se(n),Me=function(e){return function(t){var r=null;if(null!==t){if(r=t.bindings[0],"string"==typeof e)return r.serviceIdentifier===e;var o=t.bindings[0].implementationType;return e===o}return!1}},Ce=function(){function e(e){this._binding=e}return e.prototype.when=function(e){return this._binding.constraint=e,new Fe(this._binding)},e.prototype.whenTargetNamed=function(e){return this._binding.constraint=Pe(e),new Fe(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(e){return null!==e&&null!==e.target&&!e.target.isNamed()&&!e.target.isTagged()},new Fe(this._binding)},e.prototype.whenTargetTagged=function(e,t){return this._binding.constraint=Se(e)(t),new Fe(this._binding)},e.prototype.whenInjectedInto=function(e){return this._binding.constraint=function(t){return null!==t&&Me(e)(t.parentRequest)},new Fe(this._binding)},e.prototype.whenParentNamed=function(e){return this._binding.constraint=function(t){return null!==t&&Pe(e)(t.parentRequest)},new Fe(this._binding)},e.prototype.whenParentTagged=function(e,t){return this._binding.constraint=function(r){return null!==r&&Se(e)(t)(r.parentRequest)},new Fe(this._binding)},e.prototype.whenAnyAncestorIs=function(e){return this._binding.constraint=function(t){return null!==t&&_e(t,Me(e))},new Fe(this._binding)},e.prototype.whenNoAncestorIs=function(e){return this._binding.constraint=function(t){return null!==t&&!_e(t,Me(e))},new Fe(this._binding)},e.prototype.whenAnyAncestorNamed=function(e){return this._binding.constraint=function(t){return null!==t&&_e(t,Pe(e))},new Fe(this._binding)},e.prototype.whenNoAncestorNamed=function(e){return this._binding.constraint=function(t){return null!==t&&!_e(t,Pe(e))},new Fe(this._binding)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._binding.constraint=function(r){return null!==r&&_e(r,Se(e)(t))},new Fe(this._binding)},e.prototype.whenNoAncestorTagged=function(e,t){return this._binding.constraint=function(r){return null!==r&&!_e(r,Se(e)(t))},new Fe(this._binding)},e.prototype.whenAnyAncestorMatches=function(e){return this._binding.constraint=function(t){return null!==t&&_e(t,e)},new Fe(this._binding)},e.prototype.whenNoAncestorMatches=function(e){return this._binding.constraint=function(t){return null!==t&&!_e(t,e)},new Fe(this._binding)},e}(),Fe=function(){function e(e){this._binding=e}return e.prototype.onActivation=function(e){return this._binding.onActivation=e,new Ce(this._binding)},e.prototype.onDeactivation=function(e){return this._binding.onDeactivation=e,new Ce(this._binding)},e}(),De=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new Ce(this._binding),this._bindingOnSyntax=new Fe(this._binding)}return e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},e}(),Te=function(){function e(e){this._binding=e}return e.prototype.inRequestScope=function(){return this._binding.scope=b.Request,new De(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=b.Transient,new De(this._binding)},e}(),xe=function(){function e(e){this._binding=e,this._bindingWhenSyntax=new Ce(this._binding),this._bindingOnSyntax=new Fe(this._binding),this._bindingInSyntax=new Te(e)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(e){return this._bindingWhenSyntax.when(e)},e.prototype.whenTargetNamed=function(e){return this._bindingWhenSyntax.whenTargetNamed(e)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(e,t){return this._bindingWhenSyntax.whenTargetTagged(e,t)},e.prototype.whenInjectedInto=function(e){return this._bindingWhenSyntax.whenInjectedInto(e)},e.prototype.whenParentNamed=function(e){return this._bindingWhenSyntax.whenParentNamed(e)},e.prototype.whenParentTagged=function(e,t){return this._bindingWhenSyntax.whenParentTagged(e,t)},e.prototype.whenAnyAncestorIs=function(e){return this._bindingWhenSyntax.whenAnyAncestorIs(e)},e.prototype.whenNoAncestorIs=function(e){return this._bindingWhenSyntax.whenNoAncestorIs(e)},e.prototype.whenAnyAncestorNamed=function(e){return this._bindingWhenSyntax.whenAnyAncestorNamed(e)},e.prototype.whenAnyAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenAnyAncestorTagged(e,t)},e.prototype.whenNoAncestorNamed=function(e){return this._bindingWhenSyntax.whenNoAncestorNamed(e)},e.prototype.whenNoAncestorTagged=function(e,t){return this._bindingWhenSyntax.whenNoAncestorTagged(e,t)},e.prototype.whenAnyAncestorMatches=function(e){return this._bindingWhenSyntax.whenAnyAncestorMatches(e)},e.prototype.whenNoAncestorMatches=function(e){return this._bindingWhenSyntax.whenNoAncestorMatches(e)},e.prototype.onActivation=function(e){return this._bindingOnSyntax.onActivation(e)},e.prototype.onDeactivation=function(e){return this._bindingOnSyntax.onDeactivation(e)},e}(),je=function(){function e(e){this._binding=e}return e.prototype.to=function(e){return this._binding.type=g.Instance,this._binding.implementationType=e,new xe(this._binding)},e.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error("The toSelf function can only be applied when a constructor is used as service identifier");var e=this._binding.serviceIdentifier;return this.to(e)},e.prototype.toConstantValue=function(e){return this._binding.type=g.ConstantValue,this._binding.cache=e,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.toDynamicValue=function(e){return this._binding.type=g.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=e,this._binding.implementationType=null,new xe(this._binding)},e.prototype.toConstructor=function(e){return this._binding.type=g.Constructor,this._binding.implementationType=e,this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.toFactory=function(e){return this._binding.type=g.Factory,this._binding.factory=e,this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.toFunction=function(e){if("function"!=typeof e)throw new Error("Value provided to function binding must be a function!");var t=this.toConstantValue(e);return this._binding.type=g.Function,this._binding.scope=b.Singleton,t},e.prototype.toAutoFactory=function(e){return this._binding.type=g.Factory,this._binding.factory=function(t){return function(){return t.container.get(e)}},this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.toAutoNamedFactory=function(e){return this._binding.type=g.Factory,this._binding.factory=function(t){return function(r){return t.container.getNamed(e,r)}},new De(this._binding)},e.prototype.toProvider=function(e){return this._binding.type=g.Provider,this._binding.provider=e,this._binding.scope=b.Singleton,new De(this._binding)},e.prototype.toService=function(e){this.toDynamicValue((function(t){return t.container.get(e)}))},e}(),Ae=function(){function e(){}return e.of=function(t,r,o,n,i){var s=new e;return s.bindings=t,s.middleware=r,s.deactivations=n,s.activations=o,s.moduleActivationStore=i,s},e}(),Ee=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(e,t){if(null==e)throw new Error(P);if(null==t)throw new Error(P);var r=this._map.get(e);void 0!==r?r.push(t):this._map.set(e,[t])},e.prototype.get=function(e){if(null==e)throw new Error(P);var t=this._map.get(e);if(void 0!==t)return t;throw new Error(M)},e.prototype.remove=function(e){if(null==e)throw new Error(P);if(!this._map.delete(e))throw new Error(M)},e.prototype.removeIntersection=function(e){var t=this;this.traverse((function(r,o){var n=e.hasKey(r)?e.get(r):void 0;if(void 0!==n){var i=o.filter((function(e){return!n.some((function