Home
last modified time | relevance | path

Searched refs:createWriteStream (Results 1 - 25 of 1146) sorted by relevance

12345678910>>...46

/test/xts/acts/ability/ability_runtime/aacommand/AACommandPrintOneTest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitygetstartparameterstest/getstartparameterhelper3/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitymanager/actsamstestfifthscene/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstancetest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitytoolabilitydelegatortest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsabilityamstest/actsbacktocallerabilitywithresulttest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsabilityamstest/systemappa/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actscalltest/systemappcalleea/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actschildprocessmanager/actschildprocessmanagertest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsdataabilityaccessdatasharetest/datashareserverhap/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsjsdataabilitytest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyFifth/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsnfcselecttypes/ActsNFCSelectTypesTestRelyThird/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsqueryfunctiontest/actsgetabilitystatestagetest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsresponseglobalparamupdatetest/actsresponseglobalparamupdaterelyb/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsstartabilitygetdisplayidtest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actssupportfunction/fasupportfunction/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsuiextensionexitreason/actsuiextensionexitreasontest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsuiextensiontest/uiextensionprovider2/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/actsusers/ActsAmsUsersKillProcessAppA/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/aacommand/AACommandImplicitStartTest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitygetstartparameterstest/getstartparameterhelper2/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitymanager/actsamstestfirstscene/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitymultiinstance/amsabilitymultiinstanceappd/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)
/test/xts/acts/ability/ability_runtime/abilitystagemonitor/abilitystagemonitortest/hvigor/
H A Dhvigor-wrapper.js15 "use strict";var e=require("path"),t=require("os"),n=require("fs"),r=require("child_process"),u=require("process"),o=require("tty"),i=require("util"),s=require("url"),c=require("constants"),a=require("stream"),l=require("assert"),f=require("zlib"),d=require("net"),D=require("crypto"),p="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={},E={},m=p&&p.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(E,"__esModule",{value:!0}),E.maxPathLength=E.isMac=E.isLinux=E.isWindows=void 0;const y=m(t),C="Windows_NT",F="Darwin";function g(){return y.default.type()===C}function A(){return y.default.type()===F}E.isWindows=g,E.isLinux=function(){return"Linux"===y.default.type()},E.isMac=A,E.maxPathLength=function(){return A()?1016:g()?259:4095},Object.defineProperty(h,"__esModule",{value:!0}),h.LOG_LEVEL=h.ANALYZE=h.PARALLEL=h.INCREMENTAL=h.DAEMON=h.DOT=h.PROPERTIES=h.HVIGOR_ARK_COMPILE_MAX_SIZE=h.HVIGOR_POOL_CACHE_TTL=h.HVIGOR_POOL_CACHE_CAPACITY=h.HVIGOR_POOL_MAX_CORE_SIZE=h.HVIGOR_POOL_MAX_SIZE=h.ENABLE_SIGN_TASK_KEY=h.HVIGOR_CACHE_DIR_KEY=h.WORK_SPACE=h.PROJECT_CACHES=h.HVIGOR_USER_HOME_DIR_NAME=h.DEFAULT_PACKAGE_JSON=h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME=h.PNPM=h.HVIGOR=h.NPM_TOOL=h.PNPM_TOOL=h.HVIGOR_ENGINE_PACKAGE_NAME=void 0;const v=E;h.HVIGOR_ENGINE_PACKAGE_NAME="@ohos/hvigor",h.PNPM_TOOL=(0,v.isWindows)()?"pnpm.cmd":"pnpm",h.NPM_TOOL=(0,v.isWindows)()?"npm.cmd":"npm",h.HVIGOR="hvigor",h.PNPM="pnpm",h.DEFAULT_HVIGOR_CONFIG_JSON_FILE_NAME="hvigor-config.json5",h.DEFAULT_PACKAGE_JSON="package.json",h.HVIGOR_USER_HOME_DIR_NAME=".hvigor",h.PROJECT_CACHES="project_caches";var S=h.WORK_SPACE="workspace";h.HVIGOR_CACHE_DIR_KEY="hvigor.cacheDir",h.ENABLE_SIGN_TASK_KEY="enableSignTask",h.HVIGOR_POOL_MAX_SIZE="hvigor.pool.maxSize",h.HVIGOR_POOL_MAX_CORE_SIZE="hvigor.pool.maxCoreSize",h.HVIGOR_POOL_CACHE_CAPACITY="hvigor.pool.cache.capacity",h.HVIGOR_POOL_CACHE_TTL="hvigor.pool.cache.ttl",h.HVIGOR_ARK_COMPILE_MAX_SIZE="hvigor.arkCompile.maxSize",h.PROPERTIES="properties",h.DOT=".",h.DAEMON="daemon",h.INCREMENTAL="incremental",h.PARALLEL="typeCheck",h.ANALYZE="analyze",h.LOG_LEVEL="logLevel";var w={},O={};Object.defineProperty(O,"__esModule",{value:!0}),O.logError=O.logInfo=O.logErrorAndExit=void 0,O.logErrorAndExit=function(e){e instanceof Error?console.error(e.message):console.error(e),process.exit(-1)},O.logInfo=function(e){console.log(e)},O.logError=function(e){console.error(e)};var _=p&&p.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var u=Object.getOwnPropertyDescriptor(t,n);u&&!("get"in u?!t.__esModule:u.writable||u.configurable)||(u={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,u)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),b=p&&p.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),B=p&&p.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&_(t,e,n);return b(t,e),t};Object.defineProperty(w,"__esModule",{value:!0});var P=w.executeBuild=void 0;const k=B(n),I=B(e),x=O,N=r;P=w.executeBuild=function(e){const t=I.resolve(e,"node_modules","@ohos","hvigor","bin","hvigor.js");try{const e=k.realpathSync(t),n=process.argv.slice(2),r=(0,N.spawn)("node",[e,...n],{env:process.env});r.stdout.on("data",(e=>{(0,x.logInfo)(`${e.toString().trim()}`)})),r.stderr.on("data",(e=>{(0,x.logError)(`${e.toString().trim()}`)})),r.on("exit",((e,t)=>{process.exit(null!=e?e:-1)}))}catch(n){(0,x.logErrorAndExit)(`Error: ENOENT: no such file ${t},delete ${e} and retry.`)}};var R,T,M,L,j,$={},H={},G={exports:{}},V={exports:{}};function U(){if(T)return R;T=1;var e=1e3,t=60*e,n=60*t,r=24*n,u=7*r,o=365.25*r;function i(e,t,n,r){var u=t>=1.5*n;return Math.round(e/n)+" "+r+(u?"s":"")}return R=function(s,c){c=c||{};var a=typeof s;if("string"===a&&s.length>0)return function(i){if((i=String(i)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(!s)return;var c=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*u;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*t;case"seconds":case"second":case"secs":case"sec":case"s":return c*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}(s);if("number"===a&&isFinite(s))return c.long?function(u){var o=Math.abs(u);if(o>=r)return i(u,o,r,"day");if(o>=n)return i(u,o,n,"hour");if(o>=t)return i(u,o,t,"minute");if(o>=e)return i(u,o,e,"second");return u+" ms"}(s):function(u){var o=Math.abs(u);if(o>=r)return Math.round(u/r)+"d";if(o>=n)return Math.round(u/n)+"h";if(o>=t)return Math.round(u/t)+"m";if(o>=e)return Math.round(u/e)+"s";return u+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}function J(){if(L)return M;return L=1,M=function(e){function t(e){let r,u,o,i=null;function s(...e){if(!s.enabled)return;const n=s,u=Number(new Date),o=u-(r||u);n.diff=o,n.prev=r,n.curr=u,r=u,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let i=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((r,u)=>{if("%%"===r)return"%";i++;const o=t.formatters[u];if("function"==typeof o){const t=e[i];r=o.call(n,t),e.splice(i,1),i--}return r})),t.formatArgs.call(n,e);(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==i?i:(u!==t.namespaces&&(u=t.namespaces,o=t.enabled(e)),o),set:e=>{i=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(r),...t.skips.map(r).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").split(/[\s,]+/),u=r.length;for(n=0;n<u;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,r;for(n=0,r=t.skips.length;n<r;n++)if(t.skips[n].test(e))return!1;for(n=0,r=t.names.length;n<r;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=U(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},M}var W,z,K,q,Y,Z,X={exports:{}};function Q(){return z||(z=1,W=(e,t)=>{t=t||process.argv;const n=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(n+e),u=t.indexOf("--");return-1!==r&&(-1===u||r<u)}),W}function ee(){if(q)return K;q=1;const e=t,n=Q(),r=process.env;let u;function o(t){const o=function(t){if(!1===u)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!t.isTTY&&!0!==u)return 0;const o=u?1:0;if("win32"===process.platform){const t=e.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in r)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some((e=>e in r))||"codeship"===r.CI_NAME?1:o;if("TEAMCITY_VERSION"in r)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(r.TEAMCITY_VERSION)?1:0;if("truecolor"===r.COLORTERM)return 3;if("TERM_PROGRAM"in r){const e=parseInt((r.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(r.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(r.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(r.TERM)||"COLORTERM"in r?1:(r.TERM,o)}(t);return function(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}(o)}return n("no-color")||n("no-colors")||n("color=false")?u=!1:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(u=!0),"FORCE_COLOR"in r&&(u=0===r.FORCE_COLOR.length||0!==parseInt(r.FORCE_COLOR,10)),K={supportsColor:o,stdout:o(process.stdout),stderr:o(process.stderr)}}function te(){return Y||(Y=1,function(e,t){const n=o,r=i;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let r=0;r<n.length;r++)e.inspectOpts[n[r]]=t.inspectOpts[n[r]]},t.log=function(...e){return process.stderr.write(r.format(...e)+"\n")},t.formatArgs=function(n){const{namespace:r,useColors:u}=this;if(u){const t=this.color,u="[3"+(t<8?t:"8;5;"+t),o=` ${u};1m${r} `;n[0]=o+n[0].split("\n").join("\n"+o),n.push(u+"m+"+e.exports.humanize(this.diff)+"")}else n[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+r+" "+n[0]},t.save=function(e){e?process.env.DEBUG=e:delete process.env.DEBUG},t.load=function(){return process.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=r.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=ee();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(process.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let r=process.env[t];return r=!!/^(yes|on|true|enabled)$/i.test(r)||!/^(no|off|false|disabled)$/i.test(r)&&("null"===r?null:Number(r)),e[n]=r,e}),{}),e.exports=J()(t);const{formatters:u}=e.exports;u.o=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},u.O=function(e){return this.inspectOpts.colors=this.useColors,r.inspect(e,this.inspectOpts)}}(X,X.exports)),X.exports}Z=G,"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Z.exports=(j||(j=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,u=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(u=r))})),t.splice(u,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=J()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(V,V.exports)),V.exports):Z.exports=te();var ne=function(e){return(e=e||{}).circles?function(e){var t=[],n=[];return e.proto?function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o}:function e(u){if("object"!=typeof u||null===u)return u;if(u instanceof Date)return new Date(u);if(Array.isArray(u))return r(u,e);if(u instanceof Map)return new Map(r(Array.from(u),e));if(u instanceof Set)return new Set(r(Array.from(u),e));var o={};for(var i in t.push(u),n.push(o),u)if(!1!==Object.hasOwnProperty.call(u,i)){var s=u[i];if("object"!=typeof s||null===s)o[i]=s;else if(s instanceof Date)o[i]=new Date(s);else if(s instanceof Map)o[i]=new Map(r(Array.from(s),e));else if(s instanceof Set)o[i]=new Set(r(Array.from(s),e));else if(ArrayBuffer.isView(s))o[i]=re(s);else{var c=t.indexOf(s);o[i]=-1!==c?n[c]:e(s)}}return t.pop(),n.pop(),o};function r(e,r){for(var u=Object.keys(e),o=new Array(u.length),i=0;i<u.length;i++){var s=u[i],c=e[s];if("object"!=typeof c||null===c)o[s]=c;else if(c instanceof Date)o[s]=new Date(c);else if(ArrayBuffer.isView(c))o[s]=re(c);else{var a=t.indexOf(c);o[s]=-1!==a?n[a]:r(c)}}return o}}(e):e.proto?function e(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return t(n,e);if(n instanceof Map)return new Map(t(Array.from(n),e));if(n instanceof Set)return new Set(t(Array.from(n),e));var r={};for(var u in n){var o=n[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),e)):o instanceof Set?r[u]=new Set(t(Array.from(o),e)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=e(o)}return r}:n;function t(e,t){for(var n=Object.keys(e),r=new Array(n.length),u=0;u<n.length;u++){var o=n[u],i=e[o];"object"!=typeof i||null===i?r[o]=i:i instanceof Date?r[o]=new Date(i):ArrayBuffer.isView(i)?r[o]=re(i):r[o]=t(i)}return r}function n(e){if("object"!=typeof e||null===e)return e;if(e instanceof Date)return new Date(e);if(Array.isArray(e))return t(e,n);if(e instanceof Map)return new Map(t(Array.from(e),n));if(e instanceof Set)return new Set(t(Array.from(e),n));var r={};for(var u in e)if(!1!==Object.hasOwnProperty.call(e,u)){var o=e[u];"object"!=typeof o||null===o?r[u]=o:o instanceof Date?r[u]=new Date(o):o instanceof Map?r[u]=new Map(t(Array.from(o),n)):o instanceof Set?r[u]=new Set(t(Array.from(o),n)):ArrayBuffer.isView(o)?r[u]=re(o):r[u]=n(o)}return r}};function re(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}const ue=i,oe=G.exports("log4js:configuration"),ie=[],se=[],ce=e=>!e,ae=e=>e&&"object"==typeof e&&!Array.isArray(e),le=(e,t,n)=>{(Array.isArray(t)?t:[t]).forEach((t=>{if(t)throw new Error(`Problem with log4js configuration: (${ue.inspect(e,{depth:5})}) - ${n}`)}))};var fe={configure:e=>{oe("New configuration to be validated: ",e),le(e,ce(ae(e)),"must be an object."),oe(`Calling pre-processing listeners (${ie.length})`),ie.forEach((t=>t(e))),oe("Configuration pre-processing finished."),oe(`Calling configuration listeners (${se.length})`),se.forEach((t=>t(e))),oe("Configuration finished.")},addListener:e=>{se.push(e),oe(`Added listener, now ${se.length} listeners`)},addPreProcessingListener:e=>{ie.push(e),oe(`Added pre-processing listener, now ${ie.length} listeners`)},throwExceptionIf:le,anObject:ae,anInteger:e=>e&&"number"==typeof e&&Number.isInteger(e),validIdentifier:e=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(e),not:ce},de={exports:{}};!function(e){function t(e,t){for(var n=e.toString();n.length<t;)n="0"+n;return n}function n(e){return t(e,2)}function r(r,u){"string"!=typeof r&&(u=r,r=e.exports.ISO8601_FORMAT),u||(u=e.exports.now());var o=n(u.getDate()),i=n(u.getMonth()+1),s=n(u.getFullYear()),c=n(s.substring(2,4)),a=r.indexOf("yyyy")>-1?s:c,l=n(u.getHours()),f=n(u.getMinutes()),d=n(u.getSeconds()),D=t(u.getMilliseconds(),3),p=function(e){var t=Math.abs(e),n=String(Math.floor(t/60)),r=String(t%60);return n=("0"+n).slice(-2),r=("0"+r).slice(-2),0===e?"Z":(e<0?"+":"-")+n+":"+r}(u.getTimezoneOffset());return r.replace(/dd/g,o).replace(/MM/g,i).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,f).replace(/ss/g,d).replace(/SSS/g,D).replace(/O/g,p)}function u(e,t,n,r){e["set"+(r?"":"UTC")+t](n)}e.exports=r,e.exports.asString=r,e.exports.parse=function(t,n,r){if(!t)throw new Error("pattern must be supplied");return function(t,n,r){var o=t.indexOf("O")<0,i=!1,s=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(e,t){u(e,"FullYear",t,o)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Month",t-1,o),e.getMonth()!==t-1&&(i=!0)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(e,t){i&&u(e,"Month",e.getMonth()-1,o),u(e,"Date",t,o)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(e,t){u(e,"Hours",t,o)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(e,t){u(e,"Minutes",t,o)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(e,t){u(e,"Seconds",t,o)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(e,t){u(e,"Milliseconds",t,o)}},{pattern:/O/,regexp:"[+-]\\d{1,2}:?\\d{2}?|Z",fn:function(e,t){t="Z"===t?0:t.replace(":","");var n=Math.abs(t),r=(t>0?-1:1)*(n%100+60*Math.floor(n/100));e.setUTCMinutes(e.getUTCMinutes()+r)}}],c=s.reduce((function(e,t){return t.pattern.test(e.regexp)?(t.index=e.regexp.match(t.pattern).index,e.regexp=e.regexp.replace(t.pattern,"("+t.regexp+")")):t.index=-1,e}),{regexp:t,index:[]}),a=s.filter((function(e){return e.index>-1}));a.sort((function(e,t){return e.index-t.index}));var l=new RegExp(c.regexp).exec(n);if(l){var f=r||e.exports.now();return a.forEach((function(e,t){e.fn(f,l[t+1])})),f}throw new Error("String '"+n+"' could not be parsed as '"+t+"'")}(t,n,r)},e.exports.now=function(){return new Date},e.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS",e.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO",e.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS",e.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"}(de);const De=de.exports,pe=t,he=i,Ee=e,me=s,ye=G.exports("log4js:layouts"),Ce={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function Fe(e){return e?`[${Ce[e][0]}m`:""}function ge(e){return e?`[${Ce[e][1]}m`:""}function Ae(e,t){return n=he.format("[%s] [%s] %s - ",De.asString(e.startTime),e.level.toString(),e.categoryName),Fe(r=t)+n+ge(r);var n,r}function ve(e){return Ae(e)+he.format(...e.data)}function Se(e){return Ae(e,e.level.colour)+he.format(...e.data)}function we(e){return he.format(...e.data)}function Oe(e){return e.data[0]}function _e(e,t){const n=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflosCMAF%])(\{([^}]+)\})?|([^%]+)/;function r(e){return e&&e.pid?e.pid.toString():process.pid.toString()}e=e||"%r %p %c - %m%n";const u={c:function(e,t){let n=e.categoryName;if(t){const e=parseInt(t,10),r=n.split(".");e<r.length&&(n=r.slice(r.length-e).join("."))}return n},d:function(e,t){let n=De.ISO8601_FORMAT;if(t)switch(n=t,n){case"ISO8601":case"ISO8601_FORMAT":n=De.ISO8601_FORMAT;break;case"ISO8601_WITH_TZ_OFFSET":case"ISO8601_WITH_TZ_OFFSET_FORMAT":n=De.ISO8601_WITH_TZ_OFFSET_FORMAT;break;case"ABSOLUTE":process.emitWarning("Pattern %d{ABSOLUTE} is deprecated in favor of %d{ABSOLUTETIME}. Please use %d{ABSOLUTETIME} instead.","DeprecationWarning","log4js-node-DEP0003"),ye("[log4js-node-DEP0003]","DEPRECATION: Pattern %d{ABSOLUTE} is deprecated and replaced by %d{ABSOLUTETIME}.");case"ABSOLUTETIME":case"ABSOLUTETIME_FORMAT":n=De.ABSOLUTETIME_FORMAT;break;case"DATE":process.emitWarning("Pattern %d{DATE} is deprecated due to the confusion it causes when used. Please use %d{DATETIME} instead.","DeprecationWarning","log4js-node-DEP0004"),ye("[log4js-node-DEP0004]","DEPRECATION: Pattern %d{DATE} is deprecated and replaced by %d{DATETIME}.");case"DATETIME":case"DATETIME_FORMAT":n=De.DATETIME_FORMAT}return De.asString(n,e.startTime)},h:function(){return pe.hostname().toString()},m:function(e){return he.format(...e.data)},n:function(){return pe.EOL},p:function(e){return e.level.toString()},r:function(e){return De.asString("hh:mm:ss",e.startTime)},"[":function(e){return Fe(e.level.colour)},"]":function(e){return ge(e.level.colour)},y:function(){return r()},z:r,"%":function(){return"%"},x:function(e,n){return void 0!==t[n]?"function"==typeof t[n]?t[n](e):t[n]:null},X:function(e,t){const n=e.context[t];return void 0!==n?"function"==typeof n?n(e):n:null},f:function(e,t){let n=e.fileName||"";if(n=function(e){const t="file://";return e.startsWith(t)&&("function"==typeof me.fileURLToPath?e=me.fileURLToPath(e):(e=Ee.normalize(e.replace(new RegExp(`^${t}`),"")),"win32"===process.platform&&(e=e.startsWith("\\")?e.slice(1):Ee.sep+Ee.sep+e))),e}(n),t){const e=parseInt(t,10),r=n.split(Ee.sep);r.length>e&&(n=r.slice(-e).join(Ee.sep))}return n},l:function(e){return e.lineNumber?`${e.lineNumber}`:""},o:function(e){return e.columnNumber?`${e.columnNumber}`:""},s:function(e){return e.callStack||""},C:function(e){return e.className||""},M:function(e){return e.functionName||""},A:function(e){return e.functionAlias||""},F:function(e){return e.callerName||""}};function o(e,t,n){return u[e](t,n)}function i(e,t,n){let r=e;return r=function(e,t){let n;return e?(n=parseInt(e.slice(1),10),n>0?t.slice(0,n):t.slice(n)):t}(t,r),r=function(e,t){let n;if(e)if("-"===e.charAt(0))for(n=parseInt(e.slice(1),10);t.length<n;)t+=" ";else for(n=parseInt(e,10);t.length<n;)t=` ${t}`;return t}(n,r),r}return function(t){let r,u="",s=e;for(;null!==(r=n.exec(s));){const e=r[1],n=r[2],c=r[3],a=r[5],l=r[6];if(l)u+=l.toString();else{u+=i(o(c,t,a),n,e)}s=s.slice(r.index+r[0].length)}return u}}const be={messagePassThrough:()=>we,basic:()=>ve,colored:()=>Se,coloured:()=>Se,pattern:e=>_e(e&&e.pattern,e&&e.tokens),dummy:()=>Oe};var Be={basicLayout:ve,messagePassThroughLayout:we,patternLayout:_e,colouredLayout:Se,coloredLayout:Se,dummyLayout:Oe,addLayout(e,t){be[e]=t},layout:(e,t)=>be[e]&&be[e](t)};const Pe=fe,ke=["white","grey","black","blue","cyan","green","magenta","red","yellow"];class Ie{constructor(e,t,n){this.level=e,this.levelStr=t,this.colour=n}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Ie?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Ie[e.toString().toUpperCase()]||t):t}static addLevels(e){if(e){Object.keys(e).forEach((t=>{const n=t.toUpperCase();Ie[n]=new Ie(e[t].value,n,e[t].colour);const r=Ie.levels.findIndex((e=>e.levelStr===n));r>-1?Ie.levels[r]=Ie[n]:Ie.levels.push(Ie[n])})),Ie.levels.sort(((e,t)=>e.level-t.level))}}isLessThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level>=e.level}isEqualTo(e){return"string"==typeof e&&(e=Ie.getLevel(e)),this.level===e.level}}Ie.levels=[],Ie.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}}),Pe.addListener((e=>{const t=e.levels;if(t){Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t)),"levels must be an object");Object.keys(t).forEach((n=>{Pe.throwExceptionIf(e,Pe.not(Pe.validIdentifier(n)),`level name "${n}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),Pe.throwExceptionIf(e,Pe.not(Pe.anObject(t[n])),`level "${n}" must be an object`),Pe.throwExceptionIf(e,Pe.not(t[n].value),`level "${n}" must have a 'value' property`),Pe.throwExceptionIf(e,Pe.not(Pe.anInteger(t[n].value)),`level "${n}".value must have an integer value`),Pe.throwExceptionIf(e,Pe.not(t[n].colour),`level "${n}" must have a 'colour' property`),Pe.throwExceptionIf(e,Pe.not(ke.indexOf(t[n].colour)>-1),`level "${n}".colour must be one of ${ke.join(", ")}`)}))}})),Pe.addListener((e=>{Ie.addLevels(e.levels)}));var xe=Ie,Ne={exports:{}},Re={};const{parse:Te,stringify:Me}=JSON,{keys:Le}=Object,je=String,$e="string",He={},Ge="object",Ve=(e,t)=>t,Ue=e=>e instanceof je?je(e):e,Je=(e,t)=>typeof t===$e?new je(t):t,We=(e,t,n,r)=>{const u=[];for(let o=Le(n),{length:i}=o,s=0;s<i;s++){const i=o[s],c=n[i];if(c instanceof je){const o=e[c];typeof o!==Ge||t.has(o)?n[i]=r.call(n,i,o):(t.add(o),n[i]=He,u.push({k:i,a:[e,t,o,r]}))}else n[i]!==He&&(n[i]=r.call(n,i,c))}for(let{length:e}=u,t=0;t<e;t++){const{k:e,a:o}=u[t];n[e]=r.call(n,e,We.apply(null,o))}return n},ze=(e,t,n)=>{const r=je(t.push(n)-1);return e.set(n,r),r},Ke=(e,t)=>{const n=Te(e,Je).map(Ue),r=n[0],u=t||Ve,o=typeof r===Ge&&r?We(n,new Set,r,u):r;return u.call({"":o},"",o)};Re.parse=Ke;const qe=(e,t,n)=>{const r=t&&typeof t===Ge?(e,n)=>""===e||-1<t.indexOf(e)?n:void 0:t||Ve,u=new Map,o=[],i=[];let s=+ze(u,o,r.call({"":e},"",e)),c=!s;for(;s<o.length;)c=!0,i[s]=Me(o[s++],a,n);return"["+i.join(",")+"]";function a(e,t){if(c)return c=!c,t;const n=r.call(this,e,t);switch(typeof n){case Ge:if(null===n)return n;case $e:return u.get(n)||ze(u,o,n)}return n}};Re.stringify=qe;Re.toJSON=e=>Te(qe(e));Re.fromJSON=e=>Ke(Me(e));const Ye=Re,Ze=xe;const Xe=new class{constructor(){const e={__LOG4JS_undefined__:void 0,__LOG4JS_NaN__:Number("abc"),__LOG4JS_Infinity__:1/0,"__LOG4JS_-Infinity__":-1/0};this.deMap=e,this.serMap={},Object.keys(this.deMap).forEach((e=>{const t=this.deMap[e];this.serMap[t]=e}))}canSerialise(e){return"string"!=typeof e&&e in this.serMap}serialise(e){return this.canSerialise(e)?this.serMap[e]:e}canDeserialise(e){return e in this.deMap}deserialise(e){return this.canDeserialise(e)?this.deMap[e]:e}};let Qe=class{constructor(e,t,n,r,u,o){if(this.startTime=new Date,this.categoryName=e,this.data=n,this.level=t,this.context=Object.assign({},r),this.pid=process.pid,this.error=o,void 0!==u){if(!u||"object"!=typeof u||Array.isArray(u))throw new TypeError("Invalid location type passed to LoggingEvent constructor");this.constructor._getLocationKeys().forEach((e=>{void 0!==u[e]&&(this[e]=u[e])}))}}static _getLocationKeys(){return["fileName","lineNumber","columnNumber","callStack","className","functionName","functionAlias","callerName"]}serialise(){return Ye.stringify(this,((e,t)=>(t instanceof Error&&(t=Object.assign({message:t.message,stack:t.stack},t)),Xe.serialise(t))))}static deserialise(e){let t;try{const n=Ye.parse(e,((e,t)=>{if(t&&t.message&&t.stack){const e=new Error(t);Object.keys(t).forEach((n=>{e[n]=t[n]})),t=e}return Xe.deserialise(t)}));this._getLocationKeys().forEach((e=>{void 0!==n[e]&&(n.location||(n.location={}),n.location[e]=n[e])})),t=new Qe(n.categoryName,Ze.getLevel(n.level.levelStr),n.data,n.context,n.location,n.error),t.startTime=new Date(n.startTime),t.pid=n.pid,n.cluster&&(t.cluster=n.cluster)}catch(n){t=new Qe("log4js",Ze.ERROR,["Unable to parse log:",e,"because: ",n])}return t}};var et=Qe;const tt=G.exports("log4js:clustering"),nt=et,rt=fe;let ut=!1,ot=null;try{ot=require("cluster")}catch(e){tt("cluster module not present"),ut=!0}const it=[];let st=!1,ct="NODE_APP_INSTANCE";const at=()=>st&&"0"===process.env[ct],lt=()=>ut||ot&&ot.isMaster||at(),ft=e=>{it.forEach((t=>t(e)))},dt=(e,t)=>{if(tt("cluster message received from worker ",e,": ",t),e.topic&&e.data&&(t=e,e=void 0),t&&t.topic&&"log4js:message"===t.topic){tt("received message: ",t.data);const e=nt.deserialise(t.data);ft(e)}};ut||rt.addListener((e=>{it.length=0,({pm2:st,disableClustering:ut,pm2InstanceVar:ct="NODE_APP_INSTANCE"}=e),tt(`clustering disabled ? ${ut}`),tt(`cluster.isMaster ? ${ot&&ot.isMaster}`),tt(`pm2 enabled ? ${st}`),tt(`pm2InstanceVar = ${ct}`),tt(`process.env[${ct}] = ${process.env[ct]}`),st&&process.removeListener("message",dt),ot&&ot.removeListener&&ot.removeListener("message",dt),ut||e.disableClustering?tt("Not listening for cluster messages, because clustering disabled."):at()?(tt("listening for PM2 broadcast messages"),process.on("message",dt)):ot&&ot.isMaster?(tt("listening for cluster messages"),ot.on("message",dt)):tt("not listening for messages, because we are not a master process")}));var Dt={onlyOnMaster:(e,t)=>lt()?e():t,isMaster:lt,send:e=>{lt()?ft(e):(st||(e.cluster={workerId:ot.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:e.serialise()}))},onMessage:e=>{it.push(e)}},pt={};function ht(e){if("number"==typeof e&&Number.isInteger(e))return e;const t={K:1024,M:1048576,G:1073741824},n=Object.keys(t),r=e.slice(-1).toLocaleUpperCase(),u=e.slice(0,-1).trim();if(n.indexOf(r)<0||!Number.isInteger(Number(u)))throw Error(`maxLogSize: "${e}" is invalid`);return u*t[r]}function Et(e){return function(e,t){const n=Object.assign({},t);return Object.keys(e).forEach((r=>{n[r]&&(n[r]=e[r](t[r]))})),n}({maxLogSize:ht},e)}const mt={dateFile:Et,file:Et,fileSync:Et};pt.modifyConfig=e=>mt[e.type]?mt[e.type](e):e;var yt={};const Ct=console.log.bind(console);yt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{Ct(e(n,t))}}(n,e.timezoneOffset)};var Ft={};Ft.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stdout.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var gt={};gt.configure=function(e,t){let n=t.colouredLayout;return e.layout&&(n=t.layout(e.layout.type,e.layout)),function(e,t){return n=>{process.stderr.write(`${e(n,t)}\n`)}}(n,e.timezoneOffset)};var At={};At.configure=function(e,t,n,r){const u=n(e.appender);return function(e,t,n,r){const u=r.getLevel(e),o=r.getLevel(t,r.FATAL);return e=>{const t=e.level;u.isLessThanOrEqualTo(t)&&o.isGreaterThanOrEqualTo(t)&&n(e)}}(e.level,e.maxLevel,u,r)};var vt={};const St=G.exports("log4js:categoryFilter");vt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return"string"==typeof e&&(e=[e]),n=>{St(`Checking ${n.categoryName} against ${e}`),-1===e.indexOf(n.categoryName)&&(St("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var wt={};const Ot=G.exports("log4js:noLogFilter");wt.configure=function(e,t,n){const r=n(e.appender);return function(e,t){return n=>{Ot(`Checking data: ${n.data} against filters: ${e}`),"string"==typeof e&&(e=[e]),e=e.filter((e=>null!=e&&""!==e));const r=new RegExp(e.join("|"),"i");(0===e.length||n.data.findIndex((e=>r.test(e)))<0)&&(Ot("Not excluded, sending to appender"),t(n))}}(e.exclude,r)};var _t={},bt={exports:{}},Bt={},Pt={fromCallback:function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise(((t,n)=>{arguments[arguments.length]=(e,r)=>{if(e)return n(e);t(r)},arguments.length++,e.apply(this,arguments)}));e.apply(this,arguments)}),"name",{value:e.name})},fromPromise:function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then((e=>t(null,e)),t)}),"name",{value:e.name})}},kt=c,It=process.cwd,xt=null,Nt=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return xt||(xt=It.call(process)),xt};try{process.cwd()}catch(e){}if("function"==typeof process.chdir){var Rt=process.chdir;process.chdir=function(e){xt=null,Rt.call(process,e)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Rt)}var Tt=function(e){kt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&function(e){e.lchmod=function(t,n,r){e.open(t,kt.O_WRONLY|kt.O_SYMLINK,n,(function(t,u){t?r&&r(t):e.fchmod(u,n,(function(t){e.close(u,(function(e){r&&r(t||e)}))}))}))},e.lchmodSync=function(t,n){var r,u=e.openSync(t,kt.O_WRONLY|kt.O_SYMLINK,n),o=!0;try{r=e.fchmodSync(u,n),o=!1}finally{if(o)try{e.closeSync(u)}catch(e){}else e.closeSync(u)}return r}}(e);e.lutimes||function(e){kt.hasOwnProperty("O_SYMLINK")&&e.futimes?(e.lutimes=function(t,n,r,u){e.open(t,kt.O_SYMLINK,(function(t,o){t?u&&u(t):e.futimes(o,n,r,(function(t){e.close(o,(function(e){u&&u(t||e)}))}))}))},e.lutimesSync=function(t,n,r){var u,o=e.openSync(t,kt.O_SYMLINK),i=!0;try{u=e.futimesSync(o,n,r),i=!1}finally{if(i)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return u}):e.futimes&&(e.lutimes=function(e,t,n,r){r&&process.nextTick(r)},e.lutimesSync=function(){})}(e);e.chown=r(e.chown),e.fchown=r(e.fchown),e.lchown=r(e.lchown),e.chmod=t(e.chmod),e.fchmod=t(e.fchmod),e.lchmod=t(e.lchmod),e.chownSync=u(e.chownSync),e.fchownSync=u(e.fchownSync),e.lchownSync=u(e.lchownSync),e.chmodSync=n(e.chmodSync),e.fchmodSync=n(e.fchmodSync),e.lchmodSync=n(e.lchmodSync),e.stat=o(e.stat),e.fstat=o(e.fstat),e.lstat=o(e.lstat),e.statSync=i(e.statSync),e.fstatSync=i(e.fstatSync),e.lstatSync=i(e.lstatSync),e.chmod&&!e.lchmod&&(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){});e.chown&&!e.lchown&&(e.lchown=function(e,t,n,r){r&&process.nextTick(r)},e.lchownSync=function(){});"win32"===Nt&&(e.rename="function"!=typeof e.rename?e.rename:function(t){function n(n,r,u){var o=Date.now(),i=0;t(n,r,(function s(c){if(c&&("EACCES"===c.code||"EPERM"===c.code||"EBUSY"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(r,(function(e,o){e&&"ENOENT"===e.code?t(n,r,s):u(c)}))}),i),void(i<100&&(i+=10));u&&u(c)}))}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.rename));function t(t){return t?function(n,r,u){return t.call(e,n,r,(function(e){s(e)&&(e=null),u&&u.apply(this,arguments)}))}:t}function n(t){return t?function(n,r){try{return t.call(e,n,r)}catch(e){if(!s(e))throw e}}:t}function r(t){return t?function(n,r,u,o){return t.call(e,n,r,u,(function(e){s(e)&&(e=null),o&&o.apply(this,arguments)}))}:t}function u(t){return t?function(n,r,u){try{return t.call(e,n,r,u)}catch(e){if(!s(e))throw e}}:t}function o(t){return t?function(n,r,u){function o(e,t){t&&(t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296)),u&&u.apply(this,arguments)}return"function"==typeof r&&(u=r,r=null),r?t.call(e,n,r,o):t.call(e,n,o)}:t}function i(t){return t?function(n,r){var u=r?t.call(e,n,r):t.call(e,n);return u&&(u.uid<0&&(u.uid+=4294967296),u.gid<0&&(u.gid+=4294967296)),u}:t}function s(e){return!e||("ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code))}e.read="function"!=typeof e.read?e.read:function(t){function n(n,r,u,o,i,s){var c;if(s&&"function"==typeof s){var a=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&a<10)return a++,t.call(e,n,r,u,o,i,c);s.apply(this,arguments)}}return t.call(e,n,r,u,o,i,c)}return Object.setPrototypeOf&&Object.setPrototypeOf(n,t),n}(e.read),e.readSync="function"!=typeof e.readSync?e.readSync:(c=e.readSync,function(t,n,r,u,o){for(var i=0;;)try{return c.call(e,t,n,r,u,o)}catch(e){if("EAGAIN"===e.code&&i<10){i++;continue}throw e}});var c};var Mt=a.Stream,Lt=function(e){return{ReadStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this);var u=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,r=r||{};for(var o=Object.keys(r),i=0,s=o.length;i<s;i++){var c=o[i];this[c]=r[c]}this.encoding&&this.setEncoding(this.encoding);if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=1/0;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(null!==this.fd)return void process.nextTick((function(){u._read()}));e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return u.emit("error",e),void(u.readable=!1);u.fd=t,u.emit("open",t),u._read()}))},WriteStream:function t(n,r){if(!(this instanceof t))return new t(n,r);Mt.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,r=r||{};for(var u=Object.keys(r),o=0,i=u.length;o<i;o++){var s=u[o];this[s]=r[s]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}};var jt=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var t={__proto__:$t(e)};else t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t},$t=Object.getPrototypeOf||function(e){return e.__proto__};var Ht,Gt,Vt=n,Ut=Tt,Jt=Lt,Wt=jt,zt=i;function Kt(e,t){Object.defineProperty(e,Ht,{get:function(){return t}})}"function"==typeof Symbol&&"function"==typeof Symbol.for?(Ht=Symbol.for("graceful-fs.queue"),Gt=Symbol.for("graceful-fs.previous")):(Ht="___graceful-fs.queue",Gt="___graceful-fs.previous");var qt=function(){};if(zt.debuglog?qt=zt.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(qt=function(){var e=zt.format.apply(zt,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: "),console.error(e)}),!Vt[Ht]){var Yt=p[Ht]||[];Kt(Vt,Yt),Vt.close=function(e){function t(t,n){return e.call(Vt,t,(function(e){e||tn(),"function"==typeof n&&n.apply(this,arguments)}))}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.close),Vt.closeSync=function(e){function t(t){e.apply(Vt,arguments),tn()}return Object.defineProperty(t,Gt,{value:e}),t}(Vt.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",(function(){qt(Vt[Ht]),l.equal(Vt[Ht].length,0)}))}p[Ht]||Kt(p,Vt[Ht]);var Zt,Xt=Qt(Wt(Vt));function Qt(e){Ut(e),e.gracefulify=Qt,e.createReadStream=function(t,n){return new e.ReadStream(t,n)},e.createWriteStream=function(t,n){return new e.WriteStream(t,n)};var t=e.readFile;e.readFile=function(e,n,r){"function"==typeof n&&(r=n,n=null);return function e(n,r,u,o){return t(n,r,(function(t){!t||"EMFILE"!==t.code&&"ENFILE"!==t.code?"function"==typeof u&&u.apply(this,arguments):en([e,[n,r,u],t,o||Date.now(),Date.now()])}))}(e,n,r)};var n=e.writeFile;e.writeFile=function(e,t,r,u){"function"==typeof r&&(u=r,r=null);return function e(t,r,u,o,i){return n(t,r,u,(function(n){!n||"EMFILE"!==n.code&&"ENFILE"!==n.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,r,u,o],n,i||Date.now(),Date.now()])}))}(e,t,r,u)};var r=e.appendFile;r&&(e.appendFile=function(e,t,n,u){"function"==typeof n&&(u=n,n=null);return function e(t,n,u,o,i){return r(t,n,u,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,u,o],r,i||Date.now(),Date.now()])}))}(e,t,n,u)});var u=e.copyFile;u&&(e.copyFile=function(e,t,n,r){"function"==typeof n&&(r=n,n=0);return function e(t,n,r,o,i){return u(t,n,r,(function(u){!u||"EMFILE"!==u.code&&"ENFILE"!==u.code?"function"==typeof o&&o.apply(this,arguments):en([e,[t,n,r,o],u,i||Date.now(),Date.now()])}))}(e,t,n,r)});var o=e.readdir;e.readdir=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=i.test(process.version)?function(e,t,n,r){return o(e,u(e,t,n,r))}:function(e,t,n,r){return o(e,t,u(e,t,n,r))};return r(e,t,n);function u(e,t,n,u){return function(o,i){!o||"EMFILE"!==o.code&&"ENFILE"!==o.code?(i&&i.sort&&i.sort(),"function"==typeof n&&n.call(this,o,i)):en([r,[e,t,n],o,u||Date.now(),Date.now()])}}};var i=/^v[0-5]\./;if("v0.8"===process.version.substr(0,4)){var s=Jt(e);d=s.ReadStream,D=s.WriteStream}var c=e.ReadStream;c&&(d.prototype=Object.create(c.prototype),d.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))});var a=e.WriteStream;a&&(D.prototype=Object.create(a.prototype),D.prototype.open=function(){var e=this;h(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))}),Object.defineProperty(e,"ReadStream",{get:function(){return d},set:function(e){d=e},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return D},set:function(e){D=e},enumerable:!0,configurable:!0});var l=d;Object.defineProperty(e,"FileReadStream",{get:function(){return l},set:function(e){l=e},enumerable:!0,configurable:!0});var f=D;function d(e,t){return this instanceof d?(c.apply(this,arguments),this):d.apply(Object.create(d.prototype),arguments)}function D(e,t){return this instanceof D?(a.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}Object.defineProperty(e,"FileWriteStream",{get:function(){return f},set:function(e){f=e},enumerable:!0,configurable:!0});var p=e.open;function h(e,t,n,r){return"function"==typeof n&&(r=n,n=null),function e(t,n,r,u,o){return p(t,n,r,(function(i,s){!i||"EMFILE"!==i.code&&"ENFILE"!==i.code?"function"==typeof u&&u.apply(this,arguments):en([e,[t,n,r,u],i,o||Date.now(),Date.now()])}))}(e,t,n,r)}return e.open=h,e}function en(e){qt("ENQUEUE",e[0].name,e[1]),Vt[Ht].push(e),nn()}function tn(){for(var e=Date.now(),t=0;t<Vt[Ht].length;++t)Vt[Ht][t].length>2&&(Vt[Ht][t][3]=e,Vt[Ht][t][4]=e);nn()}function nn(){if(clearTimeout(Zt),Zt=void 0,0!==Vt[Ht].length){var e=Vt[Ht].shift(),t=e[0],n=e[1],r=e[2],u=e[3],o=e[4];if(void 0===u)qt("RETRY",t.name,n),t.apply(null,n);else if(Date.now()-u>=6e4){qt("TIMEOUT",t.name,n);var i=n.pop();"function"==typeof i&&i.call(null,r)}else{var s=Date.now()-o,c=Math.max(o-u,1);s>=Math.min(1.2*c,100)?(qt("RETRY",t.name,n),t.apply(null,n.concat([u]))):Vt[Ht].push(e)}void 0===Zt&&(Zt=setTimeout(nn,0))}}process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Vt.__patched&&(Xt=Qt(Vt),Vt.__patched=!0),function(e){const t=Pt.fromCallback,n=Xt,r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((e=>"function"==typeof n[e]));Object.keys(n).forEach((t=>{"promises"!==t&&(e[t]=n[t])})),r.forEach((r=>{e[r]=t(n[r])})),e.exists=function(e,t){return"function"==typeof t?n.exists(e,t):new Promise((t=>n.exists(e,t)))},e.read=function(e,t,r,u,o,i){return"function"==typeof i?n.read(e,t,r,u,o,i):new Promise(((i,s)=>{n.read(e,t,r,u,o,((e,t,n)=>{if(e)return s(e);i({bytesRead:t,buffer:n})}))}))},e.write=function(e,t,...r){return"function"==typeof r[r.length-1]?n.write(e,t,...r):new Promise(((u,o)=>{n.write(e,t,...r,((e,t,n)=>{if(e)return o(e);u({bytesWritten:t,buffer:n})}))}))},"function"==typeof n.realpath.native&&(e.realpath.native=t(n.realpath.native))}(Bt);const rn=e;function un(e){return(e=rn.normalize(rn.resolve(e)).split(rn.sep)).length>0?e[0]:null}const on=/[<>:"|?*]/;var sn=function(e){const t=un(e);return e=e.replace(t,""),on.test(e)};const cn=Xt,an=e,ln=sn,fn=parseInt("0777",8);var dn=function e(t,n,r,u){if("function"==typeof n?(r=n,n={}):n&&"object"==typeof n||(n={mode:n}),"win32"===process.platform&&ln(t)){const e=new Error(t+" contains invalid WIN32 path characters.");return e.code="EINVAL",r(e)}let o=n.mode;const i=n.fs||cn;void 0===o&&(o=fn&~process.umask()),u||(u=null),r=r||function(){},t=an.resolve(t),i.mkdir(t,o,(o=>{if(!o)return r(null,u=u||t);if("ENOENT"===o.code){if(an.dirname(t)===t)return r(o);e(an.dirname(t),n,((u,o)=>{u?r(u,o):e(t,n,r,o)}))}else i.stat(t,((e,t)=>{e||!t.isDirectory()?r(o,u):r(null,u)}))}))};const Dn=Xt,pn=e,hn=sn,En=parseInt("0777",8);var mn=function e(t,n,r){n&&"object"==typeof n||(n={mode:n});let u=n.mode;const o=n.fs||Dn;if("win32"===process.platform&&hn(t)){const e=new Error(t+" contains invalid WIN32 path characters.");throw e.code="EINVAL",e}void 0===u&&(u=En&~process.umask()),r||(r=null),t=pn.resolve(t);try{o.mkdirSync(t,u),r=r||t}catch(u){if("ENOENT"===u.code){if(pn.dirname(t)===t)throw u;r=e(pn.dirname(t),n,r),e(t,n,r)}else{let e;try{e=o.statSync(t)}catch(e){throw u}if(!e.isDirectory())throw u}}return r};const yn=(0,Pt.fromCallback)(dn);var Cn={mkdirs:yn,mkdirsSync:mn,mkdirp:yn,mkdirpSync:mn,ensureDir:yn,ensureDirSync:mn};const Fn=Xt;var gn=function(e,t,n,r){Fn.open(e,"r+",((e,u)=>{if(e)return r(e);Fn.futimes(u,t,n,(e=>{Fn.close(u,(t=>{r&&r(e||t)}))}))}))},An=function(e,t,n){const r=Fn.openSync(e,"r+");return Fn.futimesSync(r,t,n),Fn.closeSync(r)};const vn=Xt,Sn=e,wn=10,On=5,_n=0,bn=process.versions.node.split("."),Bn=Number.parseInt(bn[0],10),Pn=Number.parseInt(bn[1],10),kn=Number.parseInt(bn[2],10);function In(){if(Bn>wn)return!0;if(Bn===wn){if(Pn>On)return!0;if(Pn===On&&kn>=_n)return!0}return!1}function xn(e,t){const n=Sn.resolve(e).split(Sn.sep).filter((e=>e)),r=Sn.resolve(t).split(Sn.sep).filter((e=>e));return n.reduce(((e,t,n)=>e&&r[n]===t),!0)}function Nn(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}var Rn,Tn,Mn={checkPaths:function(e,t,n,r){!function(e,t,n){In()?vn.stat(e,{bigint:!0},((e,r)=>{if(e)return n(e);vn.stat(t,{bigint:!0},((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))})):vn.stat(e,((e,r)=>{if(e)return n(e);vn.stat(t,((e,t)=>e?"ENOENT"===e.code?n(null,{srcStat:r,destStat:null}):n(e):n(null,{srcStat:r,destStat:t})))}))}(e,t,((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;return s&&s.ino&&s.dev&&s.ino===i.ino&&s.dev===i.dev?r(new Error("Source and destination must not be the same.")):i.isDirectory()&&xn(e,t)?r(new Error(Nn(e,t,n))):r(null,{srcStat:i,destStat:s})}))},checkPathsSync:function(e,t,n){const{srcStat:r,destStat:u}=function(e,t){let n,r;n=In()?vn.statSync(e,{bigint:!0}):vn.statSync(e);try{r=In()?vn.statSync(t,{bigint:!0}):vn.statSync(t)}catch(e){if("ENOENT"===e.code)return{srcStat:n,destStat:null};throw e}return{srcStat:n,destStat:r}}(e,t);if(u&&u.ino&&u.dev&&u.ino===r.ino&&u.dev===r.dev)throw new Error("Source and destination must not be the same.");if(r.isDirectory()&&xn(e,t))throw new Error(Nn(e,t,n));return{srcStat:r,destStat:u}},checkParentPaths:function e(t,n,r,u,o){const i=Sn.resolve(Sn.dirname(t)),s=Sn.resolve(Sn.dirname(r));if(s===i||s===Sn.parse(s).root)return o();In()?vn.stat(s,{bigint:!0},((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o))):vn.stat(s,((i,c)=>i?"ENOENT"===i.code?o():o(i):c.ino&&c.dev&&c.ino===n.ino&&c.dev===n.dev?o(new Error(Nn(t,r,u))):e(t,n,s,u,o)))},checkParentPathsSync:function e(t,n,r,u){const o=Sn.resolve(Sn.dirname(t)),i=Sn.resolve(Sn.dirname(r));if(i===o||i===Sn.parse(i).root)return;let s;try{s=In()?vn.statSync(i,{bigint:!0}):vn.statSync(i)}catch(e){if("ENOENT"===e.code)return;throw e}if(s.ino&&s.dev&&s.ino===n.ino&&s.dev===n.dev)throw new Error(Nn(t,r,u));return e(t,n,i,u)},isSrcSubdir:xn};const Ln=Xt,jn=e,$n=Cn.mkdirsSync,Hn=An,Gn=Mn;function Vn(e,t,n,r){if(!r.filter||r.filter(t,n))return function(e,t,n,r){const u=r.dereference?Ln.statSync:Ln.lstatSync,o=u(t);if(o.isDirectory())return function(e,t,n,r,u){if(!t)return function(e,t,n,r){return Ln.mkdirSync(n),Jn(t,n,r),Ln.chmodSync(n,e.mode)}(e,n,r,u);if(t&&!t.isDirectory())throw new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`);return Jn(n,r,u)}(o,e,t,n,r);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return function(e,t,n,r,u){return t?function(e,t,n,r){if(r.overwrite)return Ln.unlinkSync(n),Un(e,t,n,r);if(r.errorOnExist)throw new Error(`'${n}' already exists`)}(e,n,r,u):Un(e,n,r,u)}(o,e,t,n,r);if(o.isSymbolicLink())return function(e,t,n,r){let u=Ln.readlinkSync(t);r.dereference&&(u=jn.resolve(process.cwd(),u));if(e){let e;try{e=Ln.readlinkSync(n)}catch(e){if("EINVAL"===e.code||"UNKNOWN"===e.code)return Ln.symlinkSync(u,n);throw e}if(r.dereference&&(e=jn.resolve(process.cwd(),e)),Gn.isSrcSubdir(u,e))throw new Error(`Cannot copy '${u}' to a subdirectory of itself, '${e}'.`);if(Ln.statSync(n).isDirectory()&&Gn.isSrcSubdir(e,u))throw new Error(`Cannot overwrite '${e}' with '${u}'.`);return function(e,t){return Ln.unlinkSync(t),Ln.symlinkSync(e,t)}(u,n)}return Ln.symlinkSync(u,n)}(e,t,n,r)}(e,t,n,r)}function Un(e,t,n,r){return"function"==typeof Ln.copyFileSync?(Ln.copyFileSync(t,n),Ln.chmodSync(n,e.mode),r.preserveTimestamps?Hn(n,e.atime,e.mtime):void 0):function(e,t,n,r){const u=65536,o=(Tn?Rn:(Tn=1,Rn=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}))(u),i=Ln.openSync(t,"r"),s=Ln.openSync(n,"w",e.mode);let c=0;for(;c<e.size;){const e=Ln.readSync(i,o,0,u,c);Ln.writeSync(s,o,0,e),c+=e}r.preserveTimestamps&&Ln.futimesSync(s,e.atime,e.mtime);Ln.closeSync(i),Ln.closeSync(s)}(e,t,n,r)}function Jn(e,t,n){Ln.readdirSync(e).forEach((r=>function(e,t,n,r){const u=jn.join(t,e),o=jn.join(n,e),{destStat:i}=Gn.checkPathsSync(u,o,"copy");return Vn(i,u,o,r)}(r,e,t,n)))}var Wn=function(e,t,n){"function"==typeof n&&(n={filter:n}),(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269");const{srcStat:r,destStat:u}=Gn.checkPathsSync(e,t,"copy");return Gn.checkParentPathsSync(e,r,t,"copy"),function(e,t,n,r){if(r.filter&&!r.filter(t,n))return;const u=jn.dirname(n);Ln.existsSync(u)||$n(u);return Vn(e,t,n,r)}(u,e,t,n)},zn={copySync:Wn};const Kn=Pt.fromPromise,qn=Bt;var Yn={pathExists:Kn((function(e){return qn.access(e).then((()=>!0)).catch((()=>!1))})),pathExistsSync:qn.existsSync};const Zn=Xt,Xn=e,Qn=Cn.mkdirs,er=Yn.pathExists,tr=gn,nr=Mn;function rr(e,t,n,r,u){const o=Xn.dirname(n);er(o,((i,s)=>i?u(i):s?or(e,t,n,r,u):void Qn(o,(o=>o?u(o):or(e,t,n,r,u)))))}function ur(e,t,n,r,u,o){Promise.resolve(u.filter(n,r)).then((i=>i?e(t,n,r,u,o):o()),(e=>o(e)))}function or(e,t,n,r,u){return r.filter?ur(ir,e,t,n,r,u):ir(e,t,n,r,u)}function ir(e,t,n,r,u){(r.dereference?Zn.stat:Zn.lstat)(t,((o,i)=>o?u(o):i.isDirectory()?function(e,t,n,r,u,o){if(!t)return function(e,t,n,r,u){Zn.mkdir(n,(o=>{if(o)return u(o);ar(t,n,r,(t=>t?u(t):Zn.chmod(n,e.mode,u)))}))}(e,n,r,u,o);if(t&&!t.isDirectory())return o(new Error(`Cannot overwrite non-directory '${r}' with directory '${n}'.`));return ar(n,r,u,o)}(i,e,t,n,r,u):i.isFile()||i.isCharacterDevice()||i.isBlockDevice()?function(e,t,n,r,u,o){return t?function(e,t,n,r,u){if(!r.overwrite)return r.errorOnExist?u(new Error(`'${n}' already exists`)):u();Zn.unlink(n,(o=>o?u(o):sr(e,t,n,r,u)))}(e,n,r,u,o):sr(e,n,r,u,o)}(i,e,t,n,r,u):i.isSymbolicLink()?function(e,t,n,r,u){Zn.readlink(t,((t,o)=>t?u(t):(r.dereference&&(o=Xn.resolve(process.cwd(),o)),e?void Zn.readlink(n,((t,i)=>t?"EINVAL"===t.code||"UNKNOWN"===t.code?Zn.symlink(o,n,u):u(t):(r.dereference&&(i=Xn.resolve(process.cwd(),i)),nr.isSrcSubdir(o,i)?u(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${i}'.`)):e.isDirectory()&&nr.isSrcSubdir(i,o)?u(new Error(`Cannot overwrite '${i}' with '${o}'.`)):function(e,t,n){Zn.unlink(t,(r=>r?n(r):Zn.symlink(e,t,n)))}(o,n,u)))):Zn.symlink(o,n,u))))}(e,t,n,r,u):void 0))}function sr(e,t,n,r,u){return"function"==typeof Zn.copyFile?Zn.copyFile(t,n,(t=>t?u(t):cr(e,n,r,u))):function(e,t,n,r,u){const o=Zn.createReadStream(t);o.on("error",(e=>u(e))).once("open",(()=>{const t=Zn.createWriteStream(n,{mode:e.mode});t.on("error",(e=>u(e))).on("open",(()=>o.pipe(t))).once("close",(()=>cr(e,n,r,u)))}))}(e,t,n,r,u)}function cr(e,t,n,r){Zn.chmod(t,e.mode,(u=>u?r(u):n.preserveTimestamps?tr(t,e.atime,e.mtime,r):r()))}function ar(e,t,n,r){Zn.readdir(e,((u,o)=>u?r(u):lr(o,e,t,n,r)))}function lr(e,t,n,r,u){const o=e.pop();return o?function(e,t,n,r,u,o){const i=Xn.join(n,t),s=Xn.join(r,t);nr.checkPaths(i,s,"copy",((t,c)=>{if(t)return o(t);const{destStat:a}=c;or(a,i,s,u,(t=>t?o(t):lr(e,n,r,u,o)))}))}(e,o,t,n,r,u):u()}var fr=function(e,t,n,r){"function"!=typeof n||r?"function"==typeof n&&(n={filter:n}):(r=n,n={}),r=r||function(){},(n=n||{}).clobber=!("clobber"in n)||!!n.clobber,n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&"ia32"===process.arch&&console.warn("fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269"),nr.checkPaths(e,t,"copy",((u,o)=>{if(u)return r(u);const{srcStat:i,destStat:s}=o;nr.checkParentPaths(e,i,t,"copy",(u=>u?r(u):n.filter?ur(rr,s,e,t,n,r):rr(s,e,t,n,r)))}))};var dr={copy:(0,Pt.fromCallback)(fr)};const Dr=Xt,pr=e,hr=l,Er="win32"===process.platform;function mr(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach((t=>{e[t]=e[t]||Dr[t],e[t+="Sync"]=e[t]||Dr[t]})),e.maxBusyTries=e.maxBusyTries||3}function yr(e,t,n){let r=0;"function"==typeof t&&(n=t,t={}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr.strictEqual(typeof n,"function","rimraf: callback function required"),hr(t,"rimraf: invalid options argument provided"),hr.strictEqual(typeof t,"object","rimraf: options should be object"),mr(t),Cr(e,t,(function u(o){if(o){if(("EBUSY"===o.code||"ENOTEMPTY"===o.code||"EPERM"===o.code)&&r<t.maxBusyTries){r++;return setTimeout((()=>Cr(e,t,u)),100*r)}"ENOENT"===o.code&&(o=null)}n(o)}))}function Cr(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.lstat(e,((r,u)=>r&&"ENOENT"===r.code?n(null):r&&"EPERM"===r.code&&Er?Fr(e,t,r,n):u&&u.isDirectory()?Ar(e,t,r,n):void t.unlink(e,(r=>{if(r){if("ENOENT"===r.code)return n(null);if("EPERM"===r.code)return Er?Fr(e,t,r,n):Ar(e,t,r,n);if("EISDIR"===r.code)return Ar(e,t,r,n)}return n(r)}))))}function Fr(e,t,n,r){hr(e),hr(t),hr("function"==typeof r),n&&hr(n instanceof Error),t.chmod(e,438,(u=>{u?r("ENOENT"===u.code?null:n):t.stat(e,((u,o)=>{u?r("ENOENT"===u.code?null:n):o.isDirectory()?Ar(e,t,n,r):t.unlink(e,r)}))}))}function gr(e,t,n){let r;hr(e),hr(t),n&&hr(n instanceof Error);try{t.chmodSync(e,438)}catch(e){if("ENOENT"===e.code)return;throw n}try{r=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}r.isDirectory()?Sr(e,t,n):t.unlinkSync(e)}function Ar(e,t,n,r){hr(e),hr(t),n&&hr(n instanceof Error),hr("function"==typeof r),t.rmdir(e,(u=>{!u||"ENOTEMPTY"!==u.code&&"EEXIST"!==u.code&&"EPERM"!==u.code?u&&"ENOTDIR"===u.code?r(n):r(u):function(e,t,n){hr(e),hr(t),hr("function"==typeof n),t.readdir(e,((r,u)=>{if(r)return n(r);let o,i=u.length;if(0===i)return t.rmdir(e,n);u.forEach((r=>{yr(pr.join(e,r),t,(r=>{if(!o)return r?n(o=r):void(0==--i&&t.rmdir(e,n))}))}))}))}(e,t,r)}))}function vr(e,t){let n;mr(t=t||{}),hr(e,"rimraf: missing path"),hr.strictEqual(typeof e,"string","rimraf: path should be a string"),hr(t,"rimraf: missing options"),hr.strictEqual(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&Er&&gr(e,t,n)}try{n&&n.isDirectory()?Sr(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return Er?gr(e,t,n):Sr(e,t,n);if("EISDIR"!==n.code)throw n;Sr(e,t,n)}}function Sr(e,t,n){hr(e),hr(t),n&&hr(n instanceof Error);try{t.rmdirSync(e)}catch(r){if("ENOTDIR"===r.code)throw n;if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)!function(e,t){if(hr(e),hr(t),t.readdirSync(e).forEach((n=>vr(pr.join(e,n),t))),!Er){return t.rmdirSync(e,t)}{const n=Date.now();do{try{return t.rmdirSync(e,t)}catch(e){}}while(Date.now()-n<500)}}(e,t);else if("ENOENT"!==r.code)throw r}}var wr=yr;yr.sync=vr;const Or=wr;var _r={remove:(0,Pt.fromCallback)(Or),removeSync:Or.sync};const br=Pt.fromCallback,Br=Xt,Pr=e,kr=Cn,Ir=_r,xr=br((function(e,t){t=t||function(){},Br.readdir(e,((n,r)=>{if(n)return kr.mkdirs(e,t);r=r.map((t=>Pr.join(e,t))),function e(){const n=r.pop();if(!n)return t();Ir.remove(n,(n=>{if(n)return t(n);e()}))}()}))}));function Nr(e){let t;try{t=Br.readdirSync(e)}catch(t){return kr.mkdirsSync(e)}t.forEach((t=>{t=Pr.join(e,t),Ir.removeSync(t)}))}var Rr={emptyDirSync:Nr,emptydirSync:Nr,emptyDir:xr,emptydir:xr};const Tr=Pt.fromCallback,Mr=e,Lr=Xt,jr=Cn,$r=Yn.pathExists;var Hr={createFile:Tr((function(e,t){function n(){Lr.writeFile(e,"",(e=>{if(e)return t(e);t()}))}Lr.stat(e,((r,u)=>{if(!r&&u.isFile())return t();const o=Mr.dirname(e);$r(o,((e,r)=>e?t(e):r?n():void jr.mkdirs(o,(e=>{if(e)return t(e);n()}))))}))})),createFileSync:function(e){let t;try{t=Lr.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=Mr.dirname(e);Lr.existsSync(n)||jr.mkdirsSync(n),Lr.writeFileSync(e,"")}};const Gr=Pt.fromCallback,Vr=e,Ur=Xt,Jr=Cn,Wr=Yn.pathExists;var zr={createLink:Gr((function(e,t,n){function r(e,t){Ur.link(e,t,(e=>{if(e)return n(e);n(null)}))}Wr(t,((u,o)=>u?n(u):o?n(null):void Ur.lstat(e,(u=>{if(u)return u.message=u.message.replace("lstat","ensureLink"),n(u);const o=Vr.dirname(t);Wr(o,((u,i)=>u?n(u):i?r(e,t):void Jr.mkdirs(o,(u=>{if(u)return n(u);r(e,t)}))))}))))})),createLinkSync:function(e,t){if(Ur.existsSync(t))return;try{Ur.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const n=Vr.dirname(t);return Ur.existsSync(n)||Jr.mkdirsSync(n),Ur.linkSync(e,t)}};const Kr=e,qr=Xt,Yr=Yn.pathExists;var Zr={symlinkPaths:function(e,t,n){if(Kr.isAbsolute(e))return qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e})));{const r=Kr.dirname(t),u=Kr.join(r,e);return Yr(u,((t,o)=>t?n(t):o?n(null,{toCwd:u,toDst:e}):qr.lstat(e,(t=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:Kr.relative(r,e)})))))}},symlinkPathsSync:function(e,t){let n;if(Kr.isAbsolute(e)){if(n=qr.existsSync(e),!n)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const r=Kr.dirname(t),u=Kr.join(r,e);if(n=qr.existsSync(u),n)return{toCwd:u,toDst:e};if(n=qr.existsSync(e),!n)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Kr.relative(r,e)}}}};const Xr=Xt;var Qr={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);Xr.lstat(e,((e,r)=>{if(e)return n(null,"file");t=r&&r.isDirectory()?"dir":"file",n(null,t)}))},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=Xr.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}};const eu=Pt.fromCallback,tu=e,nu=Xt,ru=Cn.mkdirs,uu=Cn.mkdirsSync,ou=Zr.symlinkPaths,iu=Zr.symlinkPathsSync,su=Qr.symlinkType,cu=Qr.symlinkTypeSync,au=Yn.pathExists;var lu={createSymlink:eu((function(e,t,n,r){r="function"==typeof n?n:r,n="function"!=typeof n&&n,au(t,((u,o)=>u?r(u):o?r(null):void ou(e,t,((u,o)=>{if(u)return r(u);e=o.toDst,su(o.toCwd,n,((n,u)=>{if(n)return r(n);const o=tu.dirname(t);au(o,((n,i)=>n?r(n):i?nu.symlink(e,t,u,r):void ru(o,(n=>{if(n)return r(n);nu.symlink(e,t,u,r)}))))}))}))))})),createSymlinkSync:function(e,t,n){if(nu.existsSync(t))return;const r=iu(e,t);e=r.toDst,n=cu(r.toCwd,n);const u=tu.dirname(t);return nu.existsSync(u)||uu(u),nu.symlinkSync(e,t,n)}};var fu,du={createFile:Hr.createFile,createFileSync:Hr.createFileSync,ensureFile:Hr.createFile,ensureFileSync:Hr.createFileSync,createLink:zr.createLink,createLinkSync:zr.createLinkSync,ensureLink:zr.createLink,ensureLinkSync:zr.createLinkSync,createSymlink:lu.createSymlink,createSymlinkSync:lu.createSymlinkSync,ensureSymlink:lu.createSymlink,ensureSymlinkSync:lu.createSymlinkSync};try{fu=Xt}catch(e){fu=n}function Du(e,t){var n,r="\n";return"object"==typeof t&&null!==t&&(t.spaces&&(n=t.spaces),t.EOL&&(r=t.EOL)),JSON.stringify(e,t?t.replacer:null,n).replace(/\n/g,r)+r}function pu(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var hu={readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var r=(t=t||{}).fs||fu,u=!0;"throws"in t&&(u=t.throws),r.readFile(e,t,(function(r,o){if(r)return n(r);var i;o=pu(o);try{i=JSON.parse(o,t?t.reviver:null)}catch(t){return u?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,i)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||fu,r=!0;"throws"in t&&(r=t.throws);try{var u=n.readFileSync(e,t);return u=pu(u),JSON.parse(u,t.reviver)}catch(t){if(r)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,r){null==r&&(r=n,n={});var u=(n=n||{}).fs||fu,o="";try{o=Du(t,n)}catch(e){return void(r&&r(e,null))}u.writeFile(e,o,n,r)},writeFileSync:function(e,t,n){var r=(n=n||{}).fs||fu,u=Du(t,n);return r.writeFileSync(e,u,n)}},Eu=hu;const mu=Pt.fromCallback,yu=Eu;var Cu={readJson:mu(yu.readFile),readJsonSync:yu.readFileSync,writeJson:mu(yu.writeFile),writeJsonSync:yu.writeFileSync};const Fu=e,gu=Cn,Au=Yn.pathExists,vu=Cu;var Su=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=Fu.dirname(e);Au(u,((o,i)=>o?r(o):i?vu.writeJson(e,t,n,r):void gu.mkdirs(u,(u=>{if(u)return r(u);vu.writeJson(e,t,n,r)}))))};const wu=Xt,Ou=e,_u=Cn,bu=Cu;var Bu=function(e,t,n){const r=Ou.dirname(e);wu.existsSync(r)||_u.mkdirsSync(r),bu.writeJsonSync(e,t,n)};const Pu=Pt.fromCallback,ku=Cu;ku.outputJson=Pu(Su),ku.outputJsonSync=Bu,ku.outputJSON=ku.outputJson,ku.outputJSONSync=ku.outputJsonSync,ku.writeJSON=ku.writeJson,ku.writeJSONSync=ku.writeJsonSync,ku.readJSON=ku.readJson,ku.readJSONSync=ku.readJsonSync;var Iu=ku;const xu=Xt,Nu=e,Ru=zn.copySync,Tu=_r.removeSync,Mu=Cn.mkdirpSync,Lu=Mn;function ju(e,t,n){try{xu.renameSync(e,t)}catch(r){if("EXDEV"!==r.code)throw r;return function(e,t,n){const r={overwrite:n,errorOnExist:!0};return Ru(e,t,r),Tu(e)}(e,t,n)}}var $u=function(e,t,n){const r=(n=n||{}).overwrite||n.clobber||!1,{srcStat:u}=Lu.checkPathsSync(e,t,"move");return Lu.checkParentPathsSync(e,u,t,"move"),Mu(Nu.dirname(t)),function(e,t,n){if(n)return Tu(t),ju(e,t,n);if(xu.existsSync(t))throw new Error("dest already exists.");return ju(e,t,n)}(e,t,r)},Hu={moveSync:$u};const Gu=Xt,Vu=e,Uu=dr.copy,Ju=_r.remove,Wu=Cn.mkdirp,zu=Yn.pathExists,Ku=Mn;function qu(e,t,n,r){Gu.rename(e,t,(u=>u?"EXDEV"!==u.code?r(u):function(e,t,n,r){const u={overwrite:n,errorOnExist:!0};Uu(e,t,u,(t=>t?r(t):Ju(e,r)))}(e,t,n,r):r()))}var Yu=function(e,t,n,r){"function"==typeof n&&(r=n,n={});const u=n.overwrite||n.clobber||!1;Ku.checkPaths(e,t,"move",((n,o)=>{if(n)return r(n);const{srcStat:i}=o;Ku.checkParentPaths(e,i,t,"move",(n=>{if(n)return r(n);Wu(Vu.dirname(t),(n=>n?r(n):function(e,t,n,r){if(n)return Ju(t,(u=>u?r(u):qu(e,t,n,r)));zu(t,((u,o)=>u?r(u):o?r(new Error("dest already exists.")):qu(e,t,n,r)))}(e,t,u,r)))}))}))};var Zu={move:(0,Pt.fromCallback)(Yu)};const Xu=Pt.fromCallback,Qu=Xt,eo=e,to=Cn,no=Yn.pathExists;var ro={outputFile:Xu((function(e,t,n,r){"function"==typeof n&&(r=n,n="utf8");const u=eo.dirname(e);no(u,((o,i)=>o?r(o):i?Qu.writeFile(e,t,n,r):void to.mkdirs(u,(u=>{if(u)return r(u);Qu.writeFile(e,t,n,r)}))))})),outputFileSync:function(e,...t){const n=eo.dirname(e);if(Qu.existsSync(n))return Qu.writeFileSync(e,...t);to.mkdirsSync(n),Qu.writeFileSync(e,...t)}};!function(e){e.exports=Object.assign({},Bt,zn,dr,Rr,du,Iu,Cn,Hu,Zu,ro,Yn,_r);const t=n;Object.getOwnPropertyDescriptor(t,"promises")&&Object.defineProperty(e.exports,"promises",{get:()=>t.promises})}(bt);const uo=G.exports("streamroller:fileNameFormatter"),oo=e;const io=G.exports("streamroller:fileNameParser"),so=de.exports;const co=G.exports("streamroller:moveAndMaybeCompressFile"),ao=bt.exports,lo=f;var fo=async(e,t,n)=>{if(n=function(e){const t={mode:parseInt("0600",8),compress:!1},n=Object.assign({},t,e);return co(`_parseOption: moveAndMaybeCompressFile called with option=${JSON.stringify(n)}`),n}(n),e!==t){if(await ao.pathExists(e))if(co(`moveAndMaybeCompressFile: moving file from ${e} to ${t} ${n.compress?"with":"without"} compress`),n.compress)await new Promise(((r,u)=>{let o=!1;const i=ao.createWriteStream(t,{mode:n.mode,flags:"wx"}).on("open",(()=>{o=!0;const t=ao.createReadStream(e).on("open",(()=>{t.pipe(lo.createGzip()).pipe(i)})).on("error",(t=>{co(`moveAndMaybeCompressFile: error reading ${e}`,t),i.destroy(t)}))})).on("finish",(()=>{co(`moveAndMaybeCompressFile: finished compressing ${t}, deleting ${e}`),ao.unlink(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error deleting ${e}, truncating instead`,t),ao.truncate(e).then(r).catch((t=>{co(`moveAndMaybeCompressFile: error truncating ${e}`,t),u(t)}))}))})).on("error",(e=>{o?(co(`moveAndMaybeCompressFile: error writing ${t}, deleting`,e),ao.unlink(t).then((()=>{u(e)})).catch((e=>{co(`moveAndMaybeCompressFile: error deleting ${t}`,e),u(e)}))):(co(`moveAndMaybeCompressFile: error creating ${t}`,e),u(e))}))})).catch((()=>{}));else{co(`moveAndMaybeCompressFile: renaming ${e} to ${t}`);try{await ao.move(e,t,{overwrite:!0})}catch(n){if(co(`moveAndMaybeCompressFile: error renaming ${e} to ${t}`,n),"ENOENT"!==n.code){co("moveAndMaybeCompressFile: trying copy+truncate instead");try{await ao.copy(e,t,{overwrite:!0}),await ao.truncate(e)}catch(e){co("moveAndMaybeCompressFile: error copy+truncate",e)}}}}}else co("moveAndMaybeCompressFile: source and target are the same, not doing anything")};const Do=G.exports("streamroller:RollingFileWriteStream"),po=bt.exports,ho=e,Eo=t,mo=()=>new Date,yo=de.exports,{Writable:Co}=a,Fo=({file:e,keepFileExt:t,needsIndex:n,alwaysIncludeDate:r,compress:u,fileNameSep:o})=>{let i=o||".";const s=oo.join(e.dir,e.name),c=t=>t+e.ext,a=(e,t,r)=>!n&&r||!t?e:e+i+t,l=(e,t,n)=>(t>0||r)&&n?e+i+n:e,f=(e,t)=>t&&u?e+".gz":e,d=t?[l,a,c,f]:[c,l,a,f];return({date:e,index:t})=>(uo(`_formatFileName: date=${e}, index=${t}`),d.reduce(((n,r)=>r(n,t,e)),s))},go=({file:e,keepFileExt:t,pattern:n,fileNameSep:r})=>{let u=r||".";const o="__NOT_MATCHING__";let i=[(e,t)=>e.endsWith(".gz")?(io("it is gzipped"),t.isCompressed=!0,e.slice(0,-3)):e,t?t=>t.startsWith(e.name)&&t.endsWith(e.ext)?(io("it starts and ends with the right things"),t.slice(e.name.length+1,-1*e.ext.length)):o:t=>t.startsWith(e.base)?(io("it starts with the right things"),t.slice(e.base.length+1)):o,n?(e,t)=>{const r=e.split(u);let o=r[r.length-1];io("items: ",r,", indexStr: ",o);let i=e;void 0!==o&&o.match(/^\d+$/)?(i=e.slice(0,-1*(o.length+1)),io(`dateStr is ${i}`),n&&!i&&(i=o,o="0")):o="0";try{const r=so.parse(n,i,new Date(0,0));return so.asString(n,r)!==i?e:(t.index=parseInt(o,10),t.date=i,t.timestamp=r.getTime(),"")}catch(t){return io(`Problem parsing ${i} as ${n}, error was: `,t),e}}:(e,t)=>e.match(/^\d+$/)?(io("it has an index"),t.index=parseInt(e,10),""):e];return e=>{let t={filename:e,index:0,isCompressed:!1};return i.reduce(((e,n)=>n(e,t)),e)?null:t}},Ao=fo;var vo=class extends Co{constructor(e,t){if(Do(`constructor: creating RollingFileWriteStream. path=${e}`),"string"!=typeof e||0===e.length)throw new Error(`Invalid filename: ${e}`);if(e.endsWith(ho.sep))throw new Error(`Filename is a directory: ${e}`);0===e.indexOf(`~${ho.sep}`)&&(e=e.replace("~",Eo.homedir())),super(t),this.options=this._parseOption(t),this.fileObject=ho.parse(e),""===this.fileObject.dir&&(this.fileObject=ho.parse(ho.join(process.cwd(),e))),this.fileFormatter=Fo({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt,fileNameSep:this.options.fileNameSep}),this.fileNameParser=go({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern,fileNameSep:this.options.fileNameSep}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,mo())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),Do(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{const e=po.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=yo(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){const t={maxSize:0,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0600",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},n=Object.assign({},t,e);if(n.maxSize){if(n.maxSize<=0)throw new Error(`options.maxSize (${n.maxSize}) should be > 0`)}else delete n.maxSize;if(n.numBackups||0===n.numBackups){if(n.numBackups<0)throw new Error(`options.numBackups (${n.numBackups}) should be >= 0`);if(n.numBackups>=Number.MAX_SAFE_INTEGER)throw new Error(`options.numBackups (${n.numBackups}) should be < Number.MAX_SAFE_INTEGER`);n.numToKeep=n.numBackups+1}else if(n.numToKeep<=0)throw new Error(`options.numToKeep (${n.numToKeep}) should be > 0`);return Do(`_parseOption: creating stream with option=${JSON.stringify(n)}`),n}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,n){this._shouldRoll().then((()=>{Do(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,(t=>{this.state.currentSize+=e.length,n(t)}))}))}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(Do(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==yo(this.options.pattern,mo())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return Do("_roll: closing the current stream"),new Promise(((e,t)=>{this.currentFileStream.end("",this.options.encoding,(()=>{this._moveOldFiles().then(e).catch(t)}))}))}async _moveOldFiles(){const e=await this._getExistingFiles();for(let t=(this.state.currentDate?e.filter((e=>e.date===this.state.currentDate)):e).length;t>=0;t--){Do(`_moveOldFiles: i = ${t}`);const e=this.fileFormatter({date:this.state.currentDate,index:t}),n=this.fileFormatter({date:this.state.currentDate,index:t+1}),r={compress:this.options.compress&&0===t,mode:this.options.mode};await Ao(e,n,r)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?yo(this.options.pattern,mo()):null,Do(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise(((e,t)=>{this.currentFileStream.write("","utf8",(()=>{this._clean().then(e).catch(t)}))}))}async _getExistingFiles(){const e=await po.readdir(this.fileObject.dir).catch((()=>[]));Do(`_getExistingFiles: files=${e}`);const t=e.map((e=>this.fileNameParser(e))).filter((e=>e)),n=e=>(e.timestamp?e.timestamp:mo().getTime())-e.index;return t.sort(((e,t)=>n(e)-n(t))),t}_renewWriteStream(){const e=this.fileFormatter({date:this.state.currentDate,index:0}),t=e=>{try{return po.mkdirSync(e,{recursive:!0})}catch(n){if("ENOENT"===n.code)return t(ho.dirname(e)),t(e);if("EEXIST"!==n.code&&"EROFS"!==n.code)throw n;try{if(po.statSync(e).isDirectory())return e;throw n}catch(e){throw n}}};t(this.fileObject.dir);const n={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};var r,u;po.appendFileSync(e,"",(r={...n},u="flags",r["flag"]=r[u],delete r[u],r)),this.currentFileStream=po.createWriteStream(e,n),this.currentFileStream.on("error",(e=>{this.emit("error",e)}))}async _clean(){const e=await t (…)

Completed in 1218 milliseconds

12345678910>>...46