diff --git a/README.md b/README.md index b8dcdb0..46481ce 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,15 @@ The API to use the GitHub action or Azure DevOps task is similar - `thresholds`: A comma seperated list of thresholds for each of the metrics in bytes. If this is empty, no thresholding will apply. When this is not empty, the task will fail when any of the given thresholds are crossed - required: false - default: '' +- `telemetryEnabled`: Set to `false` to disable telemetry + - required: false + - default: 'true' + +# Data Collection + +The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices. + +To disable data collection when using this extension, set the `telemetryEnabled` input to `false` # Contributing diff --git a/action.yml b/action.yml index c0a8404..5534a6a 100644 --- a/action.yml +++ b/action.yml @@ -32,6 +32,10 @@ inputs: description: 'A comma seperated list of thresholds for each of the metrics in bytes. If this is empty, no thresholding will apply. When this is not empty, the task will fail when any of the given thresholds are crossed' required: false default: '' + telemetryEnabled: + description: 'Set to `false` to disable telemetry' + required: false + default: 'true' runs: using: 'node12' main: 'dist_gh_action/index.js' diff --git a/ado-extension.json b/ado-extension.json index f773e6e..8659d1e 100644 --- a/ado-extension.json +++ b/ado-extension.json @@ -2,7 +2,7 @@ "manifestVersion": 1, "id": "android-app-size-diff-utils", "name": "Android app size changes", - "version": "0.0.29", + "version": "0.0.30", "publisher": "PraveenPendyala", "targets": [ { diff --git a/dist_gh_action/index.js b/dist_gh_action/index.js index 74213f4..5f090ab 100644 --- a/dist_gh_action/index.js +++ b/dist_gh_action/index.js @@ -1 +1 @@ -module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var r=n[t]={i:t,l:false,exports:{}};e[t].call(r.exports,r,r.exports,__webpack_require__);r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(860)}return startup()}({4:function(e,t,n){e.exports=function(e){var t=n(761);var r={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:function(){return t.deflateRawSync(e,r)},deflateAsync:function(n){var i=t.createDeflateRaw(r),o=[],s=0;i.on("data",function(e){o.push(e);s+=e.length});i.on("end",function(){var e=Buffer.alloc(s),t=0;e.fill(0);for(var r=0;r0?t:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date("+Date.now()+")/",Version:r.tags[r.keys.internalSdkVersion],StreamId:u,MachineName:o,Instance:s};return a};QuickPulseEnvelopeFactory.createQuickPulseMetric=function(e){var t;t={Name:e.name,Value:e.value,Weight:e.count||1};return t};QuickPulseEnvelopeFactory.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case o.TelemetryTypeString.Event:return QuickPulseEnvelopeFactory.createQuickPulseEventDocument(e);case o.TelemetryTypeString.Exception:return QuickPulseEnvelopeFactory.createQuickPulseExceptionDocument(e);case o.TelemetryTypeString.Trace:return QuickPulseEnvelopeFactory.createQuickPulseTraceDocument(e);case o.TelemetryTypeString.Dependency:return QuickPulseEnvelopeFactory.createQuickPulseDependencyDocument(e);case o.TelemetryTypeString.Request:return QuickPulseEnvelopeFactory.createQuickPulseRequestDocument(e)}return null};QuickPulseEnvelopeFactory.createQuickPulseEventDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.name;var i=r({},t,{Name:n});return i};QuickPulseEnvelopeFactory.createQuickPulseTraceDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.severityLevel||0;var i=r({},t,{Message:e.data.baseData.message,SeverityLevel:o.SeverityLevel[n]});return i};QuickPulseEnvelopeFactory.createQuickPulseExceptionDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.exceptions;var i="";var o="";var s="";if(n&&n.length>0){if(n[0].parsedStack&&n[0].parsedStack.length>0){n[0].parsedStack.forEach(function(e){i+=e.assembly+"\n"})}else if(n[0].stack&&n[0].stack.length>0){i=n[0].stack}o=n[0].message;s=n[0].typeName}var a=r({},t,{Exception:i,ExceptionMessage:o,ExceptionType:s});return a};QuickPulseEnvelopeFactory.createQuickPulseRequestDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData;var i=r({},t,{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return i};QuickPulseEnvelopeFactory.createQuickPulseDependencyDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData;var i=r({},t,{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:t.OperationId,DependencyTypeName:n.type});return i};QuickPulseEnvelopeFactory.createQuickPulseDocument=function(e){var t;var n;var r,i;if(e.data.baseType){n=s.TelemetryTypeStringToQuickPulseType[e.data.baseType];t=s.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]}else{c.warn("Document type invalid; not sending live metric document",e.data.baseType)}r=e.tags[QuickPulseEnvelopeFactory.keys.operationId];i=QuickPulseEnvelopeFactory.aggregateProperties(e);var o={DocumentType:t,__type:n,OperationId:r,Version:"1.0",Properties:i};return o};QuickPulseEnvelopeFactory.aggregateProperties=function(e){var t=[];var n=e.data.baseData.measurements||{};for(var r in n){if(n.hasOwnProperty(r)){var i=n[r];var o={key:r,value:i};t.push(o)}}var s=e.data.baseData.properties||{};for(var r in s){if(s.hasOwnProperty(r)){var i=s[r];var o={key:r,value:i};t.push(o)}}return t};QuickPulseEnvelopeFactory.keys=new o.ContextTagKeys;return QuickPulseEnvelopeFactory}();e.exports=f},14:function(e,t,n){"use strict";var r=n(179);var i=n(769);var o=function(){function Traceparent(e,t){this.traceFlag=Traceparent.DEFAULT_TRACE_FLAG;this.version=Traceparent.DEFAULT_VERSION;if(e&&typeof e==="string"){if(e.split(",").length>1){this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}else{var n=e.trim().split("-");var o=n.length;if(o>=4){this.version=n[0];this.traceId=n[1];this.spanId=n[2];this.traceFlag=n[3]}else{this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(!this.version.match(/^[0-9a-f]{2}$/g)){this.version=Traceparent.DEFAULT_VERSION;this.traceId=r.w3cTraceId()}if(this.version==="00"&&o!==4){this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(this.version==="ff"){this.version=Traceparent.DEFAULT_VERSION;this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(!this.version.match(/^0[0-9a-f]$/g)){this.version=Traceparent.DEFAULT_VERSION}if(!this.traceFlag.match(/^[0-9a-f]{2}$/g)){this.traceFlag=Traceparent.DEFAULT_TRACE_FLAG;this.traceId=r.w3cTraceId()}if(!Traceparent.isValidTraceId(this.traceId)){this.traceId=r.w3cTraceId()}if(!Traceparent.isValidSpanId(this.spanId)){this.spanId=r.w3cTraceId().substr(0,16);this.traceId=r.w3cTraceId()}this.parentId=this.getBackCompatRequestId()}}else if(t){this.parentId=t.slice();var s=i.getRootId(t);if(!Traceparent.isValidTraceId(s)){this.legacyRootId=s;s=r.w3cTraceId()}if(t.indexOf("|")!==-1){t=t.substring(1+t.substring(0,t.length-1).lastIndexOf("."),t.length-1)}this.traceId=s;this.spanId=t}else{this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}}Traceparent.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"};Traceparent.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"};Traceparent.prototype.getBackCompatRequestId=function(){return"|"+this.traceId+"."+this.spanId+"."};Traceparent.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag};Traceparent.prototype.updateSpanId=function(){this.spanId=r.w3cTraceId().substr(0,16)};Traceparent.DEFAULT_TRACE_FLAG="01";Traceparent.DEFAULT_VERSION="00";return Traceparent}();e.exports=o},26:function(e,t,n){var r=n(519).require(),i=n(622);r.existsSync=r.existsSync||i.existsSync;e.exports=function(){var e=[],t=n(589),o=n(799),s=i.sep;function mkdirSync(e){var t=e.split(s)[0];e.split(s).forEach(function(e){if(!e||e.substr(-1,1)===":")return;t+=s+e;var n;try{n=r.statSync(t)}catch(e){r.mkdirSync(t)}if(n&&n.isFile())throw o.FILE_IN_THE_WAY.replace("%s",t)})}function findSync(e,t,n){if(typeof t==="boolean"){n=t;t=undefined}var o=[];r.readdirSync(e).forEach(function(a){var c=i.join(e,a);if(r.statSync(c).isDirectory()&&n)o=o.concat(findSync(c,t,n));if(!t||t.test(c)){o.push(i.normalize(c)+(r.statSync(c).isDirectory()?s:""))}});return o}return{makeDir:function(e){mkdirSync(e)},crc32:function(t){if(typeof t==="string"){t=Buffer.alloc(t.length,t)}var n=Buffer.alloc(4);if(!e.length){for(var r=0;r<256;r++){var i=r;for(var o=8;--o>=0;)if((i&1)!==0){i=3988292384^i>>>1}else{i=i>>>1}if(i<0){n.writeInt32LE(i,0);i=n.readUInt32LE(0)}e[r]=i}}var s=0,a=0,c=t.length,u=~s;while(--c>=0)u=e[(u^t[a++])&255]^u>>>8;s=~u;n.writeInt32LE(s&4294967295,0);return n.readUInt32LE(0)},methodToString:function(e){switch(e){case t.STORED:return"STORED ("+e+")";case t.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},writeFileTo:function(e,t,n,o){if(r.existsSync(e)){if(!n)return false;var s=r.statSync(e);if(s.isDirectory()){return false}}var a=i.dirname(e);if(!r.existsSync(a)){mkdirSync(a)}var c;try{c=r.openSync(e,"w",438)}catch(t){r.chmodSync(e,438);c=r.openSync(e,"w",438)}if(c){try{r.writeSync(c,t,0,t.length,0)}catch(e){throw e}finally{r.closeSync(c)}}r.chmodSync(e,o||438);return true},writeFileToAsync:function(e,t,n,o,s){if(typeof o==="function"){s=o;o=undefined}r.exists(e,function(a){if(a&&!n)return s(false);r.stat(e,function(n,c){if(a&&c.isDirectory()){return s(false)}var u=i.dirname(e);r.exists(u,function(n){if(!n)mkdirSync(u);r.open(e,"w",438,function(n,i){if(n){r.chmod(e,438,function(){r.open(e,"w",438,function(n,i){r.write(i,t,0,t.length,0,function(){r.close(i,function(){r.chmod(e,o||438,function(){s(true)})})})})})}else{if(i){r.write(i,t,0,t.length,0,function(){r.close(i,function(){r.chmod(e,o||438,function(){s(true)})})})}else{r.chmod(e,o||438,function(){s(true)})}}})})})})},findFiles:function(e){return findSync(e,true)},getAttributes:function(e){},setAttributes:function(e){},toBuffer:function(e){if(Buffer.isBuffer(e)){return e}else{if(e.length===0){return Buffer.alloc(0)}return Buffer.from(e,"utf8")}},Constants:t,Errors:o}}()},29:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(287);var i=n(716);var o=n(513);var s=n(466);var a=n(366);var c=n(459);var u=n(769);var f=n(970);var l=n(733);var p=n(111);t.TelemetryClient=n(503);t.Contracts=n(367);var d;(function(e){e[e["AI"]=0]="AI";e[e["AI_AND_W3C"]=1]="AI_AND_W3C"})(d=t.DistributedTracingModes||(t.DistributedTracingModes={}));var h=true;var v=false;var y=true;var g=true;var m=true;var C=true;var E=true;var _=true;var T;var I=false;var w=true;var S;var A=undefined;var b=undefined;var N;var D;var x;var R;var P;var O;var L=false;var k;function setup(e){if(!t.defaultClient){t.defaultClient=new t.TelemetryClient(e);N=new i(t.defaultClient);D=new o(t.defaultClient);x=new s(t.defaultClient);P=new c(t.defaultClient);O=new a(t.defaultClient);if(!R){R=new p.AutoCollectNativePerformance(t.defaultClient)}}else{f.info("The default client is already setup")}if(t.defaultClient&&t.defaultClient.channel){t.defaultClient.channel.setUseDiskRetryCaching(E,A,b)}return F}t.setup=setup;function start(){if(!!t.defaultClient){L=true;N.enable(h,v);D.enable(y);x.enable(g);R.enable(w,S);P.useAutoCorrelation(_,T);P.enable(m);O.enable(C);if(t.liveMetricsClient&&I){t.liveMetricsClient.enable(I)}}else{f.warn("Start cannot be called before setup")}return F}t.start=start;function getCorrelationContext(){if(_){return r.CorrelationContextManager.getCurrentContext()}return null}t.getCorrelationContext=getCorrelationContext;function wrapWithCorrelationContext(e){return r.CorrelationContextManager.wrapCallback(e)}t.wrapWithCorrelationContext=wrapWithCorrelationContext;var F=function(){function Configuration(){}Configuration.setDistributedTracingMode=function(e){u.w3cEnabled=e===d.AI_AND_W3C;return Configuration};Configuration.setAutoCollectConsole=function(e,t){if(t===void 0){t=false}h=e;v=t;if(L){N.enable(e,t)}return Configuration};Configuration.setAutoCollectExceptions=function(e){y=e;if(L){D.enable(e)}return Configuration};Configuration.setAutoCollectPerformance=function(e,t){if(t===void 0){t=true}g=e;var n=p.AutoCollectNativePerformance.parseEnabled(t);w=n.isEnabled;S=n.disabledMetrics;if(L){x.enable(e);R.enable(n.isEnabled,n.disabledMetrics)}return Configuration};Configuration.setAutoCollectRequests=function(e){m=e;if(L){P.enable(e)}return Configuration};Configuration.setAutoCollectDependencies=function(e){C=e;if(L){O.enable(e)}return Configuration};Configuration.setAutoDependencyCorrelation=function(e,t){_=e;T=t;if(L){P.useAutoCorrelation(e,t)}return Configuration};Configuration.setUseDiskRetryCaching=function(e,n,r){E=e;A=n;b=r;if(t.defaultClient&&t.defaultClient.channel){t.defaultClient.channel.setUseDiskRetryCaching(e,n,r)}return Configuration};Configuration.setInternalLogging=function(e,t){if(e===void 0){e=false}if(t===void 0){t=true}f.enableDebug=e;f.disableWarnings=!t;return Configuration};Configuration.setSendLiveMetrics=function(e){if(e===void 0){e=false}if(!t.defaultClient){f.warn("Live metrics client cannot be setup without the default client");return Configuration}if(!t.liveMetricsClient){t.liveMetricsClient=new l(t.defaultClient.config.instrumentationKey);k=new s(t.liveMetricsClient,1e3,true);t.liveMetricsClient.addCollector(k);t.defaultClient.quickPulseClient=t.liveMetricsClient;I=e}else{t.liveMetricsClient.enable(e)}return Configuration};Configuration.start=start;return Configuration}();t.Configuration=F;function dispose(){t.defaultClient=null;L=false;if(N){N.dispose()}if(D){D.dispose()}if(x){x.dispose()}if(R){R.dispose()}if(P){P.dispose()}if(O){O.dispose()}}t.dispose=dispose},33:function(e){"use strict";var t;(function(e){e[e["Verbose"]=0]="Verbose";e[e["Information"]=1]="Information";e[e["Warning"]=2]="Warning";e[e["Error"]=3]="Error";e[e["Critical"]=4]="Critical"})(t||(t={}));e.exports=t},36:function(e){"use strict";e.exports=((e,t)=>{return class WrappedPromise extends e{constructor(e){var n,r;super(wrappedExecutor);var i=this;try{e.apply(n,r)}catch(e){r[1](e)}return i;function wrappedExecutor(e,o){n=this;r=[wrappedResolve,wrappedReject];function wrappedResolve(n){t(i,false);return e(n)}function wrappedReject(e){t(i,false);return o(e)}}}}})},37:function(e){"use strict";function PromiseWrap(){}e.exports=function patchPromise(){const e=this._hooks;const t=this._state;const n=global.Promise;const r=n.prototype.then;n.prototype.then=wrappedThen;function makeWrappedHandler(t,n,r,i){if("function"!==typeof t){return i?makeUnhandledResolutionHandler(r):makeUnhandledRejectionHandler(r)}return function wrappedHandler(){e.pre.call(n,r);try{return t.apply(this,arguments)}finally{e.post.call(n,r,false);e.destroy.call(null,r)}}}function makeUnhandledResolutionHandler(t){return function unhandledResolutionHandler(n){e.destroy.call(null,t);return n}}function makeUnhandledRejectionHandler(t){return function unhandledRejectedHandler(n){e.destroy.call(null,t);throw n}}function wrappedThen(n,i){if(!t.enabled)return r.call(this,n,i);const o=new PromiseWrap;const s=--t.counter;e.init.call(o,s,0,null,null);return r.call(this,makeWrappedHandler(n,o,s,true),makeWrappedHandler(i,o,s,false))}}},39:function(e,t,n){"use strict";var r=n(769);var i=n(753);var o=n(701);var s=n(835);var a=function(){function Config(e){var t=this;this.endpointBase=o.DEFAULT_BREEZE_ENDPOINT;var n=process.env[Config.ENV_connectionString];var r=i.parse(e);var a=i.parse(n);var c=!r.instrumentationkey&&Object.keys(r).length>0?null:e;this.instrumentationKey=r.instrumentationkey||c||a.instrumentationkey||Config._getInstrumentationKey();this.endpointUrl=(r.ingestionendpoint||a.ingestionendpoint||this.endpointBase)+"/v2/track";this.maxBatchSize=250;this.maxBatchIntervalMs=15e3;this.disableAppInsights=false;this.samplingPercentage=100;this.correlationIdRetryIntervalMs=30*1e3;this.correlationHeaderExcludedDomains=["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net"];this.setCorrelationId=function(e){return t.correlationId=e};this.profileQueryEndpoint=r.ingestionendpoint||a.ingestionendpoint||process.env[Config.ENV_profileQueryEndpoint]||this.endpointBase;this.proxyHttpUrl=process.env[Config.ENV_http_proxy]||undefined;this.proxyHttpsUrl=process.env[Config.ENV_https_proxy]||undefined;this.httpAgent=undefined;this.httpsAgent=undefined;this._quickPulseHost=r.liveendpoint||a.liveendpoint||process.env[Config.ENV_quickPulseHost]||o.DEFAULT_LIVEMETRICS_HOST;if(this._quickPulseHost.match(/^https?:\/\//)){this._quickPulseHost=s.parse(this._quickPulseHost).host}}Object.defineProperty(Config.prototype,"profileQueryEndpoint",{get:function(){return this._profileQueryEndpoint},set:function(e){r.cancelCorrelationIdQuery(this,this.setCorrelationId);this._profileQueryEndpoint=e;this.correlationId=r.correlationIdPrefix;r.queryCorrelationId(this,this.setCorrelationId)},enumerable:true,configurable:true});Object.defineProperty(Config.prototype,"quickPulseHost",{get:function(){return this._quickPulseHost},set:function(e){this._quickPulseHost=e},enumerable:true,configurable:true});Config._getInstrumentationKey=function(){var e=process.env[Config.ENV_iKey]||process.env[Config.ENV_azurePrefix+Config.ENV_iKey]||process.env[Config.legacy_ENV_iKey]||process.env[Config.ENV_azurePrefix+Config.legacy_ENV_iKey];if(!e||e==""){throw new Error("Instrumentation key not found, pass the key in the config to this method or set the key in the environment variable APPINSIGHTS_INSTRUMENTATIONKEY before starting the server")}return e};Config.ENV_azurePrefix="APPSETTING_";Config.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY";Config.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY";Config.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT";Config.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST";Config.ENV_connectionString="APPLICATIONINSIGHTS_CONNECTION_STRING";Config.ENV_nativeMetricsDisablers="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC";Config.ENV_nativeMetricsDisableAll="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS";Config.ENV_http_proxy="http_proxy";Config.ENV_https_proxy="https_proxy";return Config}();e.exports=a},54:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(953);"use strict";var o=function(e){r(PageViewData,e);function PageViewData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return PageViewData}(i);e.exports=o},82:function(e){e.exports=require("console")},87:function(e){e.exports=require("os")},105:function(e,t){t=e.exports=SemVer;var n;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){n=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{n=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var r=256;var i=Number.MAX_SAFE_INTEGER||9007199254740991;var o=16;var s=t.re=[];var a=t.src=[];var c=0;var u=c++;a[u]="0|[1-9]\\d*";var f=c++;a[f]="[0-9]+";var l=c++;a[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=c++;a[p]="("+a[u]+")\\."+"("+a[u]+")\\."+"("+a[u]+")";var d=c++;a[d]="("+a[f]+")\\."+"("+a[f]+")\\."+"("+a[f]+")";var h=c++;a[h]="(?:"+a[u]+"|"+a[l]+")";var v=c++;a[v]="(?:"+a[f]+"|"+a[l]+")";var y=c++;a[y]="(?:-("+a[h]+"(?:\\."+a[h]+")*))";var g=c++;a[g]="(?:-?("+a[v]+"(?:\\."+a[v]+")*))";var m=c++;a[m]="[0-9A-Za-z-]+";var C=c++;a[C]="(?:\\+("+a[m]+"(?:\\."+a[m]+")*))";var E=c++;var _="v?"+a[p]+a[y]+"?"+a[C]+"?";a[E]="^"+_+"$";var T="[v=\\s]*"+a[d]+a[g]+"?"+a[C]+"?";var I=c++;a[I]="^"+T+"$";var w=c++;a[w]="((?:<|>)?=?)";var S=c++;a[S]=a[f]+"|x|X|\\*";var A=c++;a[A]=a[u]+"|x|X|\\*";var b=c++;a[b]="[v=\\s]*("+a[A]+")"+"(?:\\.("+a[A]+")"+"(?:\\.("+a[A]+")"+"(?:"+a[y]+")?"+a[C]+"?"+")?)?";var N=c++;a[N]="[v=\\s]*("+a[S]+")"+"(?:\\.("+a[S]+")"+"(?:\\.("+a[S]+")"+"(?:"+a[g]+")?"+a[C]+"?"+")?)?";var D=c++;a[D]="^"+a[w]+"\\s*"+a[b]+"$";var x=c++;a[x]="^"+a[w]+"\\s*"+a[N]+"$";var R=c++;a[R]="(?:^|[^\\d])"+"(\\d{1,"+o+"})"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:$|[^\\d])";var P=c++;a[P]="(?:~>?)";var O=c++;a[O]="(\\s*)"+a[P]+"\\s+";s[O]=new RegExp(a[O],"g");var L="$1~";var k=c++;a[k]="^"+a[P]+a[b]+"$";var F=c++;a[F]="^"+a[P]+a[N]+"$";var q=c++;a[q]="(?:\\^)";var H=c++;a[H]="(\\s*)"+a[q]+"\\s+";s[H]=new RegExp(a[H],"g");var j="$1^";var M=c++;a[M]="^"+a[q]+a[b]+"$";var U=c++;a[U]="^"+a[q]+a[N]+"$";var V=c++;a[V]="^"+a[w]+"\\s*("+T+")$|^$";var B=c++;a[B]="^"+a[w]+"\\s*("+_+")$|^$";var $=c++;a[$]="(\\s*)"+a[w]+"\\s*("+T+"|"+a[b]+")";s[$]=new RegExp(a[$],"g");var Q="$1$2$3";var G=c++;a[G]="^\\s*("+a[b]+")"+"\\s+-\\s+"+"("+a[b]+")"+"\\s*$";var W=c++;a[W]="^\\s*("+a[N]+")"+"\\s+-\\s+"+"("+a[N]+")"+"\\s*$";var X=c++;a[X]="(<|>)?=?\\s*\\*";for(var z=0;zr){return null}var n=t.loose?s[I]:s[E];if(!n.test(e)){return null}try{return new SemVer(e,t)}catch(e){return null}}t.valid=valid;function valid(e,t){var n=parse(e,t);return n?n.version:null}t.clean=clean;function clean(e,t){var n=parse(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}t.SemVer=SemVer;function SemVer(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof SemVer){if(e.loose===t.loose){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r){throw new TypeError("version is longer than "+r+" characters")}if(!(this instanceof SemVer)){return new SemVer(e,t)}n("SemVer",e,t);this.options=t;this.loose=!!t.loose;var o=e.trim().match(t.loose?s[I]:s[E]);if(!o){throw new TypeError("Invalid Version: "+e)}this.raw=e;this.major=+o[1];this.minor=+o[2];this.patch=+o[3];if(this.major>i||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>i||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>i||this.patch<0){throw new TypeError("Invalid patch version")}if(!o[4]){this.prerelease=[]}else{this.prerelease=o[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0){if(typeof this.prerelease[n]==="number"){this.prerelease[n]++;n=-2}}if(n===-1){this.prerelease.push(0)}}if(t){if(this.prerelease[0]===t){if(isNaN(this.prerelease[1])){this.prerelease=[t,0]}}else{this.prerelease=[t,0]}}break;default:throw new Error("invalid increment argument: "+e)}this.format();this.raw=this.version;return this};t.inc=inc;function inc(e,t,n,r){if(typeof n==="string"){r=n;n=undefined}try{return new SemVer(e,n).inc(t,r).version}catch(e){return null}}t.diff=diff;function diff(e,t){if(eq(e,t)){return null}else{var n=parse(e);var r=parse(t);var i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var s in n){if(s==="major"||s==="minor"||s==="patch"){if(n[s]!==r[s]){return i+s}}}return o}}t.compareIdentifiers=compareIdentifiers;var Y=/^[0-9]+$/;function compareIdentifiers(e,t){var n=Y.test(e);var r=Y.test(t);if(n&&r){e=+e;t=+t}return e===t?0:n&&!r?-1:r&&!n?1:e0}t.lt=lt;function lt(e,t,n){return compare(e,t,n)<0}t.eq=eq;function eq(e,t,n){return compare(e,t,n)===0}t.neq=neq;function neq(e,t,n){return compare(e,t,n)!==0}t.gte=gte;function gte(e,t,n){return compare(e,t,n)>=0}t.lte=lte;function lte(e,t,n){return compare(e,t,n)<=0}t.cmp=cmp;function cmp(e,t,n,r){switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return eq(e,n,r);case"!=":return neq(e,n,r);case">":return gt(e,n,r);case">=":return gte(e,n,r);case"<":return lt(e,n,r);case"<=":return lte(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}t.Comparator=Comparator;function Comparator(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}if(!(this instanceof Comparator)){return new Comparator(e,t)}n("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===K){this.value=""}else{this.value=this.operator+this.semver.version}n("comp",this)}var K={};Comparator.prototype.parse=function(e){var t=this.options.loose?s[V]:s[B];var n=e.match(t);if(!n){throw new TypeError("Invalid comparator: "+e)}this.operator=n[1];if(this.operator==="="){this.operator=""}if(!n[2]){this.semver=K}else{this.semver=new SemVer(n[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(e){n("Comparator.test",e,this.options.loose);if(this.semver===K){return true}if(typeof e==="string"){e=new SemVer(e,this.options)}return cmp(e,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}var n;if(this.operator===""){n=new Range(e.value,t);return satisfies(this.value,n,t)}else if(e.operator===""){n=new Range(this.value,t);return satisfies(e.semver,n,t)}var r=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");var i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");var o=this.semver.version===e.semver.version;var s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<=");var a=cmp(this.semver,"<",e.semver,t)&&((this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"));var c=cmp(this.semver,">",e.semver,t)&&((this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">"));return r||i||o&&s||a||c};t.Range=Range;function Range(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Range){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new Range(e.raw,t)}}if(e instanceof Comparator){return new Range(e.value,t)}if(!(this instanceof Range)){return new Range(e,t)}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}Range.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?s[W]:s[G];e=e.replace(r,hyphenReplace);n("hyphen replace",e);e=e.replace(s[$],Q);n("comparator trim",e,s[$]);e=e.replace(s[O],L);e=e.replace(s[H],j);e=e.split(/\s+/).join(" ");var i=t?s[V]:s[B];var o=e.split(" ").map(function(e){return parseComparator(e,this.options)},this).join(" ").split(/\s+/);if(this.options.loose){o=o.filter(function(e){return!!e.match(i)})}o=o.map(function(e){return new Comparator(e,this.options)},this);return o};Range.prototype.intersects=function(e,t){if(!(e instanceof Range)){throw new TypeError("a Range is required")}return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})};t.toComparators=toComparators;function toComparators(e,t){return new Range(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function parseComparator(e,t){n("comp",e,t);e=replaceCarets(e,t);n("caret",e);e=replaceTildes(e,t);n("tildes",e);e=replaceXRanges(e,t);n("xrange",e);e=replaceStars(e,t);n("stars",e);return e}function isX(e){return!e||e.toLowerCase()==="x"||e==="*"}function replaceTildes(e,t){return e.trim().split(/\s+/).map(function(e){return replaceTilde(e,t)}).join(" ")}function replaceTilde(e,t){var r=t.loose?s[F]:s[k];return e.replace(r,function(t,r,i,o,s){n("tilde",e,t,r,i,o,s);var a;if(isX(r)){a=""}else if(isX(i)){a=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else if(s){n("replaceTilde pr",s);a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+(+i+1)+".0"}else{a=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}n("tilde return",a);return a})}function replaceCarets(e,t){return e.trim().split(/\s+/).map(function(e){return replaceCaret(e,t)}).join(" ")}function replaceCaret(e,t){n("caret",e,t);var r=t.loose?s[U]:s[M];return e.replace(r,function(t,r,i,o,s){n("caret",e,t,r,i,o,s);var a;if(isX(r)){a=""}else if(isX(i)){a=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){if(r==="0"){a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else{a=">="+r+"."+i+".0 <"+(+r+1)+".0.0"}}else if(s){n("replaceCaret pr",s);if(r==="0"){if(i==="0"){a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+i+"."+(+o+1)}else{a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+(+i+1)+".0"}}else{a=">="+r+"."+i+"."+o+"-"+s+" <"+(+r+1)+".0.0"}}else{n("no pr");if(r==="0"){if(i==="0"){a=">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1)}else{a=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}}else{a=">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"}}n("caret return",a);return a})}function replaceXRanges(e,t){n("replaceXRanges",e,t);return e.split(/\s+/).map(function(e){return replaceXRange(e,t)}).join(" ")}function replaceXRange(e,t){e=e.trim();var r=t.loose?s[x]:s[D];return e.replace(r,function(t,r,i,o,s,a){n("xRange",e,t,r,i,o,s,a);var c=isX(i);var u=c||isX(o);var f=u||isX(s);var l=f;if(r==="="&&l){r=""}if(c){if(r===">"||r==="<"){t="<0.0.0"}else{t="*"}}else if(r&&l){if(u){o=0}s=0;if(r===">"){r=">=";if(u){i=+i+1;o=0;s=0}else{o=+o+1;s=0}}else if(r==="<="){r="<";if(u){i=+i+1}else{o=+o+1}}t=r+i+"."+o+"."+s}else if(u){t=">="+i+".0.0 <"+(+i+1)+".0.0"}else if(f){t=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"}n("xRange return",t);return t})}function replaceStars(e,t){n("replaceStars",e,t);return e.trim().replace(s[X],"")}function hyphenReplace(e,t,n,r,i,o,s,a,c,u,f,l,p){if(isX(n)){t=""}else if(isX(r)){t=">="+n+".0.0"}else if(isX(i)){t=">="+n+"."+r+".0"}else{t=">="+t}if(isX(c)){a=""}else if(isX(u)){a="<"+(+c+1)+".0.0"}else if(isX(f)){a="<"+c+"."+(+u+1)+".0"}else if(l){a="<="+c+"."+u+"."+f+"-"+l}else{a="<="+a}return(t+" "+a).trim()}Range.prototype.test=function(e){if(!e){return false}if(typeof e==="string"){e=new SemVer(e,this.options)}for(var t=0;t0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch){return true}}}return false}return true}t.satisfies=satisfies;function satisfies(e,t,n){try{t=new Range(t,n)}catch(e){return false}return t.test(e)}t.maxSatisfying=maxSatisfying;function maxSatisfying(e,t,n){var r=null;var i=null;try{var o=new Range(t,n)}catch(e){return null}e.forEach(function(e){if(o.test(e)){if(!r||i.compare(e)===-1){r=e;i=new SemVer(r,n)}}});return r}t.minSatisfying=minSatisfying;function minSatisfying(e,t,n){var r=null;var i=null;try{var o=new Range(t,n)}catch(e){return null}e.forEach(function(e){if(o.test(e)){if(!r||i.compare(e)===1){r=e;i=new SemVer(r,n)}}});return r}t.minVersion=minVersion;function minVersion(e,t){e=new Range(e,t);var n=new SemVer("0.0.0");if(e.test(n)){return n}n=new SemVer("0.0.0-0");if(e.test(n)){return n}n=null;for(var r=0;r":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!n||gt(n,t)){n=t}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}if(n&&e.test(n)){return n}return null}t.validRange=validRange;function validRange(e,t){try{return new Range(e,t).range||"*"}catch(e){return null}}t.ltr=ltr;function ltr(e,t,n){return outside(e,t,"<",n)}t.gtr=gtr;function gtr(e,t,n){return outside(e,t,">",n)}t.outside=outside;function outside(e,t,n,r){e=new SemVer(e,r);t=new Range(t,r);var i,o,s,a,c;switch(n){case">":i=gt;o=lte;s=lt;a=">";c=">=";break;case"<":i=lt;o=gte;s=gt;a="<";c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(e,t,r)){return false}for(var u=0;u=0.0.0")}l=l||e;p=p||e;if(i(e.semver,l.semver,r)){l=e}else if(s(e.semver,p.semver,r)){p=e}});if(l.operator===a||l.operator===c){return false}if((!p.operator||p.operator===a)&&o(e,p.semver)){return false}else if(p.operator===c&&s(e,p.semver)){return false}}return true}t.prerelease=prerelease;function prerelease(e,t){var n=parse(e,t);return n&&n.prerelease.length?n.prerelease:null}t.intersects=intersects;function intersects(e,t,n){e=new Range(e,n);t=new Range(t,n);return e.intersects(t)}t.coerce=coerce;function coerce(e){if(e instanceof SemVer){return e}if(typeof e!=="string"){return null}var t=e.match(s[R]);if(t==null){return null}return parse(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},111:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n=6};AutoCollectNativePerformance.prototype.enable=function(e,t,r){var i=this;if(t===void 0){t={}}if(r===void 0){r=6e4}if(!AutoCollectNativePerformance.isNodeVersionCompatible()){return}if(AutoCollectNativePerformance._metricsAvailable==undefined&&e&&!this._isInitialized){try{var o=n(660);AutoCollectNativePerformance._emitter=new o;AutoCollectNativePerformance._metricsAvailable=true;s.info("Native metrics module successfully loaded!")}catch(e){AutoCollectNativePerformance._metricsAvailable=false;return}}this._isEnabled=e;this._disabledMetrics=t;if(this._isEnabled&&!this._isInitialized){this._isInitialized=true}if(this._isEnabled&&AutoCollectNativePerformance._emitter){AutoCollectNativePerformance._emitter.enable(true,r);this._handle=setInterval(function(){return i._trackNativeMetrics()},r);this._handle.unref()}else if(AutoCollectNativePerformance._emitter){AutoCollectNativePerformance._emitter.enable(false);if(this._handle){clearInterval(this._handle);this._handle=undefined}}};AutoCollectNativePerformance.prototype.dispose=function(){this.enable(false)};AutoCollectNativePerformance.parseEnabled=function(e){var t=process.env[i.ENV_nativeMetricsDisableAll];var n=process.env[i.ENV_nativeMetricsDisablers];if(t){return{isEnabled:false,disabledMetrics:{}}}if(n){var o=n.split(",");var s={};if(o.length>0){for(var a=0,c=o;a>t&255)};var n=function(e){return t(e,24)+t(e,16)+t(e,8)+t(e,0)};var r=e.map(n).join("");var i=Buffer.from?Buffer.from(r,"binary"):new Buffer(r,"binary");var o=i.toString("base64");return o.substr(0,o.indexOf("="))};Util.random32=function(){return 4294967296*Math.random()|0};Util.randomu32=function(){return Util.random32()+2147483648};Util.w3cTraceId=function(){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];var t="",n;for(var r=0;r<4;r++){n=Util.random32();t+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15]}var i=e[8+Math.random()*4|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)};Util.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"};Util.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"};Util.isError=function(e){return e instanceof Error};Util.isPrimitive=function(e){var t=typeof e;return t==="string"||t==="number"||t==="boolean"};Util.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"};Util.msToTimeSpan=function(e){if(isNaN(e)||e<0){e=0}var t=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,"");var n=""+Math.floor(e/(1e3*60))%60;var r=""+Math.floor(e/(1e3*60*60))%24;var i=Math.floor(e/(1e3*60*60*24));t=t.indexOf(".")<2?"0"+t:t;n=n.length<2?"0"+n:n;r=r.length<2?"0"+r:r;var o=i>0?i+".":"";return o+r+":"+n+":"+t};Util.extractError=function(e){var t=e;return{message:e.message,code:t.code||t.id||""}};Util.extractObject=function(e){if(e instanceof Error){return Util.extractError(e)}if(typeof e.toJSON==="function"){return e.toJSON()}return e};Util.validateStringMap=function(e){if(typeof e!=="object"){c.info("Invalid properties dropped from payload");return}var t={};for(var n in e){var r="";var i=e[n];var o=typeof i;if(Util.isPrimitive(i)){r=i.toString()}else if(i===null||o==="undefined"){r=""}else if(o==="function"){c.info("key: "+n+" was function; will not serialize");continue}else{var s=Util.isArray(i)?i:Util.extractObject(i);try{if(Util.isPrimitive(s)){r=s}else{r=JSON.stringify(s)}}catch(e){r=i.constructor.name.toString()+" (Error: "+e.message+")";c.info("key: "+n+", could not be serialized")}}t[n]=r.substring(0,Util.MAX_PROPERTY_LENGTH)}return t};Util.canIncludeCorrelationHeader=function(e,t){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!t){return true}for(var r=0;r=0){f=f.substring(0,l)}var p=c;for(var d=0,h=e[n];d{this.parseLine(e)})})}getFiles(e){return this.mFilesExtensionMap.get(e)}parseLine(e){if(!e.startsWith("Name: ")){return}const t=a.join(this.mBasePath,e.split("Name: ",2)[1]);const n=a.extname(t);if(!this.mFilesExtensionMap.has(n)){this.mFilesExtensionMap.set(n,[])}const r=this.mFilesExtensionMap.get(n);if(!c.isUndefined(r)){r.push(t)}}}t.default=MetaMfParser},232:function(e,t,n){"use strict";const r=n(105);if(process&&r.gte(process.versions.node,"8.0.0")){e.exports=n(724)}else{e.exports=n(246)}},243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(222);var i=n(222);t.makePatchingRequire=i.makePatchingRequire;var o=function(e){return true};var s=function(){function ContextPreservingEventEmitter(){this.version=n(325).version;this.subscribers={};this.contextPreservationFunction=function(e){return e};this.knownPatches={};this.currentlyPublishing=false}ContextPreservingEventEmitter.prototype.shouldPublish=function(e){var t=this.subscribers[e];if(t){return t.some(function(e){var t=e.filter;return!t||t(false)})}return false};ContextPreservingEventEmitter.prototype.publish=function(e,t){if(this.currentlyPublishing){return}var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=true;n.forEach(function(e){var t=e.listener,n=e.filter;try{if(n&&n(true)){t(r)}}catch(e){}});this.currentlyPublishing=false}};ContextPreservingEventEmitter.prototype.subscribe=function(e,t,n){if(n===void 0){n=o}if(!this.subscribers[e]){this.subscribers[e]=[]}this.subscribers[e].push({listener:t,filter:n})};ContextPreservingEventEmitter.prototype.unsubscribe=function(e,t,n){if(n===void 0){n=o}var r=this.subscribers[e];if(r){for(var i=0;i{if(f){debug2(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);return e}).catch(e=>{e[c]=t;if(f){debug2(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);throw e})};Namespace.prototype.bind=function bindFactory(e,t){if(!t){if(!this.active){t=this.createContext()}else{t=this.active}}let n=this;return function clsBind(){n.enter(t);try{return e.apply(this,arguments)}catch(e){if(e){e[c]=t}throw e}finally{n.exit(t)}}};Namespace.prototype.enter=function enter(e){i.ok(e,"context must be provided for entering");if(f){debug2(" ENTER "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e))}this._set.push(this.active);this.active=e};Namespace.prototype.exit=function exit(e){i.ok(e,"context must be provided for exiting");if(f){debug2(" EXIT "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e))}if(this.active===e){i.ok(this._set.length,"can't remove top context");this.active=this._set.pop();return}let t=this._set.lastIndexOf(e);if(t<0){if(f){debug2("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e))}i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))}else{i.ok(t,"can't remove top context");this._set.splice(t,1)}};Namespace.prototype.bindEmitter=function bindEmitter(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this;let n="context@"+this.name;function attach(e){if(!e){return}if(!e[a]){e[a]=Object.create(null)}e[a][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[a])){return e}let t=e;let n=e[a];Object.keys(n).forEach(function(e){let r=n[e];t=r.namespace.bind(t,r.context)});return t}o(e,attach,bind)};Namespace.prototype.fromException=function fromException(e){return e[c]};function getNamespace(e){return process.namespaces[e]}function createNamespace(e){i.ok(e,"namespace must be given a name.");if(f){debug2("CREATING NAMESPACE "+e)}let t=new Namespace(e);t.id=l;s.addHooks({init(n,i,o,s,a){l=n;if(s){t._contexts.set(n,t._contexts.get(s));if(f){debug2("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+o)}}else{t._contexts.set(l,t.active)}if(f){debug2("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+u[o]+" active:"+r.inspect(t.active,true))}},pre(n,i){l=n;let o=t._contexts.get(n);if(o){if(f){debug2(" PRE "+e+" uid:"+n+" handle:"+getFunctionName(i)+" context:"+r.inspect(o))}t.enter(o)}else{if(f){debug2(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+getFunctionName(i))}}},post(n,i){l=n;let o=t._contexts.get(n);if(o){if(f){debug2(" POST "+e+" uid:"+n+" handle:"+getFunctionName(i)+" context:"+r.inspect(o))}t.exit(o)}else{if(f){debug2(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+getFunctionName(i))}}},destroy(n){l=n;if(f){debug2("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(l))+" active:"+r.inspect(t.active,true))}t._contexts.delete(n)}});process.namespaces[e]=t;return t}function destroyNamespace(e){let t=getNamespace(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"');i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t));process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroyNamespace(e)})}process.namespaces=Object.create(null)}process.namespaces={};if(s._state&&!s._state.enabled){s.enable()}function debug2(e){if(process.env.DEBUG){process._rawDebug(e)}}function getFunctionName(e){if(!e){return e}if(typeof e==="function"){if(e.name){return e.name}return(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]}else if(e.constructor&&e.constructor.name){return e.constructor.name}}if(f){var p=n(322);for(var d in p.filter._modifiers){p.filter.deattach(d)}}},271:function(e,t,n){"use strict";const r=n(620);if(global._asyncHook){if(global._asyncHook.version===n(664).version){e.exports=global._asyncHook}else{throw new Error("Conflicting version of async-hook-jl found")}}else{const t=n(322);t.filter.attach(function(e,t){return t.filter(function(e){const t=e.getFileName();return!(t&&t.slice(0,__dirname.length)===__dirname)})});e.exports=global._asyncHook=new r}},277:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(367);function samplingTelemetryProcessor(e,t){var n=e.sampleRate;var i=false;if(n===null||n===undefined||n>=100){return true}else if(e.data&&r.TelemetryType.Metric===r.baseTypeToTelemetryType(e.data.baseType)){return true}else if(t.correlationContext&&t.correlationContext.operation){i=getSamplingHashCode(t.correlationContext.operation.id)3||parseInt(e[0])>2&&parseInt(e[1])>2};CorrelationContextManager.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2};CorrelationContextManager.canUseClsHooked=function(){var e=process.versions.node.split(".");var t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0;var n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2;var r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r};CorrelationContextManager.enabled=false;CorrelationContextManager.hasEverEnabled=false;CorrelationContextManager.forceClsHooked=undefined;CorrelationContextManager.CONTEXT_NAME="ApplicationInsights-Context";return CorrelationContextManager}();t.CorrelationContextManager=o;var s=function(){function CustomPropertiesImpl(e){this.props=[];this.addHeaderData(e)}CustomPropertiesImpl.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map(function(e){var t=e.split("=");return{key:t[0],value:t[1]}}).concat(this.props)};CustomPropertiesImpl.prototype.serializeToHeader=function(){return this.props.map(function(e){return e.key+"="+e.value}).join(", ")};CustomPropertiesImpl.prototype.getProperty=function(e){for(var t=0;t=0,"context not currently entered; can't exit");r.ok(t,"can't remove top context");this._set.splice(t,1)};Namespace.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this;var n="context@"+this.name;function attach(e){if(!e)return;if(!e[o])e[o]=Object.create(null);e[o][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[o]))return e;var t=e;var n=e[o];Object.keys(n).forEach(function(e){var r=n[e];t=r.namespace.bind(t,r.context)});return t}i(e,attach,bind)};Namespace.prototype.fromException=function(e){return e[s]};function get(e){return process.namespaces[e]}function create(e){r.ok(e,"namespace must be given a name!");var t=new Namespace(e);t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){if(n)t.enter(n)},after:function(e,n){if(n)t.exit(n)},error:function(e){if(e)t.exit(e)}});process.namespaces[e]=t;return t}function destroy(e){var t=get(e);r.ok(t,"can't delete nonexistent namespace!");r.ok(t.id,"don't assign to process.namespaces directly!");process.removeAsyncListener(t.id);process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroy(e)})}process.namespaces=Object.create(null)}if(!process.namespaces)reset();e.exports={getNamespace:get,createNamespace:create,destroyNamespace:destroy,reset:reset}},513:function(e){"use strict";var t=function(){function AutoCollectExceptions(e){if(!!AutoCollectExceptions.INSTANCE){throw new Error("Exception tracking should be configured from the applicationInsights object")}AutoCollectExceptions.INSTANCE=this;this._client=e}Object.defineProperty(AutoCollectExceptions,"UNCAUGHT_EXCEPTION_HANDLER_NAME",{get:function(){return"uncaughtException"},enumerable:true,configurable:true});Object.defineProperty(AutoCollectExceptions,"UNHANDLED_REJECTION_HANDLER_NAME",{get:function(){return"unhandledRejection"},enumerable:true,configurable:true});AutoCollectExceptions.prototype.isInitialized=function(){return this._isInitialized};AutoCollectExceptions.prototype.enable=function(e){var t=this;if(e){this._isInitialized=true;var n=this;if(!this._exceptionListenerHandle){var r=function(e,n){if(n===void 0){n=new Error(AutoCollectExceptions._FALLBACK_ERROR_MESSAGE)}t._client.trackException({exception:n});t._client.flush({isAppCrashing:true});if(e){var r=n;throw r}};this._exceptionListenerHandle=r.bind(this,true);this._rejectionListenerHandle=r.bind(this,false);process.on(AutoCollectExceptions.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle);process.on(AutoCollectExceptions.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle)}}else{if(this._exceptionListenerHandle){process.removeListener(AutoCollectExceptions.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle);process.removeListener(AutoCollectExceptions.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle);this._exceptionListenerHandle=undefined;this._rejectionListenerHandle=undefined;delete this._exceptionListenerHandle;delete this._rejectionListenerHandle}}};AutoCollectExceptions.prototype.dispose=function(){AutoCollectExceptions.INSTANCE=null;this.enable(false);this._isInitialized=false};AutoCollectExceptions.INSTANCE=null;AutoCollectExceptions._FALLBACK_ERROR_MESSAGE="A promise was rejected without providing an error. Application Insights generated this error stack for you.";return AutoCollectExceptions}();e.exports=t},514:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);function postgresPool1PatchFunction(e){var t=e.prototype.connect;e.prototype.connect=function connect(e){if(e){arguments[0]=r.channel.bindToContext(e)}return t.apply(this,arguments)};return e}t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:postgresPool1PatchFunction};function enable(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}t.enable=enable},519:function(e,t,n){t.require=function(){var e=n(747);if(process.versions["electron"]){try{originalFs=n(533);if(Object.keys(originalFs).length>0){e=originalFs}}catch(e){}}return e}},522:function(e,t,n){"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(858),i=n(105),o=r.wrap,s=r.massWrap,a=n(934),c=n(669);var u=i.gte(process.version,"6.0.0");var f=i.gte(process.version,"7.0.0");var l=i.gte(process.version,"8.0.0");var p=i.gte(process.version,"11.0.0");var d=n(631);if(f&&!d._normalizeArgs){d._normalizeArgs=function(e){if(e.length===0){return[{},null]}var t=e[0];var n={};if(typeof t==="object"&&t!==null){n=t}else if(isPipeName(t)){n.path=t}else{n.port=t;if(e.length>1&&typeof e[1]==="string"){n.host=e[1]}}var r=e[e.length-1];if(typeof r!=="function")return[n,null];else return[n,r]}}else if(!f&&!d._normalizeConnectArgs){d._normalizeConnectArgs=function(e){var t={};function toNumber(e){return(e=Number(e))>=0?e:false}if(typeof e[0]==="object"&&e[0]!==null){t=e[0]}else if(typeof e[0]==="string"&&toNumber(e[0])===false){t.path=e[0]}else{t.port=e[0];if(typeof e[1]==="string"){t.host=e[1]}}var n=e[e.length-1];return typeof n==="function"?[t,n]:[t]}}if("_setUpListenHandle"in d.Server.prototype){o(d.Server.prototype,"_setUpListenHandle",wrapSetUpListenHandle)}else{o(d.Server.prototype,"_listen2",wrapSetUpListenHandle)}function wrapSetUpListenHandle(e){return function(){this.on("connection",function(e){if(e._handle){e._handle.onread=a(e._handle.onread)}});try{return e.apply(this,arguments)}finally{if(this._handle&&this._handle.onconnection){this._handle.onconnection=a(this._handle.onconnection)}}}}function patchOnRead(e){if(e&&e._handle){var t=e._handle;if(!t._originalOnread){t._originalOnread=t.onread}t.onread=a(t._originalOnread)}}o(d.Socket.prototype,"connect",function(e){return function(){var t;if(l&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0){t=arguments[0]}else{t=f?d._normalizeArgs(arguments):d._normalizeConnectArgs(arguments)}if(t[1])t[1]=a(t[1]);var n=e.apply(this,t);patchOnRead(this);return n}});var h=n(605);o(h.Agent.prototype,"addRequest",function(e){return function(t){var n=t.onSocket;t.onSocket=a(function(e){patchOnRead(e);return n.apply(this,arguments)});return e.apply(this,arguments)}});var v=n(129);function wrapChildProcess(e){if(Array.isArray(e.stdio)){e.stdio.forEach(function(e){if(e&&e._handle){e._handle.onread=a(e._handle.onread);o(e._handle,"close",activatorFirst)}})}if(e._handle){e._handle.onexit=a(e._handle.onexit)}}if(v.ChildProcess){o(v.ChildProcess.prototype,"spawn",function(e){return function(){var t=e.apply(this,arguments);wrapChildProcess(this);return t}})}else{s(v,["execFile","fork","spawn"],function(e){return function(){var t=e.apply(this,arguments);wrapChildProcess(t);return t}})}if(!process._fatalException){process._originalNextTick=process.nextTick}var y=[];if(process._nextDomainTick)y.push("_nextDomainTick");if(process._tickDomainCallback)y.push("_tickDomainCallback");s(process,y,activator);o(process,"nextTick",activatorFirst);var g=["setTimeout","setInterval"];if(global.setImmediate)g.push("setImmediate");var m=n(213);var C=global.setTimeout===m.setTimeout;s(m,g,activatorFirst);if(C){s(global,g,activatorFirst)}var E=n(819);s(E,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],activator);if(E.resolveNaptr)o(E,"resolveNaptr",activator);var _=n(747);s(_,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],activator);if(_.lchown)o(_,"lchown",activator);if(_.lchmod)o(_,"lchmod",activator);if(_.ftruncate)o(_,"ftruncate",activator);var T;try{T=n(761)}catch(e){}if(T&&T.Deflate&&T.Deflate.prototype){var I=Object.getPrototypeOf(T.Deflate.prototype);if(I._transform){o(I,"_transform",activator)}else if(I.write&&I.flush&&I.end){s(I,["write","flush","end"],activator)}}var w;try{w=n(417)}catch(e){}if(w){var S=["pbkdf2","randomBytes"];if(!p){S.push("pseudoRandomBytes")}s(w,S,activator)}var A=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";if(A){var b=process.addAsyncListener({create:function create(){A=false}});global.Promise.resolve(true).then(function notSync(){A=false});process.removeAsyncListener(b)}if(A){wrapPromise()}function wrapPromise(){var e=global.Promise;function wrappedPromise(t){if(!(this instanceof wrappedPromise)){return e(t)}if(typeof t!=="function"){return new e(t)}var n,r;var i=new e(wrappedExecutor);i.__proto__=wrappedPromise.prototype;try{t.apply(n,r)}catch(e){r[1](e)}return i;function wrappedExecutor(e,t){n=this;r=[wrappedResolve,wrappedReject];function wrappedResolve(t){ensureAslWrapper(i,false);return e(t)}function wrappedReject(e){ensureAslWrapper(i,false);return t(e)}}}c.inherits(wrappedPromise,e);o(e.prototype,"then",wrapThen);if(e.prototype.chain){o(e.prototype,"chain",wrapThen)}if(u){global.Promise=n(36)(e,ensureAslWrapper)}else{var t=["all","race","reject","resolve","accept","defer"];t.forEach(function(t){if(typeof e[t]==="function"){wrappedPromise[t]=e[t]}});global.Promise=wrappedPromise}function ensureAslWrapper(e,t){if(!e.__asl_wrapper||t){e.__asl_wrapper=a(propagateAslWrapper)}}function propagateAslWrapper(t,n,r,i){var o;try{o=n.call(t,r);return{returnVal:o,error:false}}catch(e){return{errorVal:e,error:true}}finally{if(o instanceof e){i.__asl_wrapper=function proxyWrapper(){var e=o.__asl_wrapper||propagateAslWrapper;return e.apply(this,arguments)}}else{ensureAslWrapper(i,true)}}}function wrapThen(e){return function wrappedThen(){var t=this;var n=e.apply(t,Array.prototype.map.call(arguments,bind));n.__asl_wrapper=function proxyWrapper(e,r,i,o){if(t.__asl_wrapper){t.__asl_wrapper(e,function(){},null,n);return n.__asl_wrapper(e,r,i,o)}return propagateAslWrapper(e,r,i,o)};return n;function bind(e){if(typeof e!=="function")return e;return a(function(r){var i=(t.__asl_wrapper||propagateAslWrapper)(this,e,r,n);if(i.error){throw i.errorVal}else{return i.returnVal}})}}}}function activator(e){var t=function(){var t;var n=arguments.length-1;if(typeof arguments[n]==="function"){t=Array(arguments.length);for(var r=0;r=0?e:false}function isPipeName(e){return typeof e==="string"&&toNumber(e)===false}},528:function(e,t,n){"use strict";var r=n(970);var i=function(){function Channel(e,t,n,r){this._buffer=[];this._lastSend=0;this._isDisabled=e;this._getBatchSize=t;this._getBatchIntervalMs=n;this._sender=r}Channel.prototype.setUseDiskRetryCaching=function(e,t,n){this._sender.setDiskRetryMode(e,t,n)};Channel.prototype.send=function(e){var t=this;if(this._isDisabled()){return}if(!e){r.warn("Cannot send null/undefined telemetry");return}var n=this._stringify(e);if(typeof n!=="string"){return}this._buffer.push(n);if(this._buffer.length>=this._getBatchSize()){this.triggerSend(false);return}if(!this._timeoutHandle&&this._buffer.length>0){this._timeoutHandle=setTimeout(function(){t._timeoutHandle=null;t.triggerSend(false)},this._getBatchIntervalMs())}};Channel.prototype.triggerSend=function(e,t){var n=this._buffer.length<1;if(!n){var r=this._buffer.join("\n");if(e){this._sender.saveOnCrash(r);if(typeof t==="function"){t("data saved on crash")}}else{this._sender.send(Buffer.from?Buffer.from(r):new Buffer(r),t)}}this._lastSend=+new Date;this._buffer.length=0;clearTimeout(this._timeoutHandle);this._timeoutHandle=null;if(n&&typeof t==="function"){t("no data to send")}};Channel.prototype._stringify=function(e){try{return JSON.stringify(e)}catch(t){r.warn("Failed to serialize payload",t,e)}};return Channel}();e.exports=i},533:function(){eval("require")("original-fs")},543:function(e,t,n){var r=n(402),i=r.Constants;e.exports=function(){var e=0,t=0,n=0,o=0,s=0;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return n},set size(e){n=e},get offset(){return o},set offset(e){o=e},get commentLength(){return s},set commentLength(e){s=e},get mainHeaderSize(){return i.ENDHDR+s},loadFromBinary:function(a){if(a.length!==i.ENDHDR||a.readUInt32LE(0)!==i.ENDSIG)throw r.Errors.INVALID_END;e=a.readUInt16LE(i.ENDSUB);t=a.readUInt16LE(i.ENDTOT);n=a.readUInt32LE(i.ENDSIZ);o=a.readUInt32LE(i.ENDOFF);s=a.readUInt16LE(i.ENDCOM)},toBinary:function(){var r=Buffer.alloc(i.ENDHDR+s);r.writeUInt32LE(i.ENDSIG,0);r.writeUInt32LE(0,4);r.writeUInt16LE(e,i.ENDSUB);r.writeUInt16LE(t,i.ENDTOT);r.writeUInt32LE(n,i.ENDSIZ);r.writeUInt32LE(o,i.ENDOFF);r.writeUInt16LE(s,i.ENDCOM);r.fill(" ",i.ENDHDR);return r},toString:function(){return"{\n"+'\t"diskEntries" : '+e+",\n"+'\t"totalEntries" : '+t+",\n"+'\t"size" : '+n+" bytes,\n"+'\t"offset" : 0x'+o.toString(16).toUpperCase()+",\n"+'\t"commentLength" : 0x'+s+"\n"+"}"}}}},545:function(e,t,n){"use strict";function __export(e){for(var n in e)if(!t.hasOwnProperty(n))t[n]=e[n]}Object.defineProperty(t,"__esModule",{value:true});__export(n(583))},555:function(e,t,n){"use strict";var r=n(367);var i=n(179);var o=n(287);var s=function(){function EnvelopeFactory(){}EnvelopeFactory.createEnvelope=function(e,t,n,o,s){var a=null;switch(t){case r.TelemetryType.Trace:a=EnvelopeFactory.createTraceData(e);break;case r.TelemetryType.Dependency:a=EnvelopeFactory.createDependencyData(e);break;case r.TelemetryType.Event:a=EnvelopeFactory.createEventData(e);break;case r.TelemetryType.Exception:a=EnvelopeFactory.createExceptionData(e);break;case r.TelemetryType.Request:a=EnvelopeFactory.createRequestData(e);break;case r.TelemetryType.Metric:a=EnvelopeFactory.createMetricData(e);break;case r.TelemetryType.Availability:a=EnvelopeFactory.createAvailabilityData(e);break}if(n&&r.domainSupportsProperties(a.baseData)){if(a&&a.baseData){if(!a.baseData.properties){a.baseData.properties=n}else{for(var c in n){if(!a.baseData.properties[c]){a.baseData.properties[c]=n[c]}}}}a.baseData.properties=i.validateStringMap(a.baseData.properties)}var u=s?s.instrumentationKey||"":"";var f=new r.Envelope;f.data=a;f.iKey=u;f.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+a.baseType.substr(0,a.baseType.length-4);f.tags=this.getTags(o,e.tagOverrides);f.time=(new Date).toISOString();f.ver=1;f.sampleRate=s?s.samplingPercentage:100;if(t===r.TelemetryType.Metric){f.sampleRate=100}return f};EnvelopeFactory.createTraceData=function(e){var t=new r.MessageData;t.message=e.message;t.properties=e.properties;if(!isNaN(e.severity)){t.severityLevel=e.severity}else{t.severityLevel=r.SeverityLevel.Information}var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Trace);n.baseData=t;return n};EnvelopeFactory.createDependencyData=function(e){var t=new r.RemoteDependencyData;t.name=e.name;t.data=e.data;t.target=e.target;t.duration=i.msToTimeSpan(e.duration);t.success=e.success;t.type=e.dependencyTypeName;t.properties=e.properties;t.resultCode=e.resultCode?e.resultCode+"":"";if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Dependency);n.baseData=t;return n};EnvelopeFactory.createEventData=function(e){var t=new r.EventData;t.name=e.name;t.properties=e.properties;t.measurements=e.measurements;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Event);n.baseData=t;return n};EnvelopeFactory.createExceptionData=function(e){var t=new r.ExceptionData;t.properties=e.properties;if(!isNaN(e.severity)){t.severityLevel=e.severity}else{t.severityLevel=r.SeverityLevel.Error}t.measurements=e.measurements;t.exceptions=[];var n=e.exception["stack"];var o=new r.ExceptionDetails;o.message=e.exception.message;o.typeName=e.exception.name;o.parsedStack=this.parseStack(n);o.hasFullStack=i.isArray(o.parsedStack)&&o.parsedStack.length>0;t.exceptions.push(o);var s=new r.Data;s.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Exception);s.baseData=t;return s};EnvelopeFactory.createRequestData=function(e){var t=new r.RequestData;if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}t.name=e.name;t.url=e.url;t.source=e.source;t.duration=i.msToTimeSpan(e.duration);t.responseCode=e.resultCode?e.resultCode+"":"";t.success=e.success;t.properties=e.properties;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Request);n.baseData=t;return n};EnvelopeFactory.createMetricData=function(e){var t=new r.MetricData;t.metrics=[];var n=new r.DataPoint;n.count=!isNaN(e.count)?e.count:1;n.kind=r.DataPointType.Aggregation;n.max=!isNaN(e.max)?e.max:e.value;n.min=!isNaN(e.min)?e.min:e.value;n.name=e.name;n.stdDev=!isNaN(e.stdDev)?e.stdDev:0;n.value=e.value;t.metrics.push(n);t.properties=e.properties;var i=new r.Data;i.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Metric);i.baseData=t;return i};EnvelopeFactory.createAvailabilityData=function(e){var t=new r.AvailabilityData;if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}t.name=e.name;t.duration=i.msToTimeSpan(e.duration);t.success=e.success;t.runLocation=e.runLocation;t.message=e.message;t.measurements=e.measurements;t.properties=e.properties;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Availability);n.baseData=t;return n};EnvelopeFactory.getTags=function(e,t){var n=o.CorrelationContextManager.getCurrentContext();var r={};if(e&&e.tags){for(var i in e.tags){r[i]=e.tags[i]}}if(t){for(var i in t){r[i]=t[i]}}if(n){r[e.keys.operationId]=r[e.keys.operationId]||n.operation.id;r[e.keys.operationName]=r[e.keys.operationName]||n.operation.name;r[e.keys.operationParentId]=r[e.keys.operationParentId]||n.operation.parentId}return r};EnvelopeFactory.parseStack=function(e){var t=undefined;if(typeof e==="string"){var n=e.split("\n");t=[];var r=0;var i=0;for(var o=0;o<=n.length;o++){var s=n[o];if(a.regex.test(s)){var c=new a(n[o],r++);i+=c.sizeInBytes;t.push(c)}}var u=32*1024;if(i>u){var f=0;var l=t.length-1;var p=0;var d=f;var h=l;while(fu){var g=h-d+1;t.splice(d,g);break}d=f;h=l;f++;l--}}}return t};return EnvelopeFactory}();var a=function(){function _StackFrame(e,t){this.sizeInBytes=0;this.level=t;this.method="";this.assembly=i.trim(e);var n=e.match(_StackFrame.regex);if(n&&n.length>=5){this.method=i.trim(n[2])||this.method;this.fileName=i.trim(n[4])||"";this.line=parseInt(n[5])||0}this.sizeInBytes+=this.method.length;this.sizeInBytes+=this.fileName.length;this.sizeInBytes+=this.assembly.length;this.sizeInBytes+=_StackFrame.baseSize;this.sizeInBytes+=this.level.toString().length;this.sizeInBytes+=this.line.toString().length}_StackFrame.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/;_StackFrame.baseSize=58;return _StackFrame}();e.exports=s},566:function(e,t,n){e.exports=function(e){var t=n(761);return{inflate:function(){return t.inflateRawSync(e)},inflateAsync:function(n){var r=t.createInflateRaw(),i=[],o=0;r.on("data",function(e){i.push(e);o+=e.length});r.on("end",function(){var e=Buffer.alloc(o),t=0;e.fill(0);for(var r=0;r= 4.0.0",patch:o};function enable(){r.channel.registerMonkeyPatch("console",t.console);n(82)}t.enable=enable},593:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(367);var i=n(243);var o=[];var s=function(e){var t=e.data.message;o.forEach(function(n){if(t instanceof Error){n.trackException({exception:t})}else{if(t.lastIndexOf("\n")==t.length-1){t=t.substring(0,t.length-1)}n.trackTrace({message:t,severity:e.data.stderr?r.SeverityLevel.Warning:r.SeverityLevel.Information})}})};function enable(e,t){if(e){if(o.length===0){i.channel.subscribe("console",s)}o.push(t)}else{o=o.filter(function(e){return e!=t});if(o.length===0){i.channel.unsubscribe("console",s)}}}t.enable=enable;function dispose(){i.channel.unsubscribe("console",s);o=[]}t.dispose=dispose},602:function(e,t,n){"use strict";var r=n(747),i=n(304).StringDecoder;function createLineReader(e,t,n){if(t instanceof Function){n=t;t=undefined}if(!t)t={};var r=t.encoding||"utf8",o=t.separator||/\r\n?|\n/,s=t.bufferSize||1024,a="",c=new i(r),u=false,f=false,l=-1,p,d,h=false,v;if(o instanceof RegExp){v=function(){var e=o.exec(a);if(e&&(e.index+e[0].length0||!f}function nextLine(e){if(u){return e(new Error("LineReader has been closed"))}function getLine(t){if(t){return e(t)}if(l<0&&f){l=a.length}var n=a.substring(0,l);a=a.substring(l+p);l=-1;e(undefined,n)}v();if(l<0){if(f){if(hasNextLine()){l=a.length;getLine()}else{return e(new Error("No more lines to read."))}}else{readToSeparator(getLine)}}else{getLine()}}readToSeparator(function(e){if(e){onFailure(e)}else{return n(undefined,{hasNextLine:hasNextLine,nextLine:nextLine,close:close,isOpen:isOpen,isClosed:isClosed,getReadStream:getReadStream})}})}function open(e,t,n){if(t instanceof Function){n=t;t=undefined}var i;if(typeof e.read=="function"){i=e}else if(typeof e==="string"||e instanceof String){i=r.createReadStream(e)}else{n(new Error("Invalid file argument for LineReader.open. Must be filename or stream."));return}i.pause();createLineReader(i,t,n)}function eachLine(e,t,n,r){if(t instanceof Function){r=n;n=t;t=undefined}var i=n.length===3;var o;var s;open(e,t,function(e,t){o=t;if(s){s(t)}if(e){if(r)r(e);return}function finish(e){t.close(function(t){if(r)r(e||t)})}function newRead(){if(t.hasNextLine()){setImmediate(readNext)}else{finish()}}function continueCb(e){if(e!==false){newRead()}else{finish()}}function readNext(){t.nextLine(function(e,r){if(e){finish(e)}var o=!t.hasNextLine();if(i){n(r,o,continueCb)}else{if(n(r,o)!==false){newRead()}else{finish()}}})}newRead()});return{getReader:function(e){if(o){e(o)}else{s=e}}}}e.exports.open=open;e.exports.eachLine=eachLine},603:function(e){"use strict";var t=function(){function ContextTagKeys(){this.applicationVersion="ai.application.ver";this.deviceId="ai.device.id";this.deviceLocale="ai.device.locale";this.deviceModel="ai.device.model";this.deviceOEMName="ai.device.oemName";this.deviceOSVersion="ai.device.osVersion";this.deviceType="ai.device.type";this.locationIp="ai.location.ip";this.operationId="ai.operation.id";this.operationName="ai.operation.name";this.operationParentId="ai.operation.parentId";this.operationSyntheticSource="ai.operation.syntheticSource";this.operationCorrelationVector="ai.operation.correlationVector";this.sessionId="ai.session.id";this.sessionIsFirst="ai.session.isFirst";this.userAccountId="ai.user.accountId";this.userId="ai.user.id";this.userAuthUserId="ai.user.authUserId";this.cloudRole="ai.cloud.role";this.cloudRoleInstance="ai.cloud.roleInstance";this.internalSdkVersion="ai.internal.sdkVersion";this.internalAgentVersion="ai.internal.agentVersion";this.internalNodeName="ai.internal.nodeName"}return ContextTagKeys}();e.exports=t},605:function(e){e.exports=require("http")},606:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=this&&this.__rest||function(e,t){var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0)n[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it[r]?i:r}}this.add(new n(e,{level:r}))}var s=e.createLogger;e.createLogger=function patchedCreate(){var t=arguments[0].levels||e.config.npm.levels;var r;for(var i in t){if(t.hasOwnProperty(i)){r=r===undefined||t[i]>t[r]?i:r}}var o=s.apply(this,arguments);o.add(new n(e,{level:r}));var a=o.configure;o.configure=function(){a.apply(this,arguments);patchedConfigure.apply(this,arguments)};return o};var a=e.createLogger;e.configure=function(){a.apply(this,arguments);patchedConfigure.apply(this,arguments)};e.add(new n(e));return e};t.winston3={versionSpecifier:"3.x",patch:a};t.winston2={versionSpecifier:"2.x",patch:s};function enable(){o.channel.registerMonkeyPatch("winston",t.winston2);o.channel.registerMonkeyPatch("winston",t.winston3)}t.enable=enable},614:function(e){e.exports=require("events")},615:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=i(n(771));class ComparisionReportGenerator{constructor(e,t){this.apkAnalyser=e;this.reporter=t}generateComparisionReport(e,t,n,i,s,a,c){return r(this,void 0,void 0,function*(){const r=yield this.apkAnalyser.analyse(e,i);const u=yield this.apkAnalyser.analyse(t,s);const f=new o.default;f.baseApkLabel=r.apkLabel;f.targetApkLabel=u.apkLabel;a.forEach((e,t)=>{const n=r.sizeMetrics[e];const i=r.sizeMetrics[e];const o=i-n;f.comparisionMetrics.push({metricName:e,baseValue:n,targetValue:i,difference:o,threshold:c[t]})});this.reporter.writeReport(f,n);return f})}}t.default=ComparisionReportGenerator},619:function(e){e.exports=require("constants")},620:function(e,t,n){"use strict";const r=process.binding("async_wrap");const i=r.Providers.TIMERWRAP;const o={nextTick:n(764),promise:n(37),timers:n(737)};const s=new Set;function State(){this.enabled=false;this.counter=0}function Hooks(){const e=this.initFns=[];const t=this.preFns=[];const n=this.postFns=[];const r=this.destroyFns=[];this.init=function(t,n,r,o){if(n===i){s.add(t);return}for(const i of e){i(t,this,n,r,o)}};this.pre=function(e){if(s.has(e))return;for(const n of t){n(e,this)}};this.post=function(e,t){if(s.has(e))return;for(const r of n){r(e,this,t)}};this.destroy=function(e){if(s.has(e)){s.delete(e);return}for(const t of r){t(e)}}}Hooks.prototype.add=function(e){if(e.init)this.initFns.push(e.init);if(e.pre)this.preFns.push(e.pre);if(e.post)this.postFns.push(e.post);if(e.destroy)this.destroyFns.push(e.destroy)};function removeElement(e,t){const n=e.indexOf(t);if(n===-1)return;e.splice(n,1)}Hooks.prototype.remove=function(e){if(e.init)removeElement(this.initFns,e.init);if(e.pre)removeElement(this.preFns,e.pre);if(e.post)removeElement(this.postFns,e.post);if(e.destroy)removeElement(this.destroyFns,e.destroy)};function AsyncHook(){this._state=new State;this._hooks=new Hooks;this.version=n(664).version;this.providers=r.Providers;for(const e of Object.keys(o)){o[e].call(this)}if(process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")){console.warn("warning: you are using async-hook-jl which is unstable.")}r.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}e.exports=AsyncHook;AsyncHook.prototype.addHooks=function(e){this._hooks.add(e)};AsyncHook.prototype.removeHooks=function(e){this._hooks.remove(e)};AsyncHook.prototype.enable=function(){this._state.enabled=true;r.enable()};AsyncHook.prototype.disable=function(){this._state.enabled=false;r.disable()}},622:function(e){e.exports=require("path")},631:function(e){e.exports=require("net")},633:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class ThresholdChecker{constructor(e){this.ciCore=e}checkThresholds(e){var t=true;e.comparisionMetrics.forEach(e=>{if(e.threshold==NaN){this.ciCore.logInfo(e.metricName+": ignoring threshold for metric!");return}if(e.difference>e.threshold){this.ciCore.logError(e.metricName+" increased more than threshold!");t=false}});return t}}t.default=ThresholdChecker},635:function(e,t,n){"use strict";var r=n(211);var i=n(366);var o=n(970);var s={method:"POST",time:"x-ms-qps-transmission-time",subscribed:"x-ms-qps-subscribed"};var a=function(){function QuickPulseSender(e){this._config=e;this._consecutiveErrors=0}QuickPulseSender.prototype.ping=function(e,t){this._submitData(e,t,"ping")};QuickPulseSender.prototype.post=function(e,t){this._submitData([e],t,"post")};QuickPulseSender.prototype._submitData=function(e,t,n){var a=this;var c=JSON.stringify(e);var u=(l={},l[i.disableCollectionRequestOption]=true,l.host=this._config.quickPulseHost,l.method=s.method,l.path="/QuickPulseService.svc/"+n+"?ikey="+this._config.instrumentationKey,l.headers=(p={Expect:"100-continue"},p[s.time]=1e4*Date.now(),p["Content-Type"]="application/json",p["Content-Length"]=Buffer.byteLength(c),p),l);var f=r.request(u,function(e){var n=e.headers[s.subscribed]==="true";a._consecutiveErrors=0;t(n,e)});f.on("error",function(e){a._consecutiveErrors++;var n="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";if(a._consecutiveErrors%QuickPulseSender.MAX_QPS_FAILURES_BEFORE_WARN===0){n="Live Metrics endpoint could not be reached "+a._consecutiveErrors+" consecutive times. Most recent error:";o.warn(QuickPulseSender.TAG,n,e)}else{o.info(QuickPulseSender.TAG,n,e)}t()});f.write(c);f.end();var l,p};QuickPulseSender.TAG="QuickPulseSender";QuickPulseSender.MAX_QPS_FAILURES_BEFORE_WARN=25;return QuickPulseSender}();e.exports=a},645:function(e){"use strict";var t=function(){function Base(){}return Base}();e.exports=t},660:function(){eval("require")("applicationinsights-native-metrics")},664:function(e){e.exports={_from:"async-hook-jl@^1.7.6",_id:"async-hook-jl@1.7.6",_inBundle:false,_integrity:"sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==",_location:"/async-hook-jl",_phantomChildren:{},_requested:{type:"range",registry:true,raw:"async-hook-jl@^1.7.6",name:"async-hook-jl",escapedName:"async-hook-jl",rawSpec:"^1.7.6",saveSpec:null,fetchSpec:"^1.7.6"},_requiredBy:["/cls-hooked"],_resolved:"https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz",_shasum:"4fd25c2f864dbaf279c610d73bf97b1b28595e68",_spec:"async-hook-jl@^1.7.6",_where:"/Users/prpendy/Work/android-app-size-diff/node_modules/cls-hooked",author:{name:"Andreas Madsen",email:"amwebdk@gmail.com"},bugs:{url:"https://github.com/jeff-lewis/async-hook-jl/issues"},bundleDependencies:false,dependencies:{"stack-chain":"^1.3.7"},deprecated:false,description:"Inspect the life of handle objects in node",devDependencies:{async:"1.5.x","cli-color":"1.1.x",endpoint:"0.4.x",eslint:"^3.4.0"},engines:{node:"^4.7 || >=6.9 || >=7.3"},homepage:"https://github.com/jeff-lewis/async-hook-jl#readme",keywords:["async","async hooks","inspect","async wrap"],license:"MIT",main:"./index.js",name:"async-hook-jl",repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},scripts:{test:"node ./test/runner.js && eslint ."},version:"1.7.6"}},669:function(e){e.exports=require("util")},671:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(RemoteDependencyData,e);function RemoteDependencyData(){var t=e.call(this)||this;t.ver=2;t.success=true;t.properties={};t.measurements={};return t}return RemoteDependencyData}(i);e.exports=o},686:function(e,t,n){"use strict";var r=n(747);var i=n(87);var o=n(622);var s=n(761);var a=n(129);var c=n(970);var u=n(366);var f=n(179);var l=function(){function Sender(e,t,n){this._config=e;this._onSuccess=t;this._onError=n;this._enableDiskRetryMode=false;this._resendInterval=Sender.WAIT_BETWEEN_RESEND;this._maxBytesOnDisk=Sender.MAX_BYTES_ON_DISK;this._numConsecutiveFailures=0;if(!Sender.OS_PROVIDES_FILE_PROTECTION){if(Sender.USE_ICACLS){try{Sender.OS_PROVIDES_FILE_PROTECTION=r.existsSync(Sender.ICACLS_PATH)}catch(e){}if(!Sender.OS_PROVIDES_FILE_PROTECTION){c.warn(Sender.TAG,"Could not find ICACLS in expected location! This is necessary to use disk retry mode on Windows.")}}else{Sender.OS_PROVIDES_FILE_PROTECTION=true}}}Sender.prototype.setDiskRetryMode=function(e,t,n){this._enableDiskRetryMode=Sender.OS_PROVIDES_FILE_PROTECTION&&e;if(typeof t==="number"&&t>=0){this._resendInterval=Math.floor(t)}if(typeof n==="number"&&n>=0){this._maxBytesOnDisk=Math.floor(n)}if(e&&!Sender.OS_PROVIDES_FILE_PROTECTION){this._enableDiskRetryMode=false;c.warn(Sender.TAG,"Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")}};Sender.prototype.send=function(e,t){var n=this;var r=this._config.endpointUrl;var i={method:"POST",withCredentials:false,headers:{"Content-Type":"application/x-json-stream"}};s.gzip(e,function(o,s){var a=s;if(o){c.warn(o);a=e;i.headers["Content-Length"]=e.length.toString()}else{i.headers["Content-Encoding"]="gzip";i.headers["Content-Length"]=s.length}c.info(Sender.TAG,i);i[u.disableCollectionRequestOption]=true;var l=function(r){r.setEncoding("utf-8");var i="";r.on("data",function(e){i+=e});r.on("end",function(){n._numConsecutiveFailures=0;c.info(Sender.TAG,i);if(typeof n._onSuccess==="function"){n._onSuccess(i)}if(typeof t==="function"){t(i)}if(n._enableDiskRetryMode){if(r.statusCode===200){setTimeout(function(){return n._sendFirstFileOnDisk()},n._resendInterval).unref()}else if(r.statusCode===408||r.statusCode===429||r.statusCode===439||r.statusCode===500||r.statusCode===503){n._storeToDisk(e)}}})};var p=f.makeRequest(n._config,r,i,l);p.on("error",function(r){n._numConsecutiveFailures++;if(!n._enableDiskRetryMode||n._numConsecutiveFailures>0&&n._numConsecutiveFailures%Sender.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var i="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";if(n._enableDiskRetryMode){i="Ingestion endpoint could not be reached "+n._numConsecutiveFailures+" consecutive times. There may be resulting telemetry loss. Most recent error:"}c.warn(Sender.TAG,i,r)}else{var i="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";c.info(Sender.TAG,i,r)}n._onErrorHelper(r);if(typeof t==="function"){var o="error sending telemetry";if(r&&typeof r.toString==="function"){o=r.toString()}t(o)}if(n._enableDiskRetryMode){n._storeToDisk(e)}});p.write(a);p.end()})};Sender.prototype.saveOnCrash=function(e){if(this._enableDiskRetryMode){this._storeToDiskSync(e)}};Sender.prototype._runICACLS=function(e,t){var n=a.spawn(Sender.ICACLS_PATH,e,{windowsHide:true});n.on("error",function(e){return t(e)});n.on("close",function(e,n){return t(e===0?null:new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+e+")"))})};Sender.prototype._runICACLSSync=function(e){if(a.spawnSync){var t=a.spawnSync(Sender.ICACLS_PATH,e,{windowsHide:true});if(t.error){throw t.error}else if(t.status!==0){throw new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+t.status+")")}}else{throw new Error("Could not synchronously call ICACLS under current version of Node.js")}};Sender.prototype._getACLIdentity=function(e){if(Sender.ACL_IDENTITY){return e(null,Sender.ACL_IDENTITY)}var t=a.spawn(Sender.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:true,stdio:["ignore","pipe","pipe"]});var n="";t.stdout.on("data",function(e){return n+=e});t.on("error",function(t){return e(t,null)});t.on("close",function(t,r){Sender.ACL_IDENTITY=n&&n.trim();return e(t===0?null:new Error("Getting ACL identity did not succeed (PS returned code "+t+")"),Sender.ACL_IDENTITY)})};Sender.prototype._getACLIdentitySync=function(){if(Sender.ACL_IDENTITY){return Sender.ACL_IDENTITY}if(a.spawnSync){var e=a.spawnSync(Sender.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:true,stdio:["ignore","pipe","pipe"]});if(e.error){throw e.error}else if(e.status!==0){throw new Error("Getting ACL identity did not succeed (PS returned code "+e.status+")")}Sender.ACL_IDENTITY=e.stdout&&e.stdout.toString().trim();return Sender.ACL_IDENTITY}else{throw new Error("Could not synchronously get ACL identity under current version of Node.js")}};Sender.prototype._getACLArguments=function(e,t){return[e,"/grant","*S-1-5-32-544:(OI)(CI)F","/grant",t+":(OI)(CI)F","/inheritance:r"]};Sender.prototype._applyACLRules=function(e,t){var n=this;if(!Sender.USE_ICACLS){return t(null)}if(Sender.ACLED_DIRECTORIES[e]===undefined){Sender.ACLED_DIRECTORIES[e]=false;this._getACLIdentity(function(r,i){if(r){Sender.ACLED_DIRECTORIES[e]=false;return t(r)}else{n._runICACLS(n._getACLArguments(e,i),function(n){Sender.ACLED_DIRECTORIES[e]=!n;return t(n)})}})}else{return t(Sender.ACLED_DIRECTORIES[e]?null:new Error("Setting ACL restrictions did not succeed (cached result)"))}};Sender.prototype._applyACLRulesSync=function(e){if(Sender.USE_ICACLS){if(Sender.ACLED_DIRECTORIES[e]===undefined){this._runICACLSSync(this._getACLArguments(e,this._getACLIdentitySync()));Sender.ACLED_DIRECTORIES[e]=true;return}else if(!Sender.ACLED_DIRECTORIES[e]){throw new Error("Setting ACL restrictions did not succeed (cached result)")}}};Sender.prototype._confirmDirExists=function(e,t){var n=this;r.lstat(e,function(i,o){if(i&&i.code==="ENOENT"){r.mkdir(e,function(r){if(r&&r.code!=="EEXIST"){t(r)}else{n._applyACLRules(e,t)}})}else if(!i&&o.isDirectory()){n._applyACLRules(e,t)}else{t(i||new Error("Path existed but was not a directory"))}})};Sender.prototype._getShallowDirectorySize=function(e,t){r.readdir(e,function(n,i){if(n){return t(n,-1)}var s=null;var a=0;var c=0;if(i.length===0){t(null,0);return}for(var u=0;ut._maxBytesOnDisk){c.warn(Sender.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+s);return}var a=(new Date).getTime()+".ai.json";var u=o.join(n,a);c.info(Sender.TAG,"saving data to disk at: "+u);r.writeFile(u,e,{mode:384},function(e){return t._onErrorHelper(e)})})})};Sender.prototype._storeToDiskSync=function(e){var t=o.join(i.tmpdir(),Sender.TEMPDIR_PREFIX+this._config.instrumentationKey);try{c.info(Sender.TAG,"Checking existance of data storage directory: "+t);if(!r.existsSync(t)){r.mkdirSync(t)}this._applyACLRulesSync(t);var n=this._getShallowDirectorySizeSync(t);if(n>this._maxBytesOnDisk){c.info(Sender.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+n);return}var s=(new Date).getTime()+".ai.json";var a=o.join(t,s);c.info(Sender.TAG,"saving data before crash to disk at: "+a);r.writeFileSync(a,e,{mode:384})}catch(e){c.warn(Sender.TAG,"Error while saving data to disk: "+(e&&e.message));this._onErrorHelper(e)}};Sender.prototype._sendFirstFileOnDisk=function(){var e=this;var t=o.join(i.tmpdir(),Sender.TEMPDIR_PREFIX+this._config.instrumentationKey);r.exists(t,function(n){if(n){r.readdir(t,function(n,i){if(!n){i=i.filter(function(e){return o.basename(e).indexOf(".ai.json")>-1});if(i.length>0){var s=i[0];var a=o.join(t,s);r.readFile(a,function(t,n){if(!t){r.unlink(a,function(t){if(!t){e.send(n)}else{e._onErrorHelper(t)}})}else{e._onErrorHelper(t)}})}}else{e._onErrorHelper(n)}})}})};Sender.prototype._onErrorHelper=function(e){if(typeof this._onError==="function"){this._onError(e)}};Sender.TAG="Sender";Sender.ICACLS_PATH=process.env.systemdrive+"/windows/system32/icacls.exe";Sender.POWERSHELL_PATH=process.env.systemdrive+"/windows/system32/windowspowershell/v1.0/powershell.exe";Sender.ACLED_DIRECTORIES={};Sender.ACL_IDENTITY=null;Sender.WAIT_BETWEEN_RESEND=60*1e3;Sender.MAX_BYTES_ON_DISK=50*1e3*1e3;Sender.MAX_CONNECTION_FAILURES_BEFORE_WARN=5;Sender.TEMPDIR_PREFIX="appInsights-node";Sender.OS_PROVIDES_FILE_PROTECTION=false;Sender.USE_ICACLS=i.type()==="Windows_NT";return Sender}();e.exports=l},701:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";t.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";t.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var n;(function(e){e["COMMITTED_BYTES"]="\\Memory\\Committed Bytes";e["PROCESSOR_TIME"]="\\Processor(_Total)\\% Processor Time";e["REQUEST_RATE"]="\\ApplicationInsights\\Requests/Sec";e["REQUEST_FAILURE_RATE"]="\\ApplicationInsights\\Requests Failed/Sec";e["REQUEST_DURATION"]="\\ApplicationInsights\\Request Duration";e["DEPENDENCY_RATE"]="\\ApplicationInsights\\Dependency Calls/Sec";e["DEPENDENCY_FAILURE_RATE"]="\\ApplicationInsights\\Dependency Calls Failed/Sec";e["DEPENDENCY_DURATION"]="\\ApplicationInsights\\Dependency Call Duration";e["EXCEPTION_RATE"]="\\ApplicationInsights\\Exceptions/Sec"})(n=t.QuickPulseCounter||(t.QuickPulseCounter={}));var r;(function(e){e["PRIVATE_BYTES"]="\\Process(??APP_WIN32_PROC??)\\Private Bytes";e["AVAILABLE_BYTES"]="\\Memory\\Available Bytes";e["PROCESSOR_TIME"]="\\Processor(_Total)\\% Processor Time";e["PROCESS_TIME"]="\\Process(??APP_WIN32_PROC??)\\% Processor Time";e["REQUEST_RATE"]="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec";e["REQUEST_DURATION"]="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(r=t.PerformanceCounter||(t.PerformanceCounter={}));t.PerformanceToQuickPulseCounter=(i={},i[r.PROCESSOR_TIME]=n.PROCESSOR_TIME,i[r.REQUEST_RATE]=n.REQUEST_RATE,i[r.REQUEST_DURATION]=n.REQUEST_DURATION,i[n.COMMITTED_BYTES]=n.COMMITTED_BYTES,i[n.REQUEST_FAILURE_RATE]=n.REQUEST_FAILURE_RATE,i[n.DEPENDENCY_RATE]=n.DEPENDENCY_RATE,i[n.DEPENDENCY_FAILURE_RATE]=n.DEPENDENCY_FAILURE_RATE,i[n.DEPENDENCY_DURATION]=n.DEPENDENCY_DURATION,i[n.EXCEPTION_RATE]=n.EXCEPTION_RATE,i);t.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability"};t.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument"};t.TelemetryTypeStringToQuickPulseType={EventData:t.QuickPulseType.Event,ExceptionData:t.QuickPulseType.Exception,MessageData:t.QuickPulseType.Trace,MetricData:t.QuickPulseType.Metric,RequestData:t.QuickPulseType.Request,RemoteDependencyData:t.QuickPulseType.Dependency,AvailabilityData:t.QuickPulseType.Availability};t.TelemetryTypeStringToQuickPulseDocumentType={EventData:t.QuickPulseDocumentType.Event,ExceptionData:t.QuickPulseDocumentType.Exception,MessageData:t.QuickPulseDocumentType.Trace,MetricData:t.QuickPulseDocumentType.Metric,RequestData:t.QuickPulseDocumentType.Request,RemoteDependencyData:t.QuickPulseDocumentType.Dependency,AvailabilityData:t.QuickPulseDocumentType.Availability};var i},708:function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const i=r(n(747));const o=r(n(669));class FilesSizeCalculator{getFilesSize(e){var t=0;if(!o.isNullOrUndefined(e)){e.forEach(e=>{t+=this.getFileSize(e)})}return t}getFileSize(e){const t=i.statSync(e);return t["size"]}}t.FilesSizeCalculator=FilesSizeCalculator},716:function(e,t,n){"use strict";var r=n(294);var i=function(){function AutoCollectConsole(e){if(!!AutoCollectConsole.INSTANCE){throw new Error("Console logging adapter tracking should be configured from the applicationInsights object")}this._client=e;AutoCollectConsole.INSTANCE=this}AutoCollectConsole.prototype.enable=function(e,t){if(r.IsInitialized){n(593).enable(e&&t,this._client);n(5).enable(e,this._client);n(151).enable(e,this._client)}};AutoCollectConsole.prototype.isInitialized=function(){return this._isInitialized};AutoCollectConsole.prototype.dispose=function(){AutoCollectConsole.INSTANCE=null;this.enable(false,false)};AutoCollectConsole._methodNames=["debug","info","log","warn","error"];return AutoCollectConsole}();e.exports=i},718:function(e,t,n){var r=n(519).require(),i=n(622);r.existsSync=r.existsSync||i.existsSync;e.exports=function(e){var t=e||"",n=0,o=newAttr(),s=null;function newAttr(){return{directory:false,readonly:false,hidden:false,executable:false,mtime:0,atime:0}}if(t&&r.existsSync(t)){s=r.statSync(t);o.directory=s.isDirectory();o.mtime=s.mtime;o.atime=s.atime;o.executable=!!(1&parseInt((s.mode&parseInt("777",8)).toString(8)[0]));o.readonly=!!(2&parseInt((s.mode&parseInt("777",8)).toString(8)[0]));o.hidden=i.basename(t)[0]==="."}else{console.warn("Invalid path: "+t)}return{get directory(){return o.directory},get readOnly(){return o.readonly},get hidden(){return o.hidden},get mtime(){return o.mtime},get atime(){return o.atime},get executable(){return o.executable},decodeAttributes:function(e){},encodeAttributes:function(e){},toString:function(){return"{\n"+'\t"path" : "'+t+",\n"+'\t"isDirectory" : '+o.directory+",\n"+'\t"isReadOnly" : '+o.readonly+",\n"+'\t"isHidden" : '+o.hidden+",\n"+'\t"isExecutable" : '+o.executable+",\n"+'\t"mTime" : '+o.mtime+"\n"+'\t"aTime" : '+o.atime+"\n"+"}"}}}},721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=[];t.subscriber=function(e){i.forEach(function(t){if(e.data.commandObj.command==="info"){return}t.trackDependency({target:e.data.address,name:e.data.commandObj.command,data:e.data.commandObj.command,duration:e.data.duration,success:!e.data.err,resultCode:e.data.err?"1":"0",dependencyTypeName:"redis"})})};function enable(e,n){if(e){if(i.length===0){r.channel.subscribe("redis",t.subscriber)}i.push(n)}else{i=i.filter(function(e){return e!=n});if(i.length===0){r.channel.unsubscribe("redis",t.subscriber)}}}t.enable=enable},724:function(e,t,n){"use strict";const r=n(669);const i=n(357);const o=n(848);const s=n(303);const a="cls@contexts";const c="error@context";const u=process.env.DEBUG_CLS_HOOKED;let f=-1;e.exports={getNamespace:getNamespace,createNamespace:createNamespace,destroyNamespace:destroyNamespace,reset:reset,ERROR_SYMBOL:c};function Namespace(e){this.name=e;this.active=null;this._set=[];this.id=null;this._contexts=new Map;this._indent=0}Namespace.prototype.set=function set(e,t){if(!this.active){throw new Error("No context available. ns.run() or ns.bind() must be called first.")}this.active[e]=t;if(u){const n=" ".repeat(this._indent<0?0:this._indent);debug2(n+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+f+" active:"+r.inspect(this.active,{showHidden:true,depth:2,colors:true}))}return t};Namespace.prototype.get=function get(e){if(!this.active){if(u){const t=s.currentId();const n=s.triggerAsyncId();const r=" ".repeat(this._indent<0?0:this._indent);debug2(`${r}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}return undefined}if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(i+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+f+" active:"+r.inspect(this.active,{showHidden:true,depth:2,colors:true}));debug2(`${i}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]};Namespace.prototype.createContext=function createContext(){let e=Object.create(this.active?this.active:Object.prototype);e._ns_name=this.name;e.id=f;if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-CREATED Context: (${this.name}) currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:true,depth:2,colors:true})}`)}return e};Namespace.prototype.run=function run(e){let t=this.createContext();this.enter(t);try{if(u){const e=s.triggerAsyncId();const n=s.executionAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${f} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}e(t);return t}catch(e){if(e){e[c]=t}throw e}finally{if(u){const e=s.triggerAsyncId();const n=s.executionAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-RUN END: (${this.name}) currentUid:${f} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}};Namespace.prototype.runAndReturn=function runAndReturn(e){let t;this.run(function(n){t=e(n)});return t};Namespace.prototype.runPromise=function runPromise(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch){throw new Error("fn must return a promise.")}if(u){debug2("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}return n.then(e=>{if(u){debug2("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);return e}).catch(e=>{e[c]=t;if(u){debug2("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);throw e})};Namespace.prototype.bind=function bindFactory(e,t){if(!t){if(!this.active){t=this.createContext()}else{t=this.active}}let n=this;return function clsBind(){n.enter(t);try{return e.apply(this,arguments)}catch(e){if(e){e[c]=t}throw e}finally{n.exit(t)}}};Namespace.prototype.enter=function enter(e){i.ok(e,"context must be provided for entering");if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-ENTER: (${this.name}) currentUid:${f} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active);this.active=e};Namespace.prototype.exit=function exit(e){i.ok(e,"context must be provided for exiting");if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-EXIT: (${this.name}) currentUid:${f} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e){i.ok(this._set.length,"can't remove top context");this.active=this._set.pop();return}let t=this._set.lastIndexOf(e);if(t<0){if(u){debug2("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e))}i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))}else{i.ok(t,"can't remove top context");this._set.splice(t,1)}};Namespace.prototype.bindEmitter=function bindEmitter(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this;let n="context@"+this.name;function attach(e){if(!e){return}if(!e[a]){e[a]=Object.create(null)}e[a][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[a])){return e}let t=e;let n=e[a];Object.keys(n).forEach(function(e){let r=n[e];t=r.namespace.bind(t,r.context)});return t}o(e,attach,bind)};Namespace.prototype.fromException=function fromException(e){return e[c]};function getNamespace(e){return process.namespaces[e]}function createNamespace(e){i.ok(e,"namespace must be given a name.");if(u){debug2(`NS-CREATING NAMESPACE (${e})`)}let t=new Namespace(e);t.id=f;const n=s.createHook({init(n,i,o,a){f=s.executionAsyncId();if(t.active){t._contexts.set(n,t.active);if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(f===0){const o=s.triggerAsyncId();const c=t._contexts.get(o);if(c){t._contexts.set(n,c);if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT USING CONTEXT FROM TRIGGERID [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT MISSING CONTEXT [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}if(u&&i==="PROMISE"){debug2(r.inspect(a,{showHidden:true}));const s=a.parentId;const c=" ".repeat(t._indent<0?0:t._indent);debug2(`${c}INIT RESOURCE-PROMISE [${i}] (${e}) parentId:${s} asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}},before(n){f=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(f);if(i){if(u){const o=s.triggerAsyncId();const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}BEFORE (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`);t._indent+=2}t.enter(i)}else if(u){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);debug2(`${o}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${f} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} namespace._contexts:${r.inspect(t._contexts,{showHidden:true,depth:2,colors:true})}`);t._indent+=2}},after(n){f=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(f);if(i){if(u){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}AFTER (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}t.exit(i)}else if(u){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}},destroy(n){f=s.executionAsyncId();if(u){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);debug2(`${o}DESTROY (${e}) currentUid:${f} asyncId:${n} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(t._contexts.get(f))}`)}t._contexts.delete(n)}});n.enable();process.namespaces[e]=t;return t}function destroyNamespace(e){let t=getNamespace(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"');i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t));process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroyNamespace(e)})}process.namespaces=Object.create(null)}process.namespaces={};function debug2(...e){if(u){process._rawDebug(`${r.format(...e)}`)}}},733:function(e,t,n){"use strict";var r=n(970);var i=n(39);var o=n(8);var s=n(635);var a=n(701);var c=n(485);var u=function(){function QuickPulseStateManager(e,t){this._isCollectingData=false;this._lastSuccessTime=Date.now();this._lastSendSucceeded=true;this._metrics={};this._documents=[];this._collectors=[];this.config=new i(e);this.context=t||new c;this._sender=new s(this.config);this._isEnabled=false}QuickPulseStateManager.prototype.addCollector=function(e){this._collectors.push(e)};QuickPulseStateManager.prototype.trackMetric=function(e){this._addMetric(e)};QuickPulseStateManager.prototype.addDocument=function(e){var t=o.telemetryEnvelopeToQuickPulseDocument(e);if(t){this._documents.push(t)}};QuickPulseStateManager.prototype.enable=function(e){if(e&&!this._isEnabled){this._isEnabled=true;this._goQuickPulse()}else if(!e&&this._isEnabled){this._isEnabled=false;clearTimeout(this._handle);this._handle=undefined}};QuickPulseStateManager.prototype.enableCollectors=function(e){this._collectors.forEach(function(t){t.enable(e)})};QuickPulseStateManager.prototype._addMetric=function(e){var t=e.value;var n=e.count||1;var r=a.PerformanceToQuickPulseCounter[e.name];if(r){if(this._metrics[r]){this._metrics[r].Value=(this._metrics[r].Value*this._metrics[r].Weight+t*n)/(this._metrics[r].Weight+n);this._metrics[r].Weight+=n}else{this._metrics[r]=o.createQuickPulseMetric(e);this._metrics[r].Name=r;this._metrics[r].Weight=1}}};QuickPulseStateManager.prototype._resetQuickPulseBuffer=function(){delete this._metrics;this._metrics={};this._documents.length=0};QuickPulseStateManager.prototype._goQuickPulse=function(){var e=this;var t=Object.keys(this._metrics).map(function(t){return e._metrics[t]});var n=o.createQuickPulseEnvelope(t,this._documents.slice(),this.config,this.context);this._resetQuickPulseBuffer();if(this._isCollectingData){this._post(n)}else{this._ping(n)}var r=this._isCollectingData?QuickPulseStateManager.POST_INTERVAL:QuickPulseStateManager.PING_INTERVAL;if(this._isCollectingData&&Date.now()-this._lastSuccessTime>=QuickPulseStateManager.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded){this._isCollectingData=false;r=QuickPulseStateManager.FALLBACK_INTERVAL}else if(!this._isCollectingData&&Date.now()-this._lastSuccessTime>=QuickPulseStateManager.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded){r=QuickPulseStateManager.FALLBACK_INTERVAL}this._lastSendSucceeded=null;this._handle=setTimeout(this._goQuickPulse.bind(this),r);this._handle.unref()};QuickPulseStateManager.prototype._ping=function(e){this._sender.ping(e,this._quickPulseDone.bind(this))};QuickPulseStateManager.prototype._post=function(e){this._sender.post(e,this._quickPulseDone.bind(this))};QuickPulseStateManager.prototype._quickPulseDone=function(e,t){if(e!=undefined){if(this._isCollectingData!==e){r.info("Live Metrics sending data",e);this.enableCollectors(e)}this._isCollectingData=e;if(t&&t.statusCode<300&&t.statusCode>=200){this._lastSuccessTime=Date.now();this._lastSendSucceeded=true}else{this._lastSendSucceeded=false}}else{this._lastSendSucceeded=false}};QuickPulseStateManager.MAX_POST_WAIT_TIME=2e4;QuickPulseStateManager.MAX_PING_WAIT_TIME=6e4;QuickPulseStateManager.FALLBACK_INTERVAL=6e4;QuickPulseStateManager.PING_INTERVAL=5e3;QuickPulseStateManager.POST_INTERVAL=1e3;return QuickPulseStateManager}();e.exports=u},737:function(e,t,n){"use strict";const r=n(213);function TimeoutWrap(){}function IntervalWrap(){}function ImmediateWrap(){}const i=new Map;const o=new Map;const s=new Map;let a=null;let c=false;e.exports=function patch(){patchTimer(this._hooks,this._state,"setTimeout","clearTimeout",TimeoutWrap,i,true);patchTimer(this._hooks,this._state,"setInterval","clearInterval",IntervalWrap,o,false);patchTimer(this._hooks,this._state,"setImmediate","clearImmediate",ImmediateWrap,s,true);global.setTimeout=r.setTimeout;global.setInterval=r.setInterval;global.setImmediate=r.setImmediate;global.clearTimeout=r.clearTimeout;global.clearInterval=r.clearInterval;global.clearImmediate=r.clearImmediate};function patchTimer(e,t,n,i,o,s,u){const f=r[n];const l=r[i];r[n]=function(){if(!t.enabled)return f.apply(r,arguments);const n=new Array(arguments.length);for(let e=0;e0){process.once("uncaughtException",function(){e.post.call(l,p,true);s.delete(d);e.destroy.call(null,p)})}}e.post.call(l,p,false);a=null;if(u||c){c=false;s.delete(d);e.destroy.call(null,p)}};d=f.apply(r,n);s.set(d,p);return d};r[i]=function(t){if(a===t&&t!==null){c=true}else if(s.has(t)){const n=s.get(t);s.delete(t);e.destroy.call(null,n)}l.apply(r,arguments)}}},747:function(e){e.exports=require("fs")},753:function(e,t,n){"use strict";var r=n(701);var i=function(){function ConnectionStringParser(){}ConnectionStringParser.parse=function(e){if(!e){return{}}var t=e.split(ConnectionStringParser._FIELDS_SEPARATOR);var n=t.reduce(function(e,t){var n=t.split(ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR);if(n.length===2){var r=n[0].toLowerCase();var i=n[1];e[r]=i}return e},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var i=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+i+"dc."+n.endpointsuffix;n.liveendpoint=n.liveendpoint||"https://"+i+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||r.DEFAULT_BREEZE_ENDPOINT;n.liveendpoint=n.liveendpoint||r.DEFAULT_LIVEMETRICS_ENDPOINT}return n};ConnectionStringParser._FIELDS_SEPARATOR=";";ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR="=";return ConnectionStringParser}();e.exports=i},761:function(e){e.exports=require("zlib")},764:function(e){"use strict";function NextTickWrap(){}e.exports=function patch(){const e=this._hooks;const t=this._state;const n=process.nextTick;process.nextTick=function(){if(!t.enabled)return n.apply(process,arguments);const r=new Array(arguments.length);for(let e=0;e0){process.once("uncaughtException",function(){e.post.call(o,s,true);e.destroy.call(null,s)})}}e.post.call(o,s,false);e.destroy.call(null,s)};return n.apply(process,r)}}},769:function(e,t,n){"use strict";var r=n(179);var i=n(970);var o=function(){function CorrelationIdManager(){}CorrelationIdManager.queryCorrelationId=function(e,t){var n=e.profileQueryEndpoint+"/api/profiles/"+e.instrumentationKey+"/appId";if(CorrelationIdManager.completedLookups.hasOwnProperty(n)){t(CorrelationIdManager.completedLookups[n]);return}else if(CorrelationIdManager.pendingLookups[n]){CorrelationIdManager.pendingLookups[n].push(t);return}CorrelationIdManager.pendingLookups[n]=[t];var o=function(){if(!CorrelationIdManager.pendingLookups[n]){return}var t={method:"GET",disableAppInsightsAutoCollection:true};i.info(CorrelationIdManager.TAG,t);var s=r.makeRequest(e,n,t,function(t){if(t.statusCode===200){var r="";t.setEncoding("utf-8");t.on("data",function(e){r+=e});t.on("end",function(){i.info(CorrelationIdManager.TAG,r);var e=CorrelationIdManager.correlationIdPrefix+r;CorrelationIdManager.completedLookups[n]=e;if(CorrelationIdManager.pendingLookups[n]){CorrelationIdManager.pendingLookups[n].forEach(function(t){return t(e)})}delete CorrelationIdManager.pendingLookups[n]})}else if(t.statusCode>=400&&t.statusCode<500){CorrelationIdManager.completedLookups[n]=undefined;delete CorrelationIdManager.pendingLookups[n]}else{setTimeout(o,e.correlationIdRetryIntervalMs)}});if(s){s.on("error",function(e){i.warn(CorrelationIdManager.TAG,e)});s.end()}};setTimeout(o,0)};CorrelationIdManager.cancelCorrelationIdQuery=function(e,t){var n=e.profileQueryEndpoint+"/api/profiles/"+e.instrumentationKey+"/appId";var r=CorrelationIdManager.pendingLookups[n];if(r){CorrelationIdManager.pendingLookups[n]=r.filter(function(e){return e!=t});if(CorrelationIdManager.pendingLookups[n].length==0){delete CorrelationIdManager.pendingLookups[n]}}};CorrelationIdManager.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e;if(e[e.length-1]!=="."){e+="."}var t=(CorrelationIdManager.currentRootId++).toString(16);return CorrelationIdManager.appendSuffix(e,t,"_")}else{return CorrelationIdManager.generateRootId()}};CorrelationIdManager.getRootId=function(e){var t=e.indexOf(".");if(t<0){t=e.length}var n=e[0]==="|"?1:0;return e.substring(n,t)};CorrelationIdManager.generateRootId=function(){return"|"+r.w3cTraceId()+"."};CorrelationIdManager.appendSuffix=function(e,t,n){if(e.length+t.lengthi){for(;i>1;--i){var o=e[i-1];if(o==="."||o==="_"){break}}}if(i<=1){return CorrelationIdManager.generateRootId()}t=r.randomu32().toString(16);while(t.length<8){t="0"+t}return e.substring(0,i)+t+"#"};CorrelationIdManager.TAG="CorrelationIdManager";CorrelationIdManager.correlationIdPrefix="cid-v1:";CorrelationIdManager.w3cEnabled=false;CorrelationIdManager.pendingLookups={};CorrelationIdManager.completedLookups={};CorrelationIdManager.requestIdMaxLength=1024;CorrelationIdManager.currentRootId=r.randomu32();return CorrelationIdManager}();e.exports=o},771:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class ComparisionReport{constructor(){this.baseApkLabel="";this.targetApkLabel="";this.comparisionMetrics=[]}}t.default=ComparisionReport},790:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(ExceptionData,e);function ExceptionData(){var t=e.call(this)||this;t.ver=2;t.exceptions=[];t.properties={};t.measurements={};return t}return ExceptionData}(i);e.exports=o},799:function(e){e.exports={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found"}},802:function(e,t,n){var r=n(967),i=n(864),o=n(402);e.exports=function(e,t){var n=[],s={},a=Buffer.alloc(0),c="",u=o.FileSystem.require(),f=null,l=new i.MainHeader;if(t===o.Constants.FILE){c=e;f=u.readFileSync(c);readMainHeader()}else if(t===o.Constants.BUFFER){f=e;readMainHeader()}else{}function readEntries(){s={};n=new Array(l.diskEntries);var e=l.offset;for(var t=0;t=t;e--){if(f[e]!==80)continue;if(f.readUInt32LE(e)===o.Constants.ENDSIG){n=e;break}}if(!~n)throw o.Errors.INVALID_FORMAT;l.loadFromBinary(f.slice(n,n+o.Constants.ENDHDR));if(l.commentLength){a=f.slice(n+o.Constants.ENDHDR)}readEntries()}return{get entries(){return n},get comment(){return a.toString()},set comment(e){l.commentLength=e.length;a=e},getEntry:function(e){return s[e]||null},setEntry:function(e){n.push(e);s[e.entryName]=e;l.totalEntries=n.length},deleteEntry:function(e){var t=s[e];if(t&&t.isDirectory){var r=this;this.getEntryChildren(t).forEach(function(t){if(t.entryName!==e){r.deleteEntry(t.entryName)}})}n.splice(n.indexOf(t),1);delete s[e];l.totalEntries=n.length},getEntryChildren:function(e){if(e.isDirectory){var t=[],r=e.entryName,i=r.length;n.forEach(function(e){if(e.entryName.substr(0,i)===r){t.push(e)}});return t}return[]},compressToBuffer:function(){if(n.length>1){n.sort(function(e,t){var n=e.entryName.toLowerCase();var r=t.entryName.toLowerCase();if(nr){return 1}return 0})}var e=0,t=[],r=[],i=0;l.size=0;l.offset=0;n.forEach(function(n){var o=n.getCompressedData();n.header.offset=i;var s=n.header.dataHeaderToBinary();var a=n.rawEntryName.length;var c=n.extra.toString();var u=Buffer.alloc(a+c.length);n.rawEntryName.copy(u,0);u.fill(c,a);var f=s.length+u.length+o.length;i+=f;t.push(s);t.push(u);t.push(o);var p=n.packHeader();r.push(p);l.size+=p.length;e+=f+p.length});e+=l.mainHeaderSize;l.offset=i;i=0;var s=Buffer.alloc(e);t.forEach(function(e){e.copy(s,i);i+=e.length});r.forEach(function(e){e.copy(s,i);i+=e.length});var c=l.toBinary();if(a){a.copy(c,o.Constants.ENDHDR)}c.copy(s,i);return s},toAsyncBuffer:function(e,t,r,i){if(n.length>1){n.sort(function(e,t){var n=e.entryName.toLowerCase();var r=t.entryName.toLowerCase();if(n>r){return-1}if(n0)_process(e,i)}function _wrap(e,t){if(!e)return;var n=e;if(typeof e==="function"){n=t(e)}else if(Array.isArray(e)){n=[];for(var r=0;r32)return null;for(var i=0,o=r;i>1}setTime(+new Date);return{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return n},set flags(e){n=e},get method(){return o},set method(e){o=e},get time(){return new Date((s>>25&127)+1980,(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(s&31)<<1)},set time(e){setTime(e)},get crc(){return a},set crc(e){a=e},get compressedSize(){return c},set compressedSize(e){c=e},get size(){return u},set size(e){u=e},get fileNameLength(){return f},set fileNameLength(e){f=e},get extraLength(){return l},set extraLength(e){l=e},get commentLength(){return p},set commentLength(e){p=e},get diskNumStart(){return d},set diskNumStart(e){d=e},get inAttr(){return h},set inAttr(e){h=e},get attr(){return v},set attr(e){v=e},get offset(){return y},set offset(e){y=e},get encripted(){return(n&1)===1},get entryHeaderSize(){return i.CENHDR+f+l+p},get realDataOffset(){return y+i.LOCHDR+g.fnameLen+g.extraLen},get dataHeader(){return g},loadDataHeaderFromBinary:function(e){var t=e.slice(y,y+i.LOCHDR);if(t.readUInt32LE(0)!==i.LOCSIG){throw r.Errors.INVALID_LOC}g={version:t.readUInt16LE(i.LOCVER),flags:t.readUInt16LE(i.LOCFLG),method:t.readUInt16LE(i.LOCHOW),time:t.readUInt32LE(i.LOCTIM),crc:t.readUInt32LE(i.LOCCRC),compressedSize:t.readUInt32LE(i.LOCSIZ),size:t.readUInt32LE(i.LOCLEN),fnameLen:t.readUInt16LE(i.LOCNAM),extraLen:t.readUInt16LE(i.LOCEXT)}},loadFromBinary:function(g){if(g.length!==i.CENHDR||g.readUInt32LE(0)!==i.CENSIG){throw r.Errors.INVALID_CEN}e=g.readUInt16LE(i.CENVEM);t=g.readUInt16LE(i.CENVER);n=g.readUInt16LE(i.CENFLG);o=g.readUInt16LE(i.CENHOW);s=g.readUInt32LE(i.CENTIM);a=g.readUInt32LE(i.CENCRC);c=g.readUInt32LE(i.CENSIZ);u=g.readUInt32LE(i.CENLEN);f=g.readUInt16LE(i.CENNAM);l=g.readUInt16LE(i.CENEXT);p=g.readUInt16LE(i.CENCOM);d=g.readUInt16LE(i.CENDSK);h=g.readUInt16LE(i.CENATT);v=g.readUInt32LE(i.CENATX);y=g.readUInt32LE(i.CENOFF)},dataHeaderToBinary:function(){var e=Buffer.alloc(i.LOCHDR);e.writeUInt32LE(i.LOCSIG,0);e.writeUInt16LE(t,i.LOCVER);e.writeUInt16LE(n,i.LOCFLG);e.writeUInt16LE(o,i.LOCHOW);e.writeUInt32LE(s,i.LOCTIM);e.writeUInt32LE(a,i.LOCCRC);e.writeUInt32LE(c,i.LOCSIZ);e.writeUInt32LE(u,i.LOCLEN);e.writeUInt16LE(f,i.LOCNAM);e.writeUInt16LE(l,i.LOCEXT);return e},entryHeaderToBinary:function(){var r=Buffer.alloc(i.CENHDR+f+l+p);r.writeUInt32LE(i.CENSIG,0);r.writeUInt16LE(e,i.CENVEM);r.writeUInt16LE(t,i.CENVER);r.writeUInt16LE(n,i.CENFLG);r.writeUInt16LE(o,i.CENHOW);r.writeUInt32LE(s,i.CENTIM);r.writeInt32LE(a&65535,i.CENCRC,true);r.writeUInt32LE(c,i.CENSIZ);r.writeUInt32LE(u,i.CENLEN);r.writeUInt16LE(f,i.CENNAM);r.writeUInt16LE(l,i.CENEXT);r.writeUInt16LE(p,i.CENCOM);r.writeUInt16LE(d,i.CENDSK);r.writeUInt16LE(h,i.CENATT);r.writeUInt32LE(v,i.CENATX);r.writeUInt32LE(y,i.CENOFF);r.fill(0,i.CENHDR);return r},toString:function(){return"{\n"+'\t"made" : '+e+",\n"+'\t"version" : '+t+",\n"+'\t"flags" : '+n+",\n"+'\t"method" : '+r.methodToString(o)+",\n"+'\t"time" : '+this.time+",\n"+'\t"crc" : 0x'+a.toString(16).toUpperCase()+",\n"+'\t"compressedSize" : '+c+" bytes,\n"+'\t"size" : '+u+" bytes,\n"+'\t"fileNameLength" : '+f+",\n"+'\t"extraLength" : '+l+" bytes,\n"+'\t"commentLength" : '+p+" bytes,\n"+'\t"diskNumStart" : '+d+",\n"+'\t"inAttr" : '+h+",\n"+'\t"attr" : '+v+",\n"+'\t"offset" : '+y+",\n"+'\t"entryHeaderSize" : '+(i.CENHDR+f+l+p)+" bytes\n"+"}"}}}},902:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=[];t.subscriber=function(e){i.forEach(function(t){var n=e.data.query;var r=n.preparable&&n.preparable.text||n.plan||n.text||"unknown query";var i=!e.data.error;var o=e.data.database.host+":"+e.data.database.port;t.trackDependency({target:o,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"postgres"})})};function enable(e,n){if(e){if(i.length===0){r.channel.subscribe("postgres",t.subscriber)}i.push(n)}else{i=i.filter(function(e){return e!=n});if(i.length===0){r.channel.unsubscribe("postgres",t.subscriber)}}}t.enable=enable},916:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=i(n(208));const a=o(n(622));const c=o(n(669));const u=i(n(227));const f=i(n(571));const l=n(708);class ApkAnalyzer{analyse(e,t,n){return r(this,void 0,void 0,function*(){if(c.isUndefined(n)){n=a.join(a.dirname(e),"extracted")}const r=new s.default(e);console.log("Extracting APK file to "+n);r.extractAllTo(n,true);const i=new u.default(n);yield i.parse();const o=new l.FilesSizeCalculator;const p=new f.default;p.apkLabel=t;p.sizeMetrics["apkSize"]=o.getFileSize(e);p.sizeMetrics["arscFile"]=o.getFilesSize(i.getFiles(".arsc"));p.sizeMetrics["dexFiles"]=o.getFilesSize(i.getFiles(".dex"));p.sizeMetrics["nativeLibs"]=o.getFilesSize(i.getFiles(".so"));p.sizeMetrics["installSize"]=p.sizeMetrics["apkSize"]+p.sizeMetrics["dexFiles"];return p})}}t.default=ApkAnalyzer},919:function(e){"use strict";var t=function(){function ExceptionDetails(){this.hasFullStack=true;this.parsedStack=[]}return ExceptionDetails}();e.exports=t},925:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function contextPreservingConnect(){var e=t.apply(this,arguments);var n=this.s.pool.write;this.s.pool.write=function contextPreservingWrite(){var e=typeof arguments[1]==="function"?1:2;if(typeof arguments[e]==="function"){arguments[e]=r.channel.bindToContext(arguments[e])}return n.apply(this,arguments)};var i=this.s.pool.logout;this.s.pool.logout=function contextPreservingLogout(){if(typeof arguments[1]==="function"){arguments[1]=r.channel.bindToContext(arguments[1])}return i.apply(this,arguments)};return e};return e};t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:i};function enable(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}t.enable=enable},928:function(e){"use strict";var t=function(){function RequestParser(){}RequestParser.prototype.getUrl=function(){return this.url};RequestParser.prototype.RequestParser=function(){this.startTime=+new Date};RequestParser.prototype._setStatus=function(e,t){var n=+new Date;this.duration=n-this.startTime;this.statusCode=e;var r=this.properties||{};if(t){if(typeof t==="string"){r["error"]=t}else if(t instanceof Error){r["error"]=t.message}else if(typeof t==="object"){for(var i in t){r[i]=t[i]&&t[i].toString&&t[i].toString()}}}this.properties=r};RequestParser.prototype._isSuccess=function(){return 00)c=l.pop();v=undefined;return n&&!f};d=function asyncWrap(e,t,n){var r=[];f=true;for(var a=0;a0){t[i].before(this,r[t[i].uid])}}f=false;var a=e.apply(this,arguments);f=true;for(i=0;i0){t[i].after(this,r[t[i].uid])}}f=false;c=l.pop();v=undefined;return a}};r(process,"_fatalException",function(e){return function _asyncFatalException(t){return p(t)||e(t)}})}else{var y=false;p=function uncaughtCatcher(e){if(y)throw e;var t=false;var n=c.length;for(var r=0;r0){t[d].before(this,r[t[d].uid])}}f=false;var h;try{h=e.apply(this,arguments)}catch(e){i=true;for(var d=0;d0){t[d].after(this,r[t[d].uid])}}f=false}c=l.pop()}return h}};process.addListener("uncaughtException",p)}function simpleWrap(e,t,n){f=true;for(var r=0;r0)return d(e,n,t)}return simpleWrap(e,n,t)}function AsyncListener(e,t){if(typeof e.create==="function"){this.create=e.create;this.flags|=i}if(typeof e.before==="function"){this.before=e.before;this.flags|=o}if(typeof e.after==="function"){this.after=e.after;this.flags|=s}if(typeof e.error==="function"){this.error=e.error;this.flags|=a}this.uid=++u;this.data=t===undefined?null:t}AsyncListener.prototype.create=undefined;AsyncListener.prototype.before=undefined;AsyncListener.prototype.after=undefined;AsyncListener.prototype.error=undefined;AsyncListener.prototype.data=undefined;AsyncListener.prototype.uid=0;AsyncListener.prototype.flags=0;function createAsyncListener(e,t){if(typeof e!=="object"||!e){throw new TypeError("callbacks argument must be an object")}if(e instanceof AsyncListener){return e}else{return new AsyncListener(e,t)}}function addAsyncListener(e,t){var n;if(!(e instanceof AsyncListener)){n=createAsyncListener(e,t)}else{n=e}var r=false;for(var i=0;i0){return t[0]}return""};HttpRequestParser.keys=new o.ContextTagKeys;return HttpRequestParser}(c);e.exports=p},937:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=n(614);function postgres6PatchFunction(e,t){var n=e.Client.prototype.query;var o="__diagnosticOriginalFunc";e.Client.prototype.query=function query(e,t,s){var a={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0};var c=process.hrtime();var u;function patchCallback(e){if(e&&e[o]){e=e[o]}var t=r.channel.bindToContext(function(t,n){var o=process.hrtime(c);a.result=n&&{rowCount:n.rowCount,command:n.command};a.error=t;a.duration=Math.ceil(o[0]*1e3+o[1]/1e6);r.channel.publish("postgres",a);if(t){if(e){return e.apply(this,arguments)}else if(u&&u instanceof i.EventEmitter){u.emit("error",t)}}else if(e){e.apply(this,arguments)}});try{Object.defineProperty(t,o,{value:e});return t}catch(t){return e}}try{if(typeof e==="string"){if(t instanceof Array){a.query.preparable={text:e,args:t};s=patchCallback(s)}else{a.query.text=e;if(s){s=patchCallback(s)}else{t=patchCallback(t)}}}else{if(typeof e.name==="string"){a.query.plan=e.name}else if(e.values instanceof Array){a.query.preparable={text:e.text,args:e.values}}else{a.query.text=e.text}if(s){s=patchCallback(s)}else if(t){t=patchCallback(t)}else{e.callback=patchCallback(e.callback)}}}catch(e){return n.apply(this,arguments)}arguments[0]=e;arguments[1]=t;arguments[2]=s;arguments.length=arguments.length>3?arguments.length:3;u=n.apply(this,arguments);return u};return e}function postgres7PatchFunction(e,t){var n=e.Client.prototype.query;var o="__diagnosticOriginalFunc";e.Client.prototype.query=function query(e,t,s){var a=this;var c=!!s;var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0};var f=process.hrtime();var l;function patchCallback(e){if(e&&e[o]){e=e[o]}var t=r.channel.bindToContext(function(t,n){var o=process.hrtime(f);u.result=n&&{rowCount:n.rowCount,command:n.command};u.error=t;u.duration=Math.ceil(o[0]*1e3+o[1]/1e6);r.channel.publish("postgres",u);if(t){if(e){return e.apply(this,arguments)}else if(l&&l instanceof i.EventEmitter){l.emit("error",t)}}else if(e){e.apply(this,arguments)}});try{Object.defineProperty(t,o,{value:e});return t}catch(t){return e}}try{if(typeof e==="string"){if(t instanceof Array){u.query.preparable={text:e,args:t};c=typeof s==="function";s=s?patchCallback(s):s}else{u.query.text=e;if(s){c=typeof s==="function";s=c?patchCallback(s):s}else{c=typeof t==="function";t=c?patchCallback(t):t}}}else{if(typeof e.name==="string"){u.query.plan=e.name}else if(e.values instanceof Array){u.query.preparable={text:e.text,args:e.values}}else{u.query.text=e.text}if(s){c=typeof s==="function";s=patchCallback(s)}else if(t){c=typeof t==="function";t=c?patchCallback(t):t}else{c=typeof e.callback==="function";e.callback=c?patchCallback(e.callback):e.callback}}}catch(e){return n.apply(this,arguments)}arguments[0]=e;arguments[1]=t;arguments[2]=s;arguments.length=arguments.length>3?arguments.length:3;l=n.apply(this,arguments);if(!c){return l.then(function(e){patchCallback()(undefined,e);return new a._Promise(function(t,n){t(e)})}).catch(function(e){patchCallback()(e,undefined);return new a._Promise(function(t,n){n(e)})})}return l};return e}t.postgres6={versionSpecifier:"6.*",patch:postgres6PatchFunction};t.postgres7={versionSpecifier:"7.*",patch:postgres7PatchFunction};function enable(){r.channel.registerMonkeyPatch("pg",t.postgres6);r.channel.registerMonkeyPatch("pg",t.postgres7)}t.enable=enable},941:function(e,t,n){"use strict";var r=n(221);"use strict";var i=function(){function DataPoint(){this.kind=r.Measurement}return DataPoint}();e.exports=i},942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=function(e){var t=e.prototype._emit;e.prototype._emit=function(e,n){var i=t.apply(this,arguments);if(!n){var o=i;if(!o){o=t.call(this,e,true)}r.channel.publish("bunyan",{level:e.level,result:o})}return i};return e};t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:i};function enable(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}t.enable=enable},944:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=n(622);var o=function(e,t){var n=function(e,t){return function(t,n){var i=e[t];if(i){e[t]=function mysqlContextPreserver(){var e=arguments.length-1;for(var t=arguments.length-1;t>=0;--t){if(typeof arguments[t]==="function"){e=t;break}else if(typeof arguments[t]!=="undefined"){break}}var o=arguments[e];var s={result:null,startTime:null};if(typeof o==="function"){if(n){s.startTime=process.hrtime();arguments[e]=r.channel.bindToContext(n(s,o))}else{arguments[e]=r.channel.bindToContext(o)}}var a=i.apply(this,arguments);s.result=a;return a}}}};var o=function(e,t){return n(e.prototype,t+".prototype")};var s=["connect","changeUser","ping","statistics","end"];var a=require(i.dirname(t)+"/lib/Connection");s.forEach(function(e){return o(a,"Connection")(e)});n(a,"Connection")("createQuery",function(e,t){return function(n){var i=process.hrtime(e.startTime);var o=i[0]*1e3+i[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:o});t.apply(this,arguments)}});var c=["_enqueueCallback"];var u=require(i.dirname(t)+"/lib/Pool");c.forEach(function(e){return o(u,"Pool")(e)});return e};t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:o};function enable(){r.channel.registerMonkeyPatch("mysql",t.mysql)}t.enable=enable},950:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(RequestData,e);function RequestData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return RequestData}(i);e.exports=o},953:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(EventData,e);function EventData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return EventData}(i);e.exports=o},967:function(e,t,n){var r=n(402),i=n(864),o=r.Constants,s=n(818);e.exports=function(e){var t=new i.EntryHeader,n=Buffer.alloc(0),a=Buffer.alloc(0),c=false,u=null,f=Buffer.alloc(0);function getCompressedDataFromZip(){if(!e||!Buffer.isBuffer(e)){return Buffer.alloc(0)}t.loadDataHeaderFromBinary(e);return e.slice(t.realDataOffset,t.realDataOffset+t.compressedSize)}function crc32OK(e){if((t.flags&8)!==8){if(r.crc32(e)!==t.dataHeader.crc){return false}}else{}return true}function decompress(e,i,o){if(typeof i==="undefined"&&typeof e==="string"){o=e;e=void 0}if(c){if(e&&i){i(Buffer.alloc(0),r.Errors.DIRECTORY_CONTENT_ERROR)}return Buffer.alloc(0)}var a=getCompressedDataFromZip();if(a.length===0){if(e&&i)i(a,r.Errors.NO_DATA);return a}var u=Buffer.alloc(t.size);switch(t.method){case r.Constants.STORED:a.copy(u);if(!crc32OK(u)){if(e&&i)i(u,r.Errors.BAD_CRC);return r.Errors.BAD_CRC}else{if(e&&i)i(u);return u}case r.Constants.DEFLATED:var f=new s.Inflater(a);if(!e){var l=f.inflate(u);l.copy(u,0);if(!crc32OK(u)){console.warn(r.Errors.BAD_CRC+" "+n.toString())}return u}else{f.inflateAsync(function(e){e.copy(u,0);if(!crc32OK(u)){if(i)i(u,r.Errors.BAD_CRC)}else{if(i)i(u)}})}break;default:if(e&&i)i(Buffer.alloc(0),r.Errors.UNKNOWN_METHOD);return r.Errors.UNKNOWN_METHOD}}function compress(n,i){if((!u||!u.length)&&Buffer.isBuffer(e)){if(n&&i)i(getCompressedDataFromZip());return getCompressedDataFromZip()}if(u.length&&!c){var o;switch(t.method){case r.Constants.STORED:t.compressedSize=t.size;o=Buffer.alloc(u.length);u.copy(o);if(n&&i)i(o);return o;default:case r.Constants.DEFLATED:var a=new s.Deflater(u);if(!n){var f=a.deflate();t.compressedSize=f.length;return f}else{a.deflateAsync(function(e){o=Buffer.alloc(e.length);t.compressedSize=e.length;e.copy(o);i&&i(o)})}a=null;break}}else{if(n&&i){i(Buffer.alloc(0))}else{return Buffer.alloc(0)}}}function readUInt64LE(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}function parseExtra(e){var t=0;var n,r,i;while(t=o.EF_ZIP64_SCOMP){n=readUInt64LE(e,o.EF_ZIP64_SUNCOMP);if(t.size===o.EF_ZIP64_OR_32){t.size=n}}if(e.length>=o.EF_ZIP64_RHO){r=readUInt64LE(e,o.EF_ZIP64_SCOMP);if(t.compressedSize===o.EF_ZIP64_OR_32){t.compressedSize=r}}if(e.length>=o.EF_ZIP64_DSN){i=readUInt64LE(e,o.EF_ZIP64_RHO);if(t.offset===o.EF_ZIP64_OR_32){t.offset=i}}if(e.length>=o.EF_ZIP64_DSN+4){s=e.readUInt32LE(o.EF_ZIP64_DSN);if(t.diskNumStart===o.EF_ZIP64_OR_16){t.diskNumStart=s}}}return{get entryName(){return n.toString()},get rawEntryName(){return n},set entryName(e){n=r.toBuffer(e);var i=n[n.length-1];c=i===47||i===92;t.fileNameLength=n.length},get extra(){return f},set extra(e){f=e;t.extraLength=e.length;parseExtra(e)},get comment(){return a.toString()},set comment(e){a=r.toBuffer(e);t.commentLength=a.length},get name(){var e=n.toString();return c?e.substr(e.length-1).split("/").pop():e.split("/").pop()},get isDirectory(){return c},getCompressedData:function(){return compress(false,null)},getCompressedDataAsync:function(e){compress(true,e)},setData:function(e){u=r.toBuffer(e);if(!c&&u.length){t.size=u.length;t.method=r.Constants.DEFLATED;t.crc=r.crc32(e);t.changed=true}else{t.method=r.Constants.STORED}},getData:function(e){if(t.changed){return u}else{return decompress(false,null,e)}},getDataAsync:function(e,n){if(t.changed){e(u)}else{decompress(true,e,n)}},set attr(e){t.attr=e},get attr(){return t.attr},set header(e){t.loadFromBinary(e)},get header(){return t},packHeader:function(){var e=t.entryHeaderToBinary();n.copy(e,r.Constants.CENHDR);if(t.extraLength){f.copy(e,r.Constants.CENHDR+n.length)}if(t.commentLength){a.copy(e,r.Constants.CENHDR+n.length+t.extraLength,a.length)}return e},toString:function(){return"{\n"+'\t"entryName" : "'+n.toString()+'",\n'+'\t"name" : "'+(c?n.toString().replace(/\/$/,"").split("/").pop():n.toString().split("/").pop())+'",\n'+'\t"comment" : "'+a.toString()+'",\n'+'\t"isDirectory" : '+c+",\n"+'\t"header" : '+t.toString().replace(/\t/gm,"\t\t").replace(/}/gm,"\t}")+",\n"+'\t"compressedData" : <'+(e&&e.length+" bytes buffer"||"null")+">\n"+'\t"data" : <'+(u&&u.length+" bytes buffer"||"null")+">\n"+"}"}}}},970:function(e){"use strict";var t=function(){function Logging(){}Logging.info=function(e){var t=[];for(var n=1;n0){e+=" ";for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const n=this.properties[t];if(n){e+=`${t}=${escape(`${n||""}`)},`}}}}e+=i;const t=`${this.message||""}`;e+=escapeData(t);return e}}function escapeData(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escape(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/]/g,"%5D").replace(/;/g,"%3B")}}}); \ No newline at end of file +module.exports=function(e,t){"use strict";var n={};function __webpack_require__(t){if(n[t]){return n[t].exports}var r=n[t]={i:t,l:false,exports:{}};e[t].call(r.exports,r,r.exports,__webpack_require__);r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(860)}return startup()}({4:function(e,t,n){e.exports=function(e){var t=n(761);var r={chunkSize:(parseInt(e.length/1024)+1)*1024};return{deflate:function(){return t.deflateRawSync(e,r)},deflateAsync:function(n){var i=t.createDeflateRaw(r),o=[],s=0;i.on("data",function(e){o.push(e);s+=e.length});i.on("end",function(){var e=Buffer.alloc(s),t=0;e.fill(0);for(var r=0;r0?t:null,InstrumentationKey:n.instrumentationKey||"",Metrics:e.length>0?e:null,InvariantVersion:1,Timestamp:"/Date("+Date.now()+")/",Version:r.tags[r.keys.internalSdkVersion],StreamId:u,MachineName:o,Instance:s};return a};QuickPulseEnvelopeFactory.createQuickPulseMetric=function(e){var t;t={Name:e.name,Value:e.value,Weight:e.count||1};return t};QuickPulseEnvelopeFactory.telemetryEnvelopeToQuickPulseDocument=function(e){switch(e.data.baseType){case o.TelemetryTypeString.Event:return QuickPulseEnvelopeFactory.createQuickPulseEventDocument(e);case o.TelemetryTypeString.Exception:return QuickPulseEnvelopeFactory.createQuickPulseExceptionDocument(e);case o.TelemetryTypeString.Trace:return QuickPulseEnvelopeFactory.createQuickPulseTraceDocument(e);case o.TelemetryTypeString.Dependency:return QuickPulseEnvelopeFactory.createQuickPulseDependencyDocument(e);case o.TelemetryTypeString.Request:return QuickPulseEnvelopeFactory.createQuickPulseRequestDocument(e)}return null};QuickPulseEnvelopeFactory.createQuickPulseEventDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.name;var i=r({},t,{Name:n});return i};QuickPulseEnvelopeFactory.createQuickPulseTraceDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.severityLevel||0;var i=r({},t,{Message:e.data.baseData.message,SeverityLevel:o.SeverityLevel[n]});return i};QuickPulseEnvelopeFactory.createQuickPulseExceptionDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData.exceptions;var i="";var o="";var s="";if(n&&n.length>0){if(n[0].parsedStack&&n[0].parsedStack.length>0){n[0].parsedStack.forEach(function(e){i+=e.assembly+"\n"})}else if(n[0].stack&&n[0].stack.length>0){i=n[0].stack}o=n[0].message;s=n[0].typeName}var a=r({},t,{Exception:i,ExceptionMessage:o,ExceptionType:s});return a};QuickPulseEnvelopeFactory.createQuickPulseRequestDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData;var i=r({},t,{Name:n.name,Success:n.success,Duration:n.duration,ResponseCode:n.responseCode,OperationName:n.name});return i};QuickPulseEnvelopeFactory.createQuickPulseDependencyDocument=function(e){var t=QuickPulseEnvelopeFactory.createQuickPulseDocument(e);var n=e.data.baseData;var i=r({},t,{Name:n.name,Target:n.target,Success:n.success,Duration:n.duration,ResultCode:n.resultCode,CommandName:n.data,OperationName:t.OperationId,DependencyTypeName:n.type});return i};QuickPulseEnvelopeFactory.createQuickPulseDocument=function(e){var t;var n;var r,i;if(e.data.baseType){n=s.TelemetryTypeStringToQuickPulseType[e.data.baseType];t=s.TelemetryTypeStringToQuickPulseDocumentType[e.data.baseType]}else{c.warn("Document type invalid; not sending live metric document",e.data.baseType)}r=e.tags[QuickPulseEnvelopeFactory.keys.operationId];i=QuickPulseEnvelopeFactory.aggregateProperties(e);var o={DocumentType:t,__type:n,OperationId:r,Version:"1.0",Properties:i};return o};QuickPulseEnvelopeFactory.aggregateProperties=function(e){var t=[];var n=e.data.baseData.measurements||{};for(var r in n){if(n.hasOwnProperty(r)){var i=n[r];var o={key:r,value:i};t.push(o)}}var s=e.data.baseData.properties||{};for(var r in s){if(s.hasOwnProperty(r)){var i=s[r];var o={key:r,value:i};t.push(o)}}return t};QuickPulseEnvelopeFactory.keys=new o.ContextTagKeys;return QuickPulseEnvelopeFactory}();e.exports=f},14:function(e,t,n){"use strict";var r=n(179);var i=n(769);var o=function(){function Traceparent(e,t){this.traceFlag=Traceparent.DEFAULT_TRACE_FLAG;this.version=Traceparent.DEFAULT_VERSION;if(e&&typeof e==="string"){if(e.split(",").length>1){this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}else{var n=e.trim().split("-");var o=n.length;if(o>=4){this.version=n[0];this.traceId=n[1];this.spanId=n[2];this.traceFlag=n[3]}else{this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(!this.version.match(/^[0-9a-f]{2}$/g)){this.version=Traceparent.DEFAULT_VERSION;this.traceId=r.w3cTraceId()}if(this.version==="00"&&o!==4){this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(this.version==="ff"){this.version=Traceparent.DEFAULT_VERSION;this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}if(!this.version.match(/^0[0-9a-f]$/g)){this.version=Traceparent.DEFAULT_VERSION}if(!this.traceFlag.match(/^[0-9a-f]{2}$/g)){this.traceFlag=Traceparent.DEFAULT_TRACE_FLAG;this.traceId=r.w3cTraceId()}if(!Traceparent.isValidTraceId(this.traceId)){this.traceId=r.w3cTraceId()}if(!Traceparent.isValidSpanId(this.spanId)){this.spanId=r.w3cTraceId().substr(0,16);this.traceId=r.w3cTraceId()}this.parentId=this.getBackCompatRequestId()}}else if(t){this.parentId=t.slice();var s=i.getRootId(t);if(!Traceparent.isValidTraceId(s)){this.legacyRootId=s;s=r.w3cTraceId()}if(t.indexOf("|")!==-1){t=t.substring(1+t.substring(0,t.length-1).lastIndexOf("."),t.length-1)}this.traceId=s;this.spanId=t}else{this.traceId=r.w3cTraceId();this.spanId=r.w3cTraceId().substr(0,16)}}Traceparent.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&e!=="00000000000000000000000000000000"};Traceparent.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&e!=="0000000000000000"};Traceparent.prototype.getBackCompatRequestId=function(){return"|"+this.traceId+"."+this.spanId+"."};Traceparent.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag};Traceparent.prototype.updateSpanId=function(){this.spanId=r.w3cTraceId().substr(0,16)};Traceparent.DEFAULT_TRACE_FLAG="01";Traceparent.DEFAULT_VERSION="00";return Traceparent}();e.exports=o},26:function(e,t,n){var r=n(519).require(),i=n(622);r.existsSync=r.existsSync||i.existsSync;e.exports=function(){var e=[],t=n(589),o=n(799),s=i.sep;function mkdirSync(e){var t=e.split(s)[0];e.split(s).forEach(function(e){if(!e||e.substr(-1,1)===":")return;t+=s+e;var n;try{n=r.statSync(t)}catch(e){r.mkdirSync(t)}if(n&&n.isFile())throw o.FILE_IN_THE_WAY.replace("%s",t)})}function findSync(e,t,n){if(typeof t==="boolean"){n=t;t=undefined}var o=[];r.readdirSync(e).forEach(function(a){var c=i.join(e,a);if(r.statSync(c).isDirectory()&&n)o=o.concat(findSync(c,t,n));if(!t||t.test(c)){o.push(i.normalize(c)+(r.statSync(c).isDirectory()?s:""))}});return o}return{makeDir:function(e){mkdirSync(e)},crc32:function(t){if(typeof t==="string"){t=Buffer.alloc(t.length,t)}var n=Buffer.alloc(4);if(!e.length){for(var r=0;r<256;r++){var i=r;for(var o=8;--o>=0;)if((i&1)!==0){i=3988292384^i>>>1}else{i=i>>>1}if(i<0){n.writeInt32LE(i,0);i=n.readUInt32LE(0)}e[r]=i}}var s=0,a=0,c=t.length,u=~s;while(--c>=0)u=e[(u^t[a++])&255]^u>>>8;s=~u;n.writeInt32LE(s&4294967295,0);return n.readUInt32LE(0)},methodToString:function(e){switch(e){case t.STORED:return"STORED ("+e+")";case t.DEFLATED:return"DEFLATED ("+e+")";default:return"UNSUPPORTED ("+e+")"}},writeFileTo:function(e,t,n,o){if(r.existsSync(e)){if(!n)return false;var s=r.statSync(e);if(s.isDirectory()){return false}}var a=i.dirname(e);if(!r.existsSync(a)){mkdirSync(a)}var c;try{c=r.openSync(e,"w",438)}catch(t){r.chmodSync(e,438);c=r.openSync(e,"w",438)}if(c){try{r.writeSync(c,t,0,t.length,0)}catch(e){throw e}finally{r.closeSync(c)}}r.chmodSync(e,o||438);return true},writeFileToAsync:function(e,t,n,o,s){if(typeof o==="function"){s=o;o=undefined}r.exists(e,function(a){if(a&&!n)return s(false);r.stat(e,function(n,c){if(a&&c.isDirectory()){return s(false)}var u=i.dirname(e);r.exists(u,function(n){if(!n)mkdirSync(u);r.open(e,"w",438,function(n,i){if(n){r.chmod(e,438,function(){r.open(e,"w",438,function(n,i){r.write(i,t,0,t.length,0,function(){r.close(i,function(){r.chmod(e,o||438,function(){s(true)})})})})})}else{if(i){r.write(i,t,0,t.length,0,function(){r.close(i,function(){r.chmod(e,o||438,function(){s(true)})})})}else{r.chmod(e,o||438,function(){s(true)})}}})})})})},findFiles:function(e){return findSync(e,true)},getAttributes:function(e){},setAttributes:function(e){},toBuffer:function(e){if(Buffer.isBuffer(e)){return e}else{if(e.length===0){return Buffer.alloc(0)}return Buffer.from(e,"utf8")}},Constants:t,Errors:o}}()},29:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(287);var i=n(716);var o=n(513);var s=n(466);var a=n(366);var c=n(459);var u=n(769);var f=n(970);var l=n(733);var p=n(111);t.TelemetryClient=n(503);t.Contracts=n(367);var d;(function(e){e[e["AI"]=0]="AI";e[e["AI_AND_W3C"]=1]="AI_AND_W3C"})(d=t.DistributedTracingModes||(t.DistributedTracingModes={}));var h=true;var v=false;var y=true;var g=true;var m=true;var C=true;var E=true;var _=true;var T;var I=false;var w=true;var S;var A=undefined;var b=undefined;var N;var D;var x;var R;var P;var O;var L=false;var k;function setup(e){if(!t.defaultClient){t.defaultClient=new t.TelemetryClient(e);N=new i(t.defaultClient);D=new o(t.defaultClient);x=new s(t.defaultClient);P=new c(t.defaultClient);O=new a(t.defaultClient);if(!R){R=new p.AutoCollectNativePerformance(t.defaultClient)}}else{f.info("The default client is already setup")}if(t.defaultClient&&t.defaultClient.channel){t.defaultClient.channel.setUseDiskRetryCaching(E,A,b)}return F}t.setup=setup;function start(){if(!!t.defaultClient){L=true;N.enable(h,v);D.enable(y);x.enable(g);R.enable(w,S);P.useAutoCorrelation(_,T);P.enable(m);O.enable(C);if(t.liveMetricsClient&&I){t.liveMetricsClient.enable(I)}}else{f.warn("Start cannot be called before setup")}return F}t.start=start;function getCorrelationContext(){if(_){return r.CorrelationContextManager.getCurrentContext()}return null}t.getCorrelationContext=getCorrelationContext;function wrapWithCorrelationContext(e){return r.CorrelationContextManager.wrapCallback(e)}t.wrapWithCorrelationContext=wrapWithCorrelationContext;var F=function(){function Configuration(){}Configuration.setDistributedTracingMode=function(e){u.w3cEnabled=e===d.AI_AND_W3C;return Configuration};Configuration.setAutoCollectConsole=function(e,t){if(t===void 0){t=false}h=e;v=t;if(L){N.enable(e,t)}return Configuration};Configuration.setAutoCollectExceptions=function(e){y=e;if(L){D.enable(e)}return Configuration};Configuration.setAutoCollectPerformance=function(e,t){if(t===void 0){t=true}g=e;var n=p.AutoCollectNativePerformance.parseEnabled(t);w=n.isEnabled;S=n.disabledMetrics;if(L){x.enable(e);R.enable(n.isEnabled,n.disabledMetrics)}return Configuration};Configuration.setAutoCollectRequests=function(e){m=e;if(L){P.enable(e)}return Configuration};Configuration.setAutoCollectDependencies=function(e){C=e;if(L){O.enable(e)}return Configuration};Configuration.setAutoDependencyCorrelation=function(e,t){_=e;T=t;if(L){P.useAutoCorrelation(e,t)}return Configuration};Configuration.setUseDiskRetryCaching=function(e,n,r){E=e;A=n;b=r;if(t.defaultClient&&t.defaultClient.channel){t.defaultClient.channel.setUseDiskRetryCaching(e,n,r)}return Configuration};Configuration.setInternalLogging=function(e,t){if(e===void 0){e=false}if(t===void 0){t=true}f.enableDebug=e;f.disableWarnings=!t;return Configuration};Configuration.setSendLiveMetrics=function(e){if(e===void 0){e=false}if(!t.defaultClient){f.warn("Live metrics client cannot be setup without the default client");return Configuration}if(!t.liveMetricsClient){t.liveMetricsClient=new l(t.defaultClient.config.instrumentationKey);k=new s(t.liveMetricsClient,1e3,true);t.liveMetricsClient.addCollector(k);t.defaultClient.quickPulseClient=t.liveMetricsClient;I=e}else{t.liveMetricsClient.enable(e)}return Configuration};Configuration.start=start;return Configuration}();t.Configuration=F;function dispose(){t.defaultClient=null;L=false;if(N){N.dispose()}if(D){D.dispose()}if(x){x.dispose()}if(R){R.dispose()}if(P){P.dispose()}if(O){O.dispose()}}t.dispose=dispose},33:function(e){"use strict";var t;(function(e){e[e["Verbose"]=0]="Verbose";e[e["Information"]=1]="Information";e[e["Warning"]=2]="Warning";e[e["Error"]=3]="Error";e[e["Critical"]=4]="Critical"})(t||(t={}));e.exports=t},36:function(e){"use strict";e.exports=((e,t)=>{return class WrappedPromise extends e{constructor(e){var n,r;super(wrappedExecutor);var i=this;try{e.apply(n,r)}catch(e){r[1](e)}return i;function wrappedExecutor(e,o){n=this;r=[wrappedResolve,wrappedReject];function wrappedResolve(n){t(i,false);return e(n)}function wrappedReject(e){t(i,false);return o(e)}}}}})},37:function(e){"use strict";function PromiseWrap(){}e.exports=function patchPromise(){const e=this._hooks;const t=this._state;const n=global.Promise;const r=n.prototype.then;n.prototype.then=wrappedThen;function makeWrappedHandler(t,n,r,i){if("function"!==typeof t){return i?makeUnhandledResolutionHandler(r):makeUnhandledRejectionHandler(r)}return function wrappedHandler(){e.pre.call(n,r);try{return t.apply(this,arguments)}finally{e.post.call(n,r,false);e.destroy.call(null,r)}}}function makeUnhandledResolutionHandler(t){return function unhandledResolutionHandler(n){e.destroy.call(null,t);return n}}function makeUnhandledRejectionHandler(t){return function unhandledRejectedHandler(n){e.destroy.call(null,t);throw n}}function wrappedThen(n,i){if(!t.enabled)return r.call(this,n,i);const o=new PromiseWrap;const s=--t.counter;e.init.call(o,s,0,null,null);return r.call(this,makeWrappedHandler(n,o,s,true),makeWrappedHandler(i,o,s,false))}}},39:function(e,t,n){"use strict";var r=n(769);var i=n(753);var o=n(701);var s=n(835);var a=function(){function Config(e){var t=this;this.endpointBase=o.DEFAULT_BREEZE_ENDPOINT;var n=process.env[Config.ENV_connectionString];var r=i.parse(e);var a=i.parse(n);var c=!r.instrumentationkey&&Object.keys(r).length>0?null:e;this.instrumentationKey=r.instrumentationkey||c||a.instrumentationkey||Config._getInstrumentationKey();this.endpointUrl=(r.ingestionendpoint||a.ingestionendpoint||this.endpointBase)+"/v2/track";this.maxBatchSize=250;this.maxBatchIntervalMs=15e3;this.disableAppInsights=false;this.samplingPercentage=100;this.correlationIdRetryIntervalMs=30*1e3;this.correlationHeaderExcludedDomains=["*.core.windows.net","*.core.chinacloudapi.cn","*.core.cloudapi.de","*.core.usgovcloudapi.net"];this.setCorrelationId=function(e){return t.correlationId=e};this.profileQueryEndpoint=r.ingestionendpoint||a.ingestionendpoint||process.env[Config.ENV_profileQueryEndpoint]||this.endpointBase;this.proxyHttpUrl=process.env[Config.ENV_http_proxy]||undefined;this.proxyHttpsUrl=process.env[Config.ENV_https_proxy]||undefined;this.httpAgent=undefined;this.httpsAgent=undefined;this._quickPulseHost=r.liveendpoint||a.liveendpoint||process.env[Config.ENV_quickPulseHost]||o.DEFAULT_LIVEMETRICS_HOST;if(this._quickPulseHost.match(/^https?:\/\//)){this._quickPulseHost=s.parse(this._quickPulseHost).host}}Object.defineProperty(Config.prototype,"profileQueryEndpoint",{get:function(){return this._profileQueryEndpoint},set:function(e){r.cancelCorrelationIdQuery(this,this.setCorrelationId);this._profileQueryEndpoint=e;this.correlationId=r.correlationIdPrefix;r.queryCorrelationId(this,this.setCorrelationId)},enumerable:true,configurable:true});Object.defineProperty(Config.prototype,"quickPulseHost",{get:function(){return this._quickPulseHost},set:function(e){this._quickPulseHost=e},enumerable:true,configurable:true});Config._getInstrumentationKey=function(){var e=process.env[Config.ENV_iKey]||process.env[Config.ENV_azurePrefix+Config.ENV_iKey]||process.env[Config.legacy_ENV_iKey]||process.env[Config.ENV_azurePrefix+Config.legacy_ENV_iKey];if(!e||e==""){throw new Error("Instrumentation key not found, pass the key in the config to this method or set the key in the environment variable APPINSIGHTS_INSTRUMENTATIONKEY before starting the server")}return e};Config.ENV_azurePrefix="APPSETTING_";Config.ENV_iKey="APPINSIGHTS_INSTRUMENTATIONKEY";Config.legacy_ENV_iKey="APPINSIGHTS_INSTRUMENTATION_KEY";Config.ENV_profileQueryEndpoint="APPINSIGHTS_PROFILE_QUERY_ENDPOINT";Config.ENV_quickPulseHost="APPINSIGHTS_QUICKPULSE_HOST";Config.ENV_connectionString="APPLICATIONINSIGHTS_CONNECTION_STRING";Config.ENV_nativeMetricsDisablers="APPLICATION_INSIGHTS_DISABLE_EXTENDED_METRIC";Config.ENV_nativeMetricsDisableAll="APPLICATION_INSIGHTS_DISABLE_ALL_EXTENDED_METRICS";Config.ENV_http_proxy="http_proxy";Config.ENV_https_proxy="https_proxy";return Config}();e.exports=a},54:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(953);"use strict";var o=function(e){r(PageViewData,e);function PageViewData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return PageViewData}(i);e.exports=o},82:function(e){e.exports=require("console")},87:function(e){e.exports=require("os")},105:function(e,t){t=e.exports=SemVer;var n;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){n=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{n=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var r=256;var i=Number.MAX_SAFE_INTEGER||9007199254740991;var o=16;var s=t.re=[];var a=t.src=[];var c=0;var u=c++;a[u]="0|[1-9]\\d*";var f=c++;a[f]="[0-9]+";var l=c++;a[l]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var p=c++;a[p]="("+a[u]+")\\."+"("+a[u]+")\\."+"("+a[u]+")";var d=c++;a[d]="("+a[f]+")\\."+"("+a[f]+")\\."+"("+a[f]+")";var h=c++;a[h]="(?:"+a[u]+"|"+a[l]+")";var v=c++;a[v]="(?:"+a[f]+"|"+a[l]+")";var y=c++;a[y]="(?:-("+a[h]+"(?:\\."+a[h]+")*))";var g=c++;a[g]="(?:-?("+a[v]+"(?:\\."+a[v]+")*))";var m=c++;a[m]="[0-9A-Za-z-]+";var C=c++;a[C]="(?:\\+("+a[m]+"(?:\\."+a[m]+")*))";var E=c++;var _="v?"+a[p]+a[y]+"?"+a[C]+"?";a[E]="^"+_+"$";var T="[v=\\s]*"+a[d]+a[g]+"?"+a[C]+"?";var I=c++;a[I]="^"+T+"$";var w=c++;a[w]="((?:<|>)?=?)";var S=c++;a[S]=a[f]+"|x|X|\\*";var A=c++;a[A]=a[u]+"|x|X|\\*";var b=c++;a[b]="[v=\\s]*("+a[A]+")"+"(?:\\.("+a[A]+")"+"(?:\\.("+a[A]+")"+"(?:"+a[y]+")?"+a[C]+"?"+")?)?";var N=c++;a[N]="[v=\\s]*("+a[S]+")"+"(?:\\.("+a[S]+")"+"(?:\\.("+a[S]+")"+"(?:"+a[g]+")?"+a[C]+"?"+")?)?";var D=c++;a[D]="^"+a[w]+"\\s*"+a[b]+"$";var x=c++;a[x]="^"+a[w]+"\\s*"+a[N]+"$";var R=c++;a[R]="(?:^|[^\\d])"+"(\\d{1,"+o+"})"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:\\.(\\d{1,"+o+"}))?"+"(?:$|[^\\d])";var P=c++;a[P]="(?:~>?)";var O=c++;a[O]="(\\s*)"+a[P]+"\\s+";s[O]=new RegExp(a[O],"g");var L="$1~";var k=c++;a[k]="^"+a[P]+a[b]+"$";var F=c++;a[F]="^"+a[P]+a[N]+"$";var q=c++;a[q]="(?:\\^)";var H=c++;a[H]="(\\s*)"+a[q]+"\\s+";s[H]=new RegExp(a[H],"g");var j="$1^";var M=c++;a[M]="^"+a[q]+a[b]+"$";var U=c++;a[U]="^"+a[q]+a[N]+"$";var V=c++;a[V]="^"+a[w]+"\\s*("+T+")$|^$";var B=c++;a[B]="^"+a[w]+"\\s*("+_+")$|^$";var $=c++;a[$]="(\\s*)"+a[w]+"\\s*("+T+"|"+a[b]+")";s[$]=new RegExp(a[$],"g");var Q="$1$2$3";var G=c++;a[G]="^\\s*("+a[b]+")"+"\\s+-\\s+"+"("+a[b]+")"+"\\s*$";var W=c++;a[W]="^\\s*("+a[N]+")"+"\\s+-\\s+"+"("+a[N]+")"+"\\s*$";var X=c++;a[X]="(<|>)?=?\\s*\\*";for(var z=0;zr){return null}var n=t.loose?s[I]:s[E];if(!n.test(e)){return null}try{return new SemVer(e,t)}catch(e){return null}}t.valid=valid;function valid(e,t){var n=parse(e,t);return n?n.version:null}t.clean=clean;function clean(e,t){var n=parse(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null}t.SemVer=SemVer;function SemVer(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof SemVer){if(e.loose===t.loose){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r){throw new TypeError("version is longer than "+r+" characters")}if(!(this instanceof SemVer)){return new SemVer(e,t)}n("SemVer",e,t);this.options=t;this.loose=!!t.loose;var o=e.trim().match(t.loose?s[I]:s[E]);if(!o){throw new TypeError("Invalid Version: "+e)}this.raw=e;this.major=+o[1];this.minor=+o[2];this.patch=+o[3];if(this.major>i||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>i||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>i||this.patch<0){throw new TypeError("Invalid patch version")}if(!o[4]){this.prerelease=[]}else{this.prerelease=o[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0){if(typeof this.prerelease[n]==="number"){this.prerelease[n]++;n=-2}}if(n===-1){this.prerelease.push(0)}}if(t){if(this.prerelease[0]===t){if(isNaN(this.prerelease[1])){this.prerelease=[t,0]}}else{this.prerelease=[t,0]}}break;default:throw new Error("invalid increment argument: "+e)}this.format();this.raw=this.version;return this};t.inc=inc;function inc(e,t,n,r){if(typeof n==="string"){r=n;n=undefined}try{return new SemVer(e,n).inc(t,r).version}catch(e){return null}}t.diff=diff;function diff(e,t){if(eq(e,t)){return null}else{var n=parse(e);var r=parse(t);var i="";if(n.prerelease.length||r.prerelease.length){i="pre";var o="prerelease"}for(var s in n){if(s==="major"||s==="minor"||s==="patch"){if(n[s]!==r[s]){return i+s}}}return o}}t.compareIdentifiers=compareIdentifiers;var Y=/^[0-9]+$/;function compareIdentifiers(e,t){var n=Y.test(e);var r=Y.test(t);if(n&&r){e=+e;t=+t}return e===t?0:n&&!r?-1:r&&!n?1:e0}t.lt=lt;function lt(e,t,n){return compare(e,t,n)<0}t.eq=eq;function eq(e,t,n){return compare(e,t,n)===0}t.neq=neq;function neq(e,t,n){return compare(e,t,n)!==0}t.gte=gte;function gte(e,t,n){return compare(e,t,n)>=0}t.lte=lte;function lte(e,t,n){return compare(e,t,n)<=0}t.cmp=cmp;function cmp(e,t,n,r){switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e===n;case"!==":if(typeof e==="object")e=e.version;if(typeof n==="object")n=n.version;return e!==n;case"":case"=":case"==":return eq(e,n,r);case"!=":return neq(e,n,r);case">":return gt(e,n,r);case">=":return gte(e,n,r);case"<":return lt(e,n,r);case"<=":return lte(e,n,r);default:throw new TypeError("Invalid operator: "+t)}}t.Comparator=Comparator;function Comparator(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}if(!(this instanceof Comparator)){return new Comparator(e,t)}n("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===K){this.value=""}else{this.value=this.operator+this.semver.version}n("comp",this)}var K={};Comparator.prototype.parse=function(e){var t=this.options.loose?s[V]:s[B];var n=e.match(t);if(!n){throw new TypeError("Invalid comparator: "+e)}this.operator=n[1];if(this.operator==="="){this.operator=""}if(!n[2]){this.semver=K}else{this.semver=new SemVer(n[2],this.options.loose)}};Comparator.prototype.toString=function(){return this.value};Comparator.prototype.test=function(e){n("Comparator.test",e,this.options.loose);if(this.semver===K){return true}if(typeof e==="string"){e=new SemVer(e,this.options)}return cmp(e,this.operator,this.semver,this.options)};Comparator.prototype.intersects=function(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}var n;if(this.operator===""){n=new Range(e.value,t);return satisfies(this.value,n,t)}else if(e.operator===""){n=new Range(this.value,t);return satisfies(e.semver,n,t)}var r=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");var i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");var o=this.semver.version===e.semver.version;var s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<=");var a=cmp(this.semver,"<",e.semver,t)&&((this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"));var c=cmp(this.semver,">",e.semver,t)&&((this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">"));return r||i||o&&s||a||c};t.Range=Range;function Range(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Range){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new Range(e.raw,t)}}if(e instanceof Comparator){return new Range(e.value,t)}if(!(this instanceof Range)){return new Range(e,t)}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}Range.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};Range.prototype.toString=function(){return this.range};Range.prototype.parseRange=function(e){var t=this.options.loose;e=e.trim();var r=t?s[W]:s[G];e=e.replace(r,hyphenReplace);n("hyphen replace",e);e=e.replace(s[$],Q);n("comparator trim",e,s[$]);e=e.replace(s[O],L);e=e.replace(s[H],j);e=e.split(/\s+/).join(" ");var i=t?s[V]:s[B];var o=e.split(" ").map(function(e){return parseComparator(e,this.options)},this).join(" ").split(/\s+/);if(this.options.loose){o=o.filter(function(e){return!!e.match(i)})}o=o.map(function(e){return new Comparator(e,this.options)},this);return o};Range.prototype.intersects=function(e,t){if(!(e instanceof Range)){throw new TypeError("a Range is required")}return this.set.some(function(n){return n.every(function(n){return e.set.some(function(e){return e.every(function(e){return n.intersects(e,t)})})})})};t.toComparators=toComparators;function toComparators(e,t){return new Range(e,t).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function parseComparator(e,t){n("comp",e,t);e=replaceCarets(e,t);n("caret",e);e=replaceTildes(e,t);n("tildes",e);e=replaceXRanges(e,t);n("xrange",e);e=replaceStars(e,t);n("stars",e);return e}function isX(e){return!e||e.toLowerCase()==="x"||e==="*"}function replaceTildes(e,t){return e.trim().split(/\s+/).map(function(e){return replaceTilde(e,t)}).join(" ")}function replaceTilde(e,t){var r=t.loose?s[F]:s[k];return e.replace(r,function(t,r,i,o,s){n("tilde",e,t,r,i,o,s);var a;if(isX(r)){a=""}else if(isX(i)){a=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else if(s){n("replaceTilde pr",s);a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+(+i+1)+".0"}else{a=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}n("tilde return",a);return a})}function replaceCarets(e,t){return e.trim().split(/\s+/).map(function(e){return replaceCaret(e,t)}).join(" ")}function replaceCaret(e,t){n("caret",e,t);var r=t.loose?s[U]:s[M];return e.replace(r,function(t,r,i,o,s){n("caret",e,t,r,i,o,s);var a;if(isX(r)){a=""}else if(isX(i)){a=">="+r+".0.0 <"+(+r+1)+".0.0"}else if(isX(o)){if(r==="0"){a=">="+r+"."+i+".0 <"+r+"."+(+i+1)+".0"}else{a=">="+r+"."+i+".0 <"+(+r+1)+".0.0"}}else if(s){n("replaceCaret pr",s);if(r==="0"){if(i==="0"){a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+i+"."+(+o+1)}else{a=">="+r+"."+i+"."+o+"-"+s+" <"+r+"."+(+i+1)+".0"}}else{a=">="+r+"."+i+"."+o+"-"+s+" <"+(+r+1)+".0.0"}}else{n("no pr");if(r==="0"){if(i==="0"){a=">="+r+"."+i+"."+o+" <"+r+"."+i+"."+(+o+1)}else{a=">="+r+"."+i+"."+o+" <"+r+"."+(+i+1)+".0"}}else{a=">="+r+"."+i+"."+o+" <"+(+r+1)+".0.0"}}n("caret return",a);return a})}function replaceXRanges(e,t){n("replaceXRanges",e,t);return e.split(/\s+/).map(function(e){return replaceXRange(e,t)}).join(" ")}function replaceXRange(e,t){e=e.trim();var r=t.loose?s[x]:s[D];return e.replace(r,function(t,r,i,o,s,a){n("xRange",e,t,r,i,o,s,a);var c=isX(i);var u=c||isX(o);var f=u||isX(s);var l=f;if(r==="="&&l){r=""}if(c){if(r===">"||r==="<"){t="<0.0.0"}else{t="*"}}else if(r&&l){if(u){o=0}s=0;if(r===">"){r=">=";if(u){i=+i+1;o=0;s=0}else{o=+o+1;s=0}}else if(r==="<="){r="<";if(u){i=+i+1}else{o=+o+1}}t=r+i+"."+o+"."+s}else if(u){t=">="+i+".0.0 <"+(+i+1)+".0.0"}else if(f){t=">="+i+"."+o+".0 <"+i+"."+(+o+1)+".0"}n("xRange return",t);return t})}function replaceStars(e,t){n("replaceStars",e,t);return e.trim().replace(s[X],"")}function hyphenReplace(e,t,n,r,i,o,s,a,c,u,f,l,p){if(isX(n)){t=""}else if(isX(r)){t=">="+n+".0.0"}else if(isX(i)){t=">="+n+"."+r+".0"}else{t=">="+t}if(isX(c)){a=""}else if(isX(u)){a="<"+(+c+1)+".0.0"}else if(isX(f)){a="<"+c+"."+(+u+1)+".0"}else if(l){a="<="+c+"."+u+"."+f+"-"+l}else{a="<="+a}return(t+" "+a).trim()}Range.prototype.test=function(e){if(!e){return false}if(typeof e==="string"){e=new SemVer(e,this.options)}for(var t=0;t0){var o=e[i].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch){return true}}}return false}return true}t.satisfies=satisfies;function satisfies(e,t,n){try{t=new Range(t,n)}catch(e){return false}return t.test(e)}t.maxSatisfying=maxSatisfying;function maxSatisfying(e,t,n){var r=null;var i=null;try{var o=new Range(t,n)}catch(e){return null}e.forEach(function(e){if(o.test(e)){if(!r||i.compare(e)===-1){r=e;i=new SemVer(r,n)}}});return r}t.minSatisfying=minSatisfying;function minSatisfying(e,t,n){var r=null;var i=null;try{var o=new Range(t,n)}catch(e){return null}e.forEach(function(e){if(o.test(e)){if(!r||i.compare(e)===1){r=e;i=new SemVer(r,n)}}});return r}t.minVersion=minVersion;function minVersion(e,t){e=new Range(e,t);var n=new SemVer("0.0.0");if(e.test(n)){return n}n=new SemVer("0.0.0-0");if(e.test(n)){return n}n=null;for(var r=0;r":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!n||gt(n,t)){n=t}break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+e.operator)}})}if(n&&e.test(n)){return n}return null}t.validRange=validRange;function validRange(e,t){try{return new Range(e,t).range||"*"}catch(e){return null}}t.ltr=ltr;function ltr(e,t,n){return outside(e,t,"<",n)}t.gtr=gtr;function gtr(e,t,n){return outside(e,t,">",n)}t.outside=outside;function outside(e,t,n,r){e=new SemVer(e,r);t=new Range(t,r);var i,o,s,a,c;switch(n){case">":i=gt;o=lte;s=lt;a=">";c=">=";break;case"<":i=lt;o=gte;s=gt;a="<";c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(satisfies(e,t,r)){return false}for(var u=0;u=0.0.0")}l=l||e;p=p||e;if(i(e.semver,l.semver,r)){l=e}else if(s(e.semver,p.semver,r)){p=e}});if(l.operator===a||l.operator===c){return false}if((!p.operator||p.operator===a)&&o(e,p.semver)){return false}else if(p.operator===c&&s(e,p.semver)){return false}}return true}t.prerelease=prerelease;function prerelease(e,t){var n=parse(e,t);return n&&n.prerelease.length?n.prerelease:null}t.intersects=intersects;function intersects(e,t,n){e=new Range(e,n);t=new Range(t,n);return e.intersects(t)}t.coerce=coerce;function coerce(e){if(e instanceof SemVer){return e}if(typeof e!=="string"){return null}var t=e.match(s[R]);if(t==null){return null}return parse(t[1]+"."+(t[2]||"0")+"."+(t[3]||"0"))}},111:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n=6};AutoCollectNativePerformance.prototype.enable=function(e,t,r){var i=this;if(t===void 0){t={}}if(r===void 0){r=6e4}if(!AutoCollectNativePerformance.isNodeVersionCompatible()){return}if(AutoCollectNativePerformance._metricsAvailable==undefined&&e&&!this._isInitialized){try{var o=n(660);AutoCollectNativePerformance._emitter=new o;AutoCollectNativePerformance._metricsAvailable=true;s.info("Native metrics module successfully loaded!")}catch(e){AutoCollectNativePerformance._metricsAvailable=false;return}}this._isEnabled=e;this._disabledMetrics=t;if(this._isEnabled&&!this._isInitialized){this._isInitialized=true}if(this._isEnabled&&AutoCollectNativePerformance._emitter){AutoCollectNativePerformance._emitter.enable(true,r);this._handle=setInterval(function(){return i._trackNativeMetrics()},r);this._handle.unref()}else if(AutoCollectNativePerformance._emitter){AutoCollectNativePerformance._emitter.enable(false);if(this._handle){clearInterval(this._handle);this._handle=undefined}}};AutoCollectNativePerformance.prototype.dispose=function(){this.enable(false)};AutoCollectNativePerformance.parseEnabled=function(e){var t=process.env[i.ENV_nativeMetricsDisableAll];var n=process.env[i.ENV_nativeMetricsDisablers];if(t){return{isEnabled:false,disabledMetrics:{}}}if(n){var o=n.split(",");var s={};if(o.length>0){for(var a=0,c=o;a>t&255)};var n=function(e){return t(e,24)+t(e,16)+t(e,8)+t(e,0)};var r=e.map(n).join("");var i=Buffer.from?Buffer.from(r,"binary"):new Buffer(r,"binary");var o=i.toString("base64");return o.substr(0,o.indexOf("="))};Util.random32=function(){return 4294967296*Math.random()|0};Util.randomu32=function(){return Util.random32()+2147483648};Util.w3cTraceId=function(){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];var t="",n;for(var r=0;r<4;r++){n=Util.random32();t+=e[n&15]+e[n>>4&15]+e[n>>8&15]+e[n>>12&15]+e[n>>16&15]+e[n>>20&15]+e[n>>24&15]+e[n>>28&15]}var i=e[8+Math.random()*4|0];return t.substr(0,8)+t.substr(9,4)+"4"+t.substr(13,3)+i+t.substr(16,3)+t.substr(19,12)};Util.isValidW3CId=function(e){return e.length===32&&e!=="00000000000000000000000000000000"};Util.isArray=function(e){return Object.prototype.toString.call(e)==="[object Array]"};Util.isError=function(e){return e instanceof Error};Util.isPrimitive=function(e){var t=typeof e;return t==="string"||t==="number"||t==="boolean"};Util.isDate=function(e){return Object.prototype.toString.call(e)==="[object Date]"};Util.msToTimeSpan=function(e){if(isNaN(e)||e<0){e=0}var t=(e/1e3%60).toFixed(7).replace(/0{0,4}$/,"");var n=""+Math.floor(e/(1e3*60))%60;var r=""+Math.floor(e/(1e3*60*60))%24;var i=Math.floor(e/(1e3*60*60*24));t=t.indexOf(".")<2?"0"+t:t;n=n.length<2?"0"+n:n;r=r.length<2?"0"+r:r;var o=i>0?i+".":"";return o+r+":"+n+":"+t};Util.extractError=function(e){var t=e;return{message:e.message,code:t.code||t.id||""}};Util.extractObject=function(e){if(e instanceof Error){return Util.extractError(e)}if(typeof e.toJSON==="function"){return e.toJSON()}return e};Util.validateStringMap=function(e){if(typeof e!=="object"){c.info("Invalid properties dropped from payload");return}var t={};for(var n in e){var r="";var i=e[n];var o=typeof i;if(Util.isPrimitive(i)){r=i.toString()}else if(i===null||o==="undefined"){r=""}else if(o==="function"){c.info("key: "+n+" was function; will not serialize");continue}else{var s=Util.isArray(i)?i:Util.extractObject(i);try{if(Util.isPrimitive(s)){r=s}else{r=JSON.stringify(s)}}catch(e){r=i.constructor.name.toString()+" (Error: "+e.message+")";c.info("key: "+n+", could not be serialized")}}t[n]=r.substring(0,Util.MAX_PROPERTY_LENGTH)}return t};Util.canIncludeCorrelationHeader=function(e,t){var n=e&&e.config&&e.config.correlationHeaderExcludedDomains;if(!n||n.length==0||!t){return true}for(var r=0;r=0){f=f.substring(0,l)}var p=c;for(var d=0,h=e[n];d{this.parseLine(e)})})}getFiles(e){return this.mFilesExtensionMap.get(e)}parseLine(e){if(!e.startsWith("Name: ")){return}const t=a.join(this.mBasePath,e.split("Name: ",2)[1]);const n=a.extname(t);if(!this.mFilesExtensionMap.has(n)){this.mFilesExtensionMap.set(n,[])}const r=this.mFilesExtensionMap.get(n);if(!c.isUndefined(r)){r.push(t)}}}t.default=MetaMfParser},232:function(e,t,n){"use strict";const r=n(105);if(process&&r.gte(process.versions.node,"8.0.0")){e.exports=n(724)}else{e.exports=n(246)}},243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(222);var i=n(222);t.makePatchingRequire=i.makePatchingRequire;var o=function(e){return true};var s=function(){function ContextPreservingEventEmitter(){this.version=n(325).version;this.subscribers={};this.contextPreservationFunction=function(e){return e};this.knownPatches={};this.currentlyPublishing=false}ContextPreservingEventEmitter.prototype.shouldPublish=function(e){var t=this.subscribers[e];if(t){return t.some(function(e){var t=e.filter;return!t||t(false)})}return false};ContextPreservingEventEmitter.prototype.publish=function(e,t){if(this.currentlyPublishing){return}var n=this.subscribers[e];if(n){var r={timestamp:Date.now(),data:t};this.currentlyPublishing=true;n.forEach(function(e){var t=e.listener,n=e.filter;try{if(n&&n(true)){t(r)}}catch(e){}});this.currentlyPublishing=false}};ContextPreservingEventEmitter.prototype.subscribe=function(e,t,n){if(n===void 0){n=o}if(!this.subscribers[e]){this.subscribers[e]=[]}this.subscribers[e].push({listener:t,filter:n})};ContextPreservingEventEmitter.prototype.unsubscribe=function(e,t,n){if(n===void 0){n=o}var r=this.subscribers[e];if(r){for(var i=0;i{if(f){debug2(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);return e}).catch(e=>{e[c]=t;if(f){debug2(" AFTER runPromise: "+this.name+" uid:"+l+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);throw e})};Namespace.prototype.bind=function bindFactory(e,t){if(!t){if(!this.active){t=this.createContext()}else{t=this.active}}let n=this;return function clsBind(){n.enter(t);try{return e.apply(this,arguments)}catch(e){if(e){e[c]=t}throw e}finally{n.exit(t)}}};Namespace.prototype.enter=function enter(e){i.ok(e,"context must be provided for entering");if(f){debug2(" ENTER "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e))}this._set.push(this.active);this.active=e};Namespace.prototype.exit=function exit(e){i.ok(e,"context must be provided for exiting");if(f){debug2(" EXIT "+this.name+" uid:"+l+" len:"+this._set.length+" context: "+r.inspect(e))}if(this.active===e){i.ok(this._set.length,"can't remove top context");this.active=this._set.pop();return}let t=this._set.lastIndexOf(e);if(t<0){if(f){debug2("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e))}i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))}else{i.ok(t,"can't remove top context");this._set.splice(t,1)}};Namespace.prototype.bindEmitter=function bindEmitter(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this;let n="context@"+this.name;function attach(e){if(!e){return}if(!e[a]){e[a]=Object.create(null)}e[a][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[a])){return e}let t=e;let n=e[a];Object.keys(n).forEach(function(e){let r=n[e];t=r.namespace.bind(t,r.context)});return t}o(e,attach,bind)};Namespace.prototype.fromException=function fromException(e){return e[c]};function getNamespace(e){return process.namespaces[e]}function createNamespace(e){i.ok(e,"namespace must be given a name.");if(f){debug2("CREATING NAMESPACE "+e)}let t=new Namespace(e);t.id=l;s.addHooks({init(n,i,o,s,a){l=n;if(s){t._contexts.set(n,t._contexts.get(s));if(f){debug2("PARENTID: "+e+" uid:"+n+" parent:"+s+" provider:"+o)}}else{t._contexts.set(l,t.active)}if(f){debug2("INIT "+e+" uid:"+n+" parent:"+s+" provider:"+u[o]+" active:"+r.inspect(t.active,true))}},pre(n,i){l=n;let o=t._contexts.get(n);if(o){if(f){debug2(" PRE "+e+" uid:"+n+" handle:"+getFunctionName(i)+" context:"+r.inspect(o))}t.enter(o)}else{if(f){debug2(" PRE MISSING CONTEXT "+e+" uid:"+n+" handle:"+getFunctionName(i))}}},post(n,i){l=n;let o=t._contexts.get(n);if(o){if(f){debug2(" POST "+e+" uid:"+n+" handle:"+getFunctionName(i)+" context:"+r.inspect(o))}t.exit(o)}else{if(f){debug2(" POST MISSING CONTEXT "+e+" uid:"+n+" handle:"+getFunctionName(i))}}},destroy(n){l=n;if(f){debug2("DESTROY "+e+" uid:"+n+" context:"+r.inspect(t._contexts.get(l))+" active:"+r.inspect(t.active,true))}t._contexts.delete(n)}});process.namespaces[e]=t;return t}function destroyNamespace(e){let t=getNamespace(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"');i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t));process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroyNamespace(e)})}process.namespaces=Object.create(null)}process.namespaces={};if(s._state&&!s._state.enabled){s.enable()}function debug2(e){if(process.env.DEBUG){process._rawDebug(e)}}function getFunctionName(e){if(!e){return e}if(typeof e==="function"){if(e.name){return e.name}return(e.toString().trim().match(/^function\s*([^\s(]+)/)||[])[1]}else if(e.constructor&&e.constructor.name){return e.constructor.name}}if(f){var p=n(322);for(var d in p.filter._modifiers){p.filter.deattach(d)}}},271:function(e,t,n){"use strict";const r=n(620);if(global._asyncHook){if(global._asyncHook.version===n(664).version){e.exports=global._asyncHook}else{throw new Error("Conflicting version of async-hook-jl found")}}else{const t=n(322);t.filter.attach(function(e,t){return t.filter(function(e){const t=e.getFileName();return!(t&&t.slice(0,__dirname.length)===__dirname)})});e.exports=global._asyncHook=new r}},277:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(367);function samplingTelemetryProcessor(e,t){var n=e.sampleRate;var i=false;if(n===null||n===undefined||n>=100){return true}else if(e.data&&r.TelemetryType.Metric===r.baseTypeToTelemetryType(e.data.baseType)){return true}else if(t.correlationContext&&t.correlationContext.operation){i=getSamplingHashCode(t.correlationContext.operation.id)3||parseInt(e[0])>2&&parseInt(e[1])>2};CorrelationContextManager.shouldUseClsHooked=function(){var e=process.versions.node.split(".");return parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=2};CorrelationContextManager.canUseClsHooked=function(){var e=process.versions.node.split(".");var t=parseInt(e[0])>8||parseInt(e[0])>=8&&parseInt(e[1])>=0;var n=parseInt(e[0])<8||parseInt(e[0])<=8&&parseInt(e[1])<2;var r=parseInt(e[0])>4||parseInt(e[0])>=4&&parseInt(e[1])>=7;return!(t&&n)&&r};CorrelationContextManager.enabled=false;CorrelationContextManager.hasEverEnabled=false;CorrelationContextManager.forceClsHooked=undefined;CorrelationContextManager.CONTEXT_NAME="ApplicationInsights-Context";return CorrelationContextManager}();t.CorrelationContextManager=o;var s=function(){function CustomPropertiesImpl(e){this.props=[];this.addHeaderData(e)}CustomPropertiesImpl.prototype.addHeaderData=function(e){var t=e?e.split(", "):[];this.props=t.map(function(e){var t=e.split("=");return{key:t[0],value:t[1]}}).concat(this.props)};CustomPropertiesImpl.prototype.serializeToHeader=function(){return this.props.map(function(e){return e.key+"="+e.value}).join(", ")};CustomPropertiesImpl.prototype.getProperty=function(e){for(var t=0;t=0,"context not currently entered; can't exit");r.ok(t,"can't remove top context");this._set.splice(t,1)};Namespace.prototype.bindEmitter=function(e){r.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");var t=this;var n="context@"+this.name;function attach(e){if(!e)return;if(!e[o])e[o]=Object.create(null);e[o][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[o]))return e;var t=e;var n=e[o];Object.keys(n).forEach(function(e){var r=n[e];t=r.namespace.bind(t,r.context)});return t}i(e,attach,bind)};Namespace.prototype.fromException=function(e){return e[s]};function get(e){return process.namespaces[e]}function create(e){r.ok(e,"namespace must be given a name!");var t=new Namespace(e);t.id=process.addAsyncListener({create:function(){return t.active},before:function(e,n){if(n)t.enter(n)},after:function(e,n){if(n)t.exit(n)},error:function(e){if(e)t.exit(e)}});process.namespaces[e]=t;return t}function destroy(e){var t=get(e);r.ok(t,"can't delete nonexistent namespace!");r.ok(t.id,"don't assign to process.namespaces directly!");process.removeAsyncListener(t.id);process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroy(e)})}process.namespaces=Object.create(null)}if(!process.namespaces)reset();e.exports={getNamespace:get,createNamespace:create,destroyNamespace:destroy,reset:reset}},513:function(e){"use strict";var t=function(){function AutoCollectExceptions(e){if(!!AutoCollectExceptions.INSTANCE){throw new Error("Exception tracking should be configured from the applicationInsights object")}AutoCollectExceptions.INSTANCE=this;this._client=e}Object.defineProperty(AutoCollectExceptions,"UNCAUGHT_EXCEPTION_HANDLER_NAME",{get:function(){return"uncaughtException"},enumerable:true,configurable:true});Object.defineProperty(AutoCollectExceptions,"UNHANDLED_REJECTION_HANDLER_NAME",{get:function(){return"unhandledRejection"},enumerable:true,configurable:true});AutoCollectExceptions.prototype.isInitialized=function(){return this._isInitialized};AutoCollectExceptions.prototype.enable=function(e){var t=this;if(e){this._isInitialized=true;var n=this;if(!this._exceptionListenerHandle){var r=function(e,n){if(n===void 0){n=new Error(AutoCollectExceptions._FALLBACK_ERROR_MESSAGE)}t._client.trackException({exception:n});t._client.flush({isAppCrashing:true});if(e){var r=n;throw r}};this._exceptionListenerHandle=r.bind(this,true);this._rejectionListenerHandle=r.bind(this,false);process.on(AutoCollectExceptions.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle);process.on(AutoCollectExceptions.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle)}}else{if(this._exceptionListenerHandle){process.removeListener(AutoCollectExceptions.UNCAUGHT_EXCEPTION_HANDLER_NAME,this._exceptionListenerHandle);process.removeListener(AutoCollectExceptions.UNHANDLED_REJECTION_HANDLER_NAME,this._rejectionListenerHandle);this._exceptionListenerHandle=undefined;this._rejectionListenerHandle=undefined;delete this._exceptionListenerHandle;delete this._rejectionListenerHandle}}};AutoCollectExceptions.prototype.dispose=function(){AutoCollectExceptions.INSTANCE=null;this.enable(false);this._isInitialized=false};AutoCollectExceptions.INSTANCE=null;AutoCollectExceptions._FALLBACK_ERROR_MESSAGE="A promise was rejected without providing an error. Application Insights generated this error stack for you.";return AutoCollectExceptions}();e.exports=t},514:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);function postgresPool1PatchFunction(e){var t=e.prototype.connect;e.prototype.connect=function connect(e){if(e){arguments[0]=r.channel.bindToContext(e)}return t.apply(this,arguments)};return e}t.postgresPool1={versionSpecifier:">= 1.0.0 < 3.0.0",patch:postgresPool1PatchFunction};function enable(){r.channel.registerMonkeyPatch("pg-pool",t.postgresPool1)}t.enable=enable},519:function(e,t,n){t.require=function(){var e=n(747);if(process.versions["electron"]){try{originalFs=n(533);if(Object.keys(originalFs).length>0){e=originalFs}}catch(e){}}return e}},522:function(e,t,n){"use strict";if(process.addAsyncListener)throw new Error("Don't require polyfill unless needed");var r=n(858),i=n(105),o=r.wrap,s=r.massWrap,a=n(934),c=n(669);var u=i.gte(process.version,"6.0.0");var f=i.gte(process.version,"7.0.0");var l=i.gte(process.version,"8.0.0");var p=i.gte(process.version,"11.0.0");var d=n(631);if(f&&!d._normalizeArgs){d._normalizeArgs=function(e){if(e.length===0){return[{},null]}var t=e[0];var n={};if(typeof t==="object"&&t!==null){n=t}else if(isPipeName(t)){n.path=t}else{n.port=t;if(e.length>1&&typeof e[1]==="string"){n.host=e[1]}}var r=e[e.length-1];if(typeof r!=="function")return[n,null];else return[n,r]}}else if(!f&&!d._normalizeConnectArgs){d._normalizeConnectArgs=function(e){var t={};function toNumber(e){return(e=Number(e))>=0?e:false}if(typeof e[0]==="object"&&e[0]!==null){t=e[0]}else if(typeof e[0]==="string"&&toNumber(e[0])===false){t.path=e[0]}else{t.port=e[0];if(typeof e[1]==="string"){t.host=e[1]}}var n=e[e.length-1];return typeof n==="function"?[t,n]:[t]}}if("_setUpListenHandle"in d.Server.prototype){o(d.Server.prototype,"_setUpListenHandle",wrapSetUpListenHandle)}else{o(d.Server.prototype,"_listen2",wrapSetUpListenHandle)}function wrapSetUpListenHandle(e){return function(){this.on("connection",function(e){if(e._handle){e._handle.onread=a(e._handle.onread)}});try{return e.apply(this,arguments)}finally{if(this._handle&&this._handle.onconnection){this._handle.onconnection=a(this._handle.onconnection)}}}}function patchOnRead(e){if(e&&e._handle){var t=e._handle;if(!t._originalOnread){t._originalOnread=t.onread}t.onread=a(t._originalOnread)}}o(d.Socket.prototype,"connect",function(e){return function(){var t;if(l&&Array.isArray(arguments[0])&&Object.getOwnPropertySymbols(arguments[0]).length>0){t=arguments[0]}else{t=f?d._normalizeArgs(arguments):d._normalizeConnectArgs(arguments)}if(t[1])t[1]=a(t[1]);var n=e.apply(this,t);patchOnRead(this);return n}});var h=n(605);o(h.Agent.prototype,"addRequest",function(e){return function(t){var n=t.onSocket;t.onSocket=a(function(e){patchOnRead(e);return n.apply(this,arguments)});return e.apply(this,arguments)}});var v=n(129);function wrapChildProcess(e){if(Array.isArray(e.stdio)){e.stdio.forEach(function(e){if(e&&e._handle){e._handle.onread=a(e._handle.onread);o(e._handle,"close",activatorFirst)}})}if(e._handle){e._handle.onexit=a(e._handle.onexit)}}if(v.ChildProcess){o(v.ChildProcess.prototype,"spawn",function(e){return function(){var t=e.apply(this,arguments);wrapChildProcess(this);return t}})}else{s(v,["execFile","fork","spawn"],function(e){return function(){var t=e.apply(this,arguments);wrapChildProcess(t);return t}})}if(!process._fatalException){process._originalNextTick=process.nextTick}var y=[];if(process._nextDomainTick)y.push("_nextDomainTick");if(process._tickDomainCallback)y.push("_tickDomainCallback");s(process,y,activator);o(process,"nextTick",activatorFirst);var g=["setTimeout","setInterval"];if(global.setImmediate)g.push("setImmediate");var m=n(213);var C=global.setTimeout===m.setTimeout;s(m,g,activatorFirst);if(C){s(global,g,activatorFirst)}var E=n(819);s(E,["lookup","resolve","resolve4","resolve6","resolveCname","resolveMx","resolveNs","resolveTxt","resolveSrv","reverse"],activator);if(E.resolveNaptr)o(E,"resolveNaptr",activator);var _=n(747);s(_,["watch","rename","truncate","chown","fchown","chmod","fchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","watchFile","unwatchFile","exists"],activator);if(_.lchown)o(_,"lchown",activator);if(_.lchmod)o(_,"lchmod",activator);if(_.ftruncate)o(_,"ftruncate",activator);var T;try{T=n(761)}catch(e){}if(T&&T.Deflate&&T.Deflate.prototype){var I=Object.getPrototypeOf(T.Deflate.prototype);if(I._transform){o(I,"_transform",activator)}else if(I.write&&I.flush&&I.end){s(I,["write","flush","end"],activator)}}var w;try{w=n(417)}catch(e){}if(w){var S=["pbkdf2","randomBytes"];if(!p){S.push("pseudoRandomBytes")}s(w,S,activator)}var A=!!global.Promise&&Promise.toString()==="function Promise() { [native code] }"&&Promise.toString.toString()==="function toString() { [native code] }";if(A){var b=process.addAsyncListener({create:function create(){A=false}});global.Promise.resolve(true).then(function notSync(){A=false});process.removeAsyncListener(b)}if(A){wrapPromise()}function wrapPromise(){var e=global.Promise;function wrappedPromise(t){if(!(this instanceof wrappedPromise)){return e(t)}if(typeof t!=="function"){return new e(t)}var n,r;var i=new e(wrappedExecutor);i.__proto__=wrappedPromise.prototype;try{t.apply(n,r)}catch(e){r[1](e)}return i;function wrappedExecutor(e,t){n=this;r=[wrappedResolve,wrappedReject];function wrappedResolve(t){ensureAslWrapper(i,false);return e(t)}function wrappedReject(e){ensureAslWrapper(i,false);return t(e)}}}c.inherits(wrappedPromise,e);o(e.prototype,"then",wrapThen);if(e.prototype.chain){o(e.prototype,"chain",wrapThen)}if(u){global.Promise=n(36)(e,ensureAslWrapper)}else{var t=["all","race","reject","resolve","accept","defer"];t.forEach(function(t){if(typeof e[t]==="function"){wrappedPromise[t]=e[t]}});global.Promise=wrappedPromise}function ensureAslWrapper(e,t){if(!e.__asl_wrapper||t){e.__asl_wrapper=a(propagateAslWrapper)}}function propagateAslWrapper(t,n,r,i){var o;try{o=n.call(t,r);return{returnVal:o,error:false}}catch(e){return{errorVal:e,error:true}}finally{if(o instanceof e){i.__asl_wrapper=function proxyWrapper(){var e=o.__asl_wrapper||propagateAslWrapper;return e.apply(this,arguments)}}else{ensureAslWrapper(i,true)}}}function wrapThen(e){return function wrappedThen(){var t=this;var n=e.apply(t,Array.prototype.map.call(arguments,bind));n.__asl_wrapper=function proxyWrapper(e,r,i,o){if(t.__asl_wrapper){t.__asl_wrapper(e,function(){},null,n);return n.__asl_wrapper(e,r,i,o)}return propagateAslWrapper(e,r,i,o)};return n;function bind(e){if(typeof e!=="function")return e;return a(function(r){var i=(t.__asl_wrapper||propagateAslWrapper)(this,e,r,n);if(i.error){throw i.errorVal}else{return i.returnVal}})}}}}function activator(e){var t=function(){var t;var n=arguments.length-1;if(typeof arguments[n]==="function"){t=Array(arguments.length);for(var r=0;r=0?e:false}function isPipeName(e){return typeof e==="string"&&toNumber(e)===false}},528:function(e,t,n){"use strict";var r=n(970);var i=function(){function Channel(e,t,n,r){this._buffer=[];this._lastSend=0;this._isDisabled=e;this._getBatchSize=t;this._getBatchIntervalMs=n;this._sender=r}Channel.prototype.setUseDiskRetryCaching=function(e,t,n){this._sender.setDiskRetryMode(e,t,n)};Channel.prototype.send=function(e){var t=this;if(this._isDisabled()){return}if(!e){r.warn("Cannot send null/undefined telemetry");return}var n=this._stringify(e);if(typeof n!=="string"){return}this._buffer.push(n);if(this._buffer.length>=this._getBatchSize()){this.triggerSend(false);return}if(!this._timeoutHandle&&this._buffer.length>0){this._timeoutHandle=setTimeout(function(){t._timeoutHandle=null;t.triggerSend(false)},this._getBatchIntervalMs())}};Channel.prototype.triggerSend=function(e,t){var n=this._buffer.length<1;if(!n){var r=this._buffer.join("\n");if(e){this._sender.saveOnCrash(r);if(typeof t==="function"){t("data saved on crash")}}else{this._sender.send(Buffer.from?Buffer.from(r):new Buffer(r),t)}}this._lastSend=+new Date;this._buffer.length=0;clearTimeout(this._timeoutHandle);this._timeoutHandle=null;if(n&&typeof t==="function"){t("no data to send")}};Channel.prototype._stringify=function(e){try{return JSON.stringify(e)}catch(t){r.warn("Failed to serialize payload",t,e)}};return Channel}();e.exports=i},533:function(){eval("require")("original-fs")},543:function(e,t,n){var r=n(402),i=r.Constants;e.exports=function(){var e=0,t=0,n=0,o=0,s=0;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return n},set size(e){n=e},get offset(){return o},set offset(e){o=e},get commentLength(){return s},set commentLength(e){s=e},get mainHeaderSize(){return i.ENDHDR+s},loadFromBinary:function(a){if(a.length!==i.ENDHDR||a.readUInt32LE(0)!==i.ENDSIG)throw r.Errors.INVALID_END;e=a.readUInt16LE(i.ENDSUB);t=a.readUInt16LE(i.ENDTOT);n=a.readUInt32LE(i.ENDSIZ);o=a.readUInt32LE(i.ENDOFF);s=a.readUInt16LE(i.ENDCOM)},toBinary:function(){var r=Buffer.alloc(i.ENDHDR+s);r.writeUInt32LE(i.ENDSIG,0);r.writeUInt32LE(0,4);r.writeUInt16LE(e,i.ENDSUB);r.writeUInt16LE(t,i.ENDTOT);r.writeUInt32LE(n,i.ENDSIZ);r.writeUInt32LE(o,i.ENDOFF);r.writeUInt16LE(s,i.ENDCOM);r.fill(" ",i.ENDHDR);return r},toString:function(){return"{\n"+'\t"diskEntries" : '+e+",\n"+'\t"totalEntries" : '+t+",\n"+'\t"size" : '+n+" bytes,\n"+'\t"offset" : 0x'+o.toString(16).toUpperCase()+",\n"+'\t"commentLength" : 0x'+s+"\n"+"}"}}}},545:function(e,t,n){"use strict";function __export(e){for(var n in e)if(!t.hasOwnProperty(n))t[n]=e[n]}Object.defineProperty(t,"__esModule",{value:true});__export(n(583))},555:function(e,t,n){"use strict";var r=n(367);var i=n(179);var o=n(287);var s=function(){function EnvelopeFactory(){}EnvelopeFactory.createEnvelope=function(e,t,n,o,s){var a=null;switch(t){case r.TelemetryType.Trace:a=EnvelopeFactory.createTraceData(e);break;case r.TelemetryType.Dependency:a=EnvelopeFactory.createDependencyData(e);break;case r.TelemetryType.Event:a=EnvelopeFactory.createEventData(e);break;case r.TelemetryType.Exception:a=EnvelopeFactory.createExceptionData(e);break;case r.TelemetryType.Request:a=EnvelopeFactory.createRequestData(e);break;case r.TelemetryType.Metric:a=EnvelopeFactory.createMetricData(e);break;case r.TelemetryType.Availability:a=EnvelopeFactory.createAvailabilityData(e);break}if(n&&r.domainSupportsProperties(a.baseData)){if(a&&a.baseData){if(!a.baseData.properties){a.baseData.properties=n}else{for(var c in n){if(!a.baseData.properties[c]){a.baseData.properties[c]=n[c]}}}}a.baseData.properties=i.validateStringMap(a.baseData.properties)}var u=s?s.instrumentationKey||"":"";var f=new r.Envelope;f.data=a;f.iKey=u;f.name="Microsoft.ApplicationInsights."+u.replace(/-/g,"")+"."+a.baseType.substr(0,a.baseType.length-4);f.tags=this.getTags(o,e.tagOverrides);f.time=(new Date).toISOString();f.ver=1;f.sampleRate=s?s.samplingPercentage:100;if(t===r.TelemetryType.Metric){f.sampleRate=100}return f};EnvelopeFactory.createTraceData=function(e){var t=new r.MessageData;t.message=e.message;t.properties=e.properties;if(!isNaN(e.severity)){t.severityLevel=e.severity}else{t.severityLevel=r.SeverityLevel.Information}var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Trace);n.baseData=t;return n};EnvelopeFactory.createDependencyData=function(e){var t=new r.RemoteDependencyData;t.name=e.name;t.data=e.data;t.target=e.target;t.duration=i.msToTimeSpan(e.duration);t.success=e.success;t.type=e.dependencyTypeName;t.properties=e.properties;t.resultCode=e.resultCode?e.resultCode+"":"";if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Dependency);n.baseData=t;return n};EnvelopeFactory.createEventData=function(e){var t=new r.EventData;t.name=e.name;t.properties=e.properties;t.measurements=e.measurements;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Event);n.baseData=t;return n};EnvelopeFactory.createExceptionData=function(e){var t=new r.ExceptionData;t.properties=e.properties;if(!isNaN(e.severity)){t.severityLevel=e.severity}else{t.severityLevel=r.SeverityLevel.Error}t.measurements=e.measurements;t.exceptions=[];var n=e.exception["stack"];var o=new r.ExceptionDetails;o.message=e.exception.message;o.typeName=e.exception.name;o.parsedStack=this.parseStack(n);o.hasFullStack=i.isArray(o.parsedStack)&&o.parsedStack.length>0;t.exceptions.push(o);var s=new r.Data;s.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Exception);s.baseData=t;return s};EnvelopeFactory.createRequestData=function(e){var t=new r.RequestData;if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}t.name=e.name;t.url=e.url;t.source=e.source;t.duration=i.msToTimeSpan(e.duration);t.responseCode=e.resultCode?e.resultCode+"":"";t.success=e.success;t.properties=e.properties;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Request);n.baseData=t;return n};EnvelopeFactory.createMetricData=function(e){var t=new r.MetricData;t.metrics=[];var n=new r.DataPoint;n.count=!isNaN(e.count)?e.count:1;n.kind=r.DataPointType.Aggregation;n.max=!isNaN(e.max)?e.max:e.value;n.min=!isNaN(e.min)?e.min:e.value;n.name=e.name;n.stdDev=!isNaN(e.stdDev)?e.stdDev:0;n.value=e.value;t.metrics.push(n);t.properties=e.properties;var i=new r.Data;i.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Metric);i.baseData=t;return i};EnvelopeFactory.createAvailabilityData=function(e){var t=new r.AvailabilityData;if(e.id){t.id=e.id}else{t.id=i.w3cTraceId()}t.name=e.name;t.duration=i.msToTimeSpan(e.duration);t.success=e.success;t.runLocation=e.runLocation;t.message=e.message;t.measurements=e.measurements;t.properties=e.properties;var n=new r.Data;n.baseType=r.telemetryTypeToBaseType(r.TelemetryType.Availability);n.baseData=t;return n};EnvelopeFactory.getTags=function(e,t){var n=o.CorrelationContextManager.getCurrentContext();var r={};if(e&&e.tags){for(var i in e.tags){r[i]=e.tags[i]}}if(t){for(var i in t){r[i]=t[i]}}if(n){r[e.keys.operationId]=r[e.keys.operationId]||n.operation.id;r[e.keys.operationName]=r[e.keys.operationName]||n.operation.name;r[e.keys.operationParentId]=r[e.keys.operationParentId]||n.operation.parentId}return r};EnvelopeFactory.parseStack=function(e){var t=undefined;if(typeof e==="string"){var n=e.split("\n");t=[];var r=0;var i=0;for(var o=0;o<=n.length;o++){var s=n[o];if(a.regex.test(s)){var c=new a(n[o],r++);i+=c.sizeInBytes;t.push(c)}}var u=32*1024;if(i>u){var f=0;var l=t.length-1;var p=0;var d=f;var h=l;while(fu){var g=h-d+1;t.splice(d,g);break}d=f;h=l;f++;l--}}}return t};return EnvelopeFactory}();var a=function(){function _StackFrame(e,t){this.sizeInBytes=0;this.level=t;this.method="";this.assembly=i.trim(e);var n=e.match(_StackFrame.regex);if(n&&n.length>=5){this.method=i.trim(n[2])||this.method;this.fileName=i.trim(n[4])||"";this.line=parseInt(n[5])||0}this.sizeInBytes+=this.method.length;this.sizeInBytes+=this.fileName.length;this.sizeInBytes+=this.assembly.length;this.sizeInBytes+=_StackFrame.baseSize;this.sizeInBytes+=this.level.toString().length;this.sizeInBytes+=this.line.toString().length}_StackFrame.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/;_StackFrame.baseSize=58;return _StackFrame}();e.exports=s},566:function(e,t,n){e.exports=function(e){var t=n(761);return{inflate:function(){return t.inflateRawSync(e)},inflateAsync:function(n){var r=t.createInflateRaw(),i=[],o=0;r.on("data",function(e){i.push(e);o+=e.length});r.on("end",function(){var e=Buffer.alloc(o),t=0;e.fill(0);for(var r=0;r= 4.0.0",patch:o};function enable(){r.channel.registerMonkeyPatch("console",t.console);n(82)}t.enable=enable},593:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(367);var i=n(243);var o=[];var s=function(e){var t=e.data.message;o.forEach(function(n){if(t instanceof Error){n.trackException({exception:t})}else{if(t.lastIndexOf("\n")==t.length-1){t=t.substring(0,t.length-1)}n.trackTrace({message:t,severity:e.data.stderr?r.SeverityLevel.Warning:r.SeverityLevel.Information})}})};function enable(e,t){if(e){if(o.length===0){i.channel.subscribe("console",s)}o.push(t)}else{o=o.filter(function(e){return e!=t});if(o.length===0){i.channel.unsubscribe("console",s)}}}t.enable=enable;function dispose(){i.channel.unsubscribe("console",s);o=[]}t.dispose=dispose},602:function(e,t,n){"use strict";var r=n(747),i=n(304).StringDecoder;function createLineReader(e,t,n){if(t instanceof Function){n=t;t=undefined}if(!t)t={};var r=t.encoding||"utf8",o=t.separator||/\r\n?|\n/,s=t.bufferSize||1024,a="",c=new i(r),u=false,f=false,l=-1,p,d,h=false,v;if(o instanceof RegExp){v=function(){var e=o.exec(a);if(e&&(e.index+e[0].length0||!f}function nextLine(e){if(u){return e(new Error("LineReader has been closed"))}function getLine(t){if(t){return e(t)}if(l<0&&f){l=a.length}var n=a.substring(0,l);a=a.substring(l+p);l=-1;e(undefined,n)}v();if(l<0){if(f){if(hasNextLine()){l=a.length;getLine()}else{return e(new Error("No more lines to read."))}}else{readToSeparator(getLine)}}else{getLine()}}readToSeparator(function(e){if(e){onFailure(e)}else{return n(undefined,{hasNextLine:hasNextLine,nextLine:nextLine,close:close,isOpen:isOpen,isClosed:isClosed,getReadStream:getReadStream})}})}function open(e,t,n){if(t instanceof Function){n=t;t=undefined}var i;if(typeof e.read=="function"){i=e}else if(typeof e==="string"||e instanceof String){i=r.createReadStream(e)}else{n(new Error("Invalid file argument for LineReader.open. Must be filename or stream."));return}i.pause();createLineReader(i,t,n)}function eachLine(e,t,n,r){if(t instanceof Function){r=n;n=t;t=undefined}var i=n.length===3;var o;var s;open(e,t,function(e,t){o=t;if(s){s(t)}if(e){if(r)r(e);return}function finish(e){t.close(function(t){if(r)r(e||t)})}function newRead(){if(t.hasNextLine()){setImmediate(readNext)}else{finish()}}function continueCb(e){if(e!==false){newRead()}else{finish()}}function readNext(){t.nextLine(function(e,r){if(e){finish(e)}var o=!t.hasNextLine();if(i){n(r,o,continueCb)}else{if(n(r,o)!==false){newRead()}else{finish()}}})}newRead()});return{getReader:function(e){if(o){e(o)}else{s=e}}}}e.exports.open=open;e.exports.eachLine=eachLine},603:function(e){"use strict";var t=function(){function ContextTagKeys(){this.applicationVersion="ai.application.ver";this.deviceId="ai.device.id";this.deviceLocale="ai.device.locale";this.deviceModel="ai.device.model";this.deviceOEMName="ai.device.oemName";this.deviceOSVersion="ai.device.osVersion";this.deviceType="ai.device.type";this.locationIp="ai.location.ip";this.operationId="ai.operation.id";this.operationName="ai.operation.name";this.operationParentId="ai.operation.parentId";this.operationSyntheticSource="ai.operation.syntheticSource";this.operationCorrelationVector="ai.operation.correlationVector";this.sessionId="ai.session.id";this.sessionIsFirst="ai.session.isFirst";this.userAccountId="ai.user.accountId";this.userId="ai.user.id";this.userAuthUserId="ai.user.authUserId";this.cloudRole="ai.cloud.role";this.cloudRoleInstance="ai.cloud.roleInstance";this.internalSdkVersion="ai.internal.sdkVersion";this.internalAgentVersion="ai.internal.agentVersion";this.internalNodeName="ai.internal.nodeName"}return ContextTagKeys}();e.exports=t},605:function(e){e.exports=require("http")},606:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=this&&this.__rest||function(e,t){var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0)n[r]=e[r];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,r=Object.getOwnPropertySymbols(e);it[r]?i:r}}this.add(new n(e,{level:r}))}var s=e.createLogger;e.createLogger=function patchedCreate(){var t=arguments[0].levels||e.config.npm.levels;var r;for(var i in t){if(t.hasOwnProperty(i)){r=r===undefined||t[i]>t[r]?i:r}}var o=s.apply(this,arguments);o.add(new n(e,{level:r}));var a=o.configure;o.configure=function(){a.apply(this,arguments);patchedConfigure.apply(this,arguments)};return o};var a=e.createLogger;e.configure=function(){a.apply(this,arguments);patchedConfigure.apply(this,arguments)};e.add(new n(e));return e};t.winston3={versionSpecifier:"3.x",patch:a};t.winston2={versionSpecifier:"2.x",patch:s};function enable(){o.channel.registerMonkeyPatch("winston",t.winston2);o.channel.registerMonkeyPatch("winston",t.winston3)}t.enable=enable},614:function(e){e.exports=require("events")},615:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const o=i(n(771));class ComparisionReportGenerator{constructor(e,t){this.apkAnalyser=e;this.reporter=t}generateComparisionReport(e,t,n,i,s,a,c){return r(this,void 0,void 0,function*(){const r=yield this.apkAnalyser.analyse(e,i);const u=yield this.apkAnalyser.analyse(t,s);const f=new o.default;f.baseApkLabel=r.apkLabel;f.targetApkLabel=u.apkLabel;a.forEach((e,t)=>{const n=r.sizeMetrics[e];const i=r.sizeMetrics[e];const o=i-n;f.comparisionMetrics.push({metricName:e,baseValue:n,targetValue:i,difference:o,threshold:c[t]})});this.reporter.writeReport(f,n);return f})}}t.default=ComparisionReportGenerator},619:function(e){e.exports=require("constants")},620:function(e,t,n){"use strict";const r=process.binding("async_wrap");const i=r.Providers.TIMERWRAP;const o={nextTick:n(764),promise:n(37),timers:n(737)};const s=new Set;function State(){this.enabled=false;this.counter=0}function Hooks(){const e=this.initFns=[];const t=this.preFns=[];const n=this.postFns=[];const r=this.destroyFns=[];this.init=function(t,n,r,o){if(n===i){s.add(t);return}for(const i of e){i(t,this,n,r,o)}};this.pre=function(e){if(s.has(e))return;for(const n of t){n(e,this)}};this.post=function(e,t){if(s.has(e))return;for(const r of n){r(e,this,t)}};this.destroy=function(e){if(s.has(e)){s.delete(e);return}for(const t of r){t(e)}}}Hooks.prototype.add=function(e){if(e.init)this.initFns.push(e.init);if(e.pre)this.preFns.push(e.pre);if(e.post)this.postFns.push(e.post);if(e.destroy)this.destroyFns.push(e.destroy)};function removeElement(e,t){const n=e.indexOf(t);if(n===-1)return;e.splice(n,1)}Hooks.prototype.remove=function(e){if(e.init)removeElement(this.initFns,e.init);if(e.pre)removeElement(this.preFns,e.pre);if(e.post)removeElement(this.postFns,e.post);if(e.destroy)removeElement(this.destroyFns,e.destroy)};function AsyncHook(){this._state=new State;this._hooks=new Hooks;this.version=n(664).version;this.providers=r.Providers;for(const e of Object.keys(o)){o[e].call(this)}if(process.env.hasOwnProperty("NODE_ASYNC_HOOK_WARNING")){console.warn("warning: you are using async-hook-jl which is unstable.")}r.setupHooks({init:this._hooks.init,pre:this._hooks.pre,post:this._hooks.post,destroy:this._hooks.destroy})}e.exports=AsyncHook;AsyncHook.prototype.addHooks=function(e){this._hooks.add(e)};AsyncHook.prototype.removeHooks=function(e){this._hooks.remove(e)};AsyncHook.prototype.enable=function(){this._state.enabled=true;r.enable()};AsyncHook.prototype.disable=function(){this._state.enabled=false;r.disable()}},622:function(e){e.exports=require("path")},631:function(e){e.exports=require("net")},633:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class ThresholdChecker{constructor(e){this.ciCore=e}checkThresholds(e){var t=true;e.comparisionMetrics.forEach(e=>{if(e.threshold==NaN){this.ciCore.logInfo(e.metricName+": ignoring threshold for metric!");return}if(e.difference>e.threshold){this.ciCore.logError(e.metricName+" increased more than threshold!");t=false}});return t}}t.default=ThresholdChecker},635:function(e,t,n){"use strict";var r=n(211);var i=n(366);var o=n(970);var s={method:"POST",time:"x-ms-qps-transmission-time",subscribed:"x-ms-qps-subscribed"};var a=function(){function QuickPulseSender(e){this._config=e;this._consecutiveErrors=0}QuickPulseSender.prototype.ping=function(e,t){this._submitData(e,t,"ping")};QuickPulseSender.prototype.post=function(e,t){this._submitData([e],t,"post")};QuickPulseSender.prototype._submitData=function(e,t,n){var a=this;var c=JSON.stringify(e);var u=(l={},l[i.disableCollectionRequestOption]=true,l.host=this._config.quickPulseHost,l.method=s.method,l.path="/QuickPulseService.svc/"+n+"?ikey="+this._config.instrumentationKey,l.headers=(p={Expect:"100-continue"},p[s.time]=1e4*Date.now(),p["Content-Type"]="application/json",p["Content-Length"]=Buffer.byteLength(c),p),l);var f=r.request(u,function(e){var n=e.headers[s.subscribed]==="true";a._consecutiveErrors=0;t(n,e)});f.on("error",function(e){a._consecutiveErrors++;var n="Transient error connecting to the Live Metrics endpoint. This packet will not appear in your Live Metrics Stream. Error:";if(a._consecutiveErrors%QuickPulseSender.MAX_QPS_FAILURES_BEFORE_WARN===0){n="Live Metrics endpoint could not be reached "+a._consecutiveErrors+" consecutive times. Most recent error:";o.warn(QuickPulseSender.TAG,n,e)}else{o.info(QuickPulseSender.TAG,n,e)}t()});f.write(c);f.end();var l,p};QuickPulseSender.TAG="QuickPulseSender";QuickPulseSender.MAX_QPS_FAILURES_BEFORE_WARN=25;return QuickPulseSender}();e.exports=a},645:function(e){"use strict";var t=function(){function Base(){}return Base}();e.exports=t},660:function(){eval("require")("applicationinsights-native-metrics")},664:function(e){e.exports={_from:"async-hook-jl@^1.7.6",_id:"async-hook-jl@1.7.6",_inBundle:false,_integrity:"sha512-gFaHkFfSxTjvoxDMYqDuGHlcRyUuamF8s+ZTtJdDzqjws4mCt7v0vuV79/E2Wr2/riMQgtG4/yUtXWs1gZ7JMg==",_location:"/async-hook-jl",_phantomChildren:{},_requested:{type:"range",registry:true,raw:"async-hook-jl@^1.7.6",name:"async-hook-jl",escapedName:"async-hook-jl",rawSpec:"^1.7.6",saveSpec:null,fetchSpec:"^1.7.6"},_requiredBy:["/cls-hooked"],_resolved:"https://registry.npmjs.org/async-hook-jl/-/async-hook-jl-1.7.6.tgz",_shasum:"4fd25c2f864dbaf279c610d73bf97b1b28595e68",_spec:"async-hook-jl@^1.7.6",_where:"/Users/prpendy/Work/android-app-size-diff/node_modules/cls-hooked",author:{name:"Andreas Madsen",email:"amwebdk@gmail.com"},bugs:{url:"https://github.com/jeff-lewis/async-hook-jl/issues"},bundleDependencies:false,dependencies:{"stack-chain":"^1.3.7"},deprecated:false,description:"Inspect the life of handle objects in node",devDependencies:{async:"1.5.x","cli-color":"1.1.x",endpoint:"0.4.x",eslint:"^3.4.0"},engines:{node:"^4.7 || >=6.9 || >=7.3"},homepage:"https://github.com/jeff-lewis/async-hook-jl#readme",keywords:["async","async hooks","inspect","async wrap"],license:"MIT",main:"./index.js",name:"async-hook-jl",repository:{type:"git",url:"git://github.com/jeff-lewis/async-hook-jl.git"},scripts:{test:"node ./test/runner.js && eslint ."},version:"1.7.6"}},669:function(e){e.exports=require("util")},671:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(RemoteDependencyData,e);function RemoteDependencyData(){var t=e.call(this)||this;t.ver=2;t.success=true;t.properties={};t.measurements={};return t}return RemoteDependencyData}(i);e.exports=o},686:function(e,t,n){"use strict";var r=n(747);var i=n(87);var o=n(622);var s=n(761);var a=n(129);var c=n(970);var u=n(366);var f=n(179);var l=function(){function Sender(e,t,n){this._config=e;this._onSuccess=t;this._onError=n;this._enableDiskRetryMode=false;this._resendInterval=Sender.WAIT_BETWEEN_RESEND;this._maxBytesOnDisk=Sender.MAX_BYTES_ON_DISK;this._numConsecutiveFailures=0;if(!Sender.OS_PROVIDES_FILE_PROTECTION){if(Sender.USE_ICACLS){try{Sender.OS_PROVIDES_FILE_PROTECTION=r.existsSync(Sender.ICACLS_PATH)}catch(e){}if(!Sender.OS_PROVIDES_FILE_PROTECTION){c.warn(Sender.TAG,"Could not find ICACLS in expected location! This is necessary to use disk retry mode on Windows.")}}else{Sender.OS_PROVIDES_FILE_PROTECTION=true}}}Sender.prototype.setDiskRetryMode=function(e,t,n){this._enableDiskRetryMode=Sender.OS_PROVIDES_FILE_PROTECTION&&e;if(typeof t==="number"&&t>=0){this._resendInterval=Math.floor(t)}if(typeof n==="number"&&n>=0){this._maxBytesOnDisk=Math.floor(n)}if(e&&!Sender.OS_PROVIDES_FILE_PROTECTION){this._enableDiskRetryMode=false;c.warn(Sender.TAG,"Ignoring request to enable disk retry mode. Sufficient file protection capabilities were not detected.")}};Sender.prototype.send=function(e,t){var n=this;var r=this._config.endpointUrl;var i={method:"POST",withCredentials:false,headers:{"Content-Type":"application/x-json-stream"}};s.gzip(e,function(o,s){var a=s;if(o){c.warn(o);a=e;i.headers["Content-Length"]=e.length.toString()}else{i.headers["Content-Encoding"]="gzip";i.headers["Content-Length"]=s.length}c.info(Sender.TAG,i);i[u.disableCollectionRequestOption]=true;var l=function(r){r.setEncoding("utf-8");var i="";r.on("data",function(e){i+=e});r.on("end",function(){n._numConsecutiveFailures=0;c.info(Sender.TAG,i);if(typeof n._onSuccess==="function"){n._onSuccess(i)}if(typeof t==="function"){t(i)}if(n._enableDiskRetryMode){if(r.statusCode===200){setTimeout(function(){return n._sendFirstFileOnDisk()},n._resendInterval).unref()}else if(r.statusCode===408||r.statusCode===429||r.statusCode===439||r.statusCode===500||r.statusCode===503){n._storeToDisk(e)}}})};var p=f.makeRequest(n._config,r,i,l);p.on("error",function(r){n._numConsecutiveFailures++;if(!n._enableDiskRetryMode||n._numConsecutiveFailures>0&&n._numConsecutiveFailures%Sender.MAX_CONNECTION_FAILURES_BEFORE_WARN===0){var i="Ingestion endpoint could not be reached. This batch of telemetry items has been lost. Use Disk Retry Caching to enable resending of failed telemetry. Error:";if(n._enableDiskRetryMode){i="Ingestion endpoint could not be reached "+n._numConsecutiveFailures+" consecutive times. There may be resulting telemetry loss. Most recent error:"}c.warn(Sender.TAG,i,r)}else{var i="Transient failure to reach ingestion endpoint. This batch of telemetry items will be retried. Error:";c.info(Sender.TAG,i,r)}n._onErrorHelper(r);if(typeof t==="function"){var o="error sending telemetry";if(r&&typeof r.toString==="function"){o=r.toString()}t(o)}if(n._enableDiskRetryMode){n._storeToDisk(e)}});p.write(a);p.end()})};Sender.prototype.saveOnCrash=function(e){if(this._enableDiskRetryMode){this._storeToDiskSync(e)}};Sender.prototype._runICACLS=function(e,t){var n=a.spawn(Sender.ICACLS_PATH,e,{windowsHide:true});n.on("error",function(e){return t(e)});n.on("close",function(e,n){return t(e===0?null:new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+e+")"))})};Sender.prototype._runICACLSSync=function(e){if(a.spawnSync){var t=a.spawnSync(Sender.ICACLS_PATH,e,{windowsHide:true});if(t.error){throw t.error}else if(t.status!==0){throw new Error("Setting ACL restrictions did not succeed (ICACLS returned code "+t.status+")")}}else{throw new Error("Could not synchronously call ICACLS under current version of Node.js")}};Sender.prototype._getACLIdentity=function(e){if(Sender.ACL_IDENTITY){return e(null,Sender.ACL_IDENTITY)}var t=a.spawn(Sender.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:true,stdio:["ignore","pipe","pipe"]});var n="";t.stdout.on("data",function(e){return n+=e});t.on("error",function(t){return e(t,null)});t.on("close",function(t,r){Sender.ACL_IDENTITY=n&&n.trim();return e(t===0?null:new Error("Getting ACL identity did not succeed (PS returned code "+t+")"),Sender.ACL_IDENTITY)})};Sender.prototype._getACLIdentitySync=function(){if(Sender.ACL_IDENTITY){return Sender.ACL_IDENTITY}if(a.spawnSync){var e=a.spawnSync(Sender.POWERSHELL_PATH,["-Command","[System.Security.Principal.WindowsIdentity]::GetCurrent().Name"],{windowsHide:true,stdio:["ignore","pipe","pipe"]});if(e.error){throw e.error}else if(e.status!==0){throw new Error("Getting ACL identity did not succeed (PS returned code "+e.status+")")}Sender.ACL_IDENTITY=e.stdout&&e.stdout.toString().trim();return Sender.ACL_IDENTITY}else{throw new Error("Could not synchronously get ACL identity under current version of Node.js")}};Sender.prototype._getACLArguments=function(e,t){return[e,"/grant","*S-1-5-32-544:(OI)(CI)F","/grant",t+":(OI)(CI)F","/inheritance:r"]};Sender.prototype._applyACLRules=function(e,t){var n=this;if(!Sender.USE_ICACLS){return t(null)}if(Sender.ACLED_DIRECTORIES[e]===undefined){Sender.ACLED_DIRECTORIES[e]=false;this._getACLIdentity(function(r,i){if(r){Sender.ACLED_DIRECTORIES[e]=false;return t(r)}else{n._runICACLS(n._getACLArguments(e,i),function(n){Sender.ACLED_DIRECTORIES[e]=!n;return t(n)})}})}else{return t(Sender.ACLED_DIRECTORIES[e]?null:new Error("Setting ACL restrictions did not succeed (cached result)"))}};Sender.prototype._applyACLRulesSync=function(e){if(Sender.USE_ICACLS){if(Sender.ACLED_DIRECTORIES[e]===undefined){this._runICACLSSync(this._getACLArguments(e,this._getACLIdentitySync()));Sender.ACLED_DIRECTORIES[e]=true;return}else if(!Sender.ACLED_DIRECTORIES[e]){throw new Error("Setting ACL restrictions did not succeed (cached result)")}}};Sender.prototype._confirmDirExists=function(e,t){var n=this;r.lstat(e,function(i,o){if(i&&i.code==="ENOENT"){r.mkdir(e,function(r){if(r&&r.code!=="EEXIST"){t(r)}else{n._applyACLRules(e,t)}})}else if(!i&&o.isDirectory()){n._applyACLRules(e,t)}else{t(i||new Error("Path existed but was not a directory"))}})};Sender.prototype._getShallowDirectorySize=function(e,t){r.readdir(e,function(n,i){if(n){return t(n,-1)}var s=null;var a=0;var c=0;if(i.length===0){t(null,0);return}for(var u=0;ut._maxBytesOnDisk){c.warn(Sender.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+s);return}var a=(new Date).getTime()+".ai.json";var u=o.join(n,a);c.info(Sender.TAG,"saving data to disk at: "+u);r.writeFile(u,e,{mode:384},function(e){return t._onErrorHelper(e)})})})};Sender.prototype._storeToDiskSync=function(e){var t=o.join(i.tmpdir(),Sender.TEMPDIR_PREFIX+this._config.instrumentationKey);try{c.info(Sender.TAG,"Checking existance of data storage directory: "+t);if(!r.existsSync(t)){r.mkdirSync(t)}this._applyACLRulesSync(t);var n=this._getShallowDirectorySizeSync(t);if(n>this._maxBytesOnDisk){c.info(Sender.TAG,"Not saving data due to max size limit being met. Directory size in bytes is: "+n);return}var s=(new Date).getTime()+".ai.json";var a=o.join(t,s);c.info(Sender.TAG,"saving data before crash to disk at: "+a);r.writeFileSync(a,e,{mode:384})}catch(e){c.warn(Sender.TAG,"Error while saving data to disk: "+(e&&e.message));this._onErrorHelper(e)}};Sender.prototype._sendFirstFileOnDisk=function(){var e=this;var t=o.join(i.tmpdir(),Sender.TEMPDIR_PREFIX+this._config.instrumentationKey);r.exists(t,function(n){if(n){r.readdir(t,function(n,i){if(!n){i=i.filter(function(e){return o.basename(e).indexOf(".ai.json")>-1});if(i.length>0){var s=i[0];var a=o.join(t,s);r.readFile(a,function(t,n){if(!t){r.unlink(a,function(t){if(!t){e.send(n)}else{e._onErrorHelper(t)}})}else{e._onErrorHelper(t)}})}}else{e._onErrorHelper(n)}})}})};Sender.prototype._onErrorHelper=function(e){if(typeof this._onError==="function"){this._onError(e)}};Sender.TAG="Sender";Sender.ICACLS_PATH=process.env.systemdrive+"/windows/system32/icacls.exe";Sender.POWERSHELL_PATH=process.env.systemdrive+"/windows/system32/windowspowershell/v1.0/powershell.exe";Sender.ACLED_DIRECTORIES={};Sender.ACL_IDENTITY=null;Sender.WAIT_BETWEEN_RESEND=60*1e3;Sender.MAX_BYTES_ON_DISK=50*1e3*1e3;Sender.MAX_CONNECTION_FAILURES_BEFORE_WARN=5;Sender.TEMPDIR_PREFIX="appInsights-node";Sender.OS_PROVIDES_FILE_PROTECTION=false;Sender.USE_ICACLS=i.type()==="Windows_NT";return Sender}();e.exports=l},701:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DEFAULT_BREEZE_ENDPOINT="https://dc.services.visualstudio.com";t.DEFAULT_LIVEMETRICS_ENDPOINT="https://rt.services.visualstudio.com";t.DEFAULT_LIVEMETRICS_HOST="rt.services.visualstudio.com";var n;(function(e){e["COMMITTED_BYTES"]="\\Memory\\Committed Bytes";e["PROCESSOR_TIME"]="\\Processor(_Total)\\% Processor Time";e["REQUEST_RATE"]="\\ApplicationInsights\\Requests/Sec";e["REQUEST_FAILURE_RATE"]="\\ApplicationInsights\\Requests Failed/Sec";e["REQUEST_DURATION"]="\\ApplicationInsights\\Request Duration";e["DEPENDENCY_RATE"]="\\ApplicationInsights\\Dependency Calls/Sec";e["DEPENDENCY_FAILURE_RATE"]="\\ApplicationInsights\\Dependency Calls Failed/Sec";e["DEPENDENCY_DURATION"]="\\ApplicationInsights\\Dependency Call Duration";e["EXCEPTION_RATE"]="\\ApplicationInsights\\Exceptions/Sec"})(n=t.QuickPulseCounter||(t.QuickPulseCounter={}));var r;(function(e){e["PRIVATE_BYTES"]="\\Process(??APP_WIN32_PROC??)\\Private Bytes";e["AVAILABLE_BYTES"]="\\Memory\\Available Bytes";e["PROCESSOR_TIME"]="\\Processor(_Total)\\% Processor Time";e["PROCESS_TIME"]="\\Process(??APP_WIN32_PROC??)\\% Processor Time";e["REQUEST_RATE"]="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Requests/Sec";e["REQUEST_DURATION"]="\\ASP.NET Applications(??APP_W3SVC_PROC??)\\Request Execution Time"})(r=t.PerformanceCounter||(t.PerformanceCounter={}));t.PerformanceToQuickPulseCounter=(i={},i[r.PROCESSOR_TIME]=n.PROCESSOR_TIME,i[r.REQUEST_RATE]=n.REQUEST_RATE,i[r.REQUEST_DURATION]=n.REQUEST_DURATION,i[n.COMMITTED_BYTES]=n.COMMITTED_BYTES,i[n.REQUEST_FAILURE_RATE]=n.REQUEST_FAILURE_RATE,i[n.DEPENDENCY_RATE]=n.DEPENDENCY_RATE,i[n.DEPENDENCY_FAILURE_RATE]=n.DEPENDENCY_FAILURE_RATE,i[n.DEPENDENCY_DURATION]=n.DEPENDENCY_DURATION,i[n.EXCEPTION_RATE]=n.EXCEPTION_RATE,i);t.QuickPulseDocumentType={Event:"Event",Exception:"Exception",Trace:"Trace",Metric:"Metric",Request:"Request",Dependency:"RemoteDependency",Availability:"Availability"};t.QuickPulseType={Event:"EventTelemetryDocument",Exception:"ExceptionTelemetryDocument",Trace:"TraceTelemetryDocument",Metric:"MetricTelemetryDocument",Request:"RequestTelemetryDocument",Dependency:"DependencyTelemetryDocument",Availability:"AvailabilityTelemetryDocument"};t.TelemetryTypeStringToQuickPulseType={EventData:t.QuickPulseType.Event,ExceptionData:t.QuickPulseType.Exception,MessageData:t.QuickPulseType.Trace,MetricData:t.QuickPulseType.Metric,RequestData:t.QuickPulseType.Request,RemoteDependencyData:t.QuickPulseType.Dependency,AvailabilityData:t.QuickPulseType.Availability};t.TelemetryTypeStringToQuickPulseDocumentType={EventData:t.QuickPulseDocumentType.Event,ExceptionData:t.QuickPulseDocumentType.Exception,MessageData:t.QuickPulseDocumentType.Trace,MetricData:t.QuickPulseDocumentType.Metric,RequestData:t.QuickPulseDocumentType.Request,RemoteDependencyData:t.QuickPulseDocumentType.Dependency,AvailabilityData:t.QuickPulseDocumentType.Availability};var i},708:function(e,t,n){"use strict";var r=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const i=r(n(747));const o=r(n(669));class FilesSizeCalculator{getFilesSize(e){var t=0;if(!o.isNullOrUndefined(e)){e.forEach(e=>{t+=this.getFileSize(e)})}return t}getFileSize(e){const t=i.statSync(e);return t["size"]}}t.FilesSizeCalculator=FilesSizeCalculator},716:function(e,t,n){"use strict";var r=n(294);var i=function(){function AutoCollectConsole(e){if(!!AutoCollectConsole.INSTANCE){throw new Error("Console logging adapter tracking should be configured from the applicationInsights object")}this._client=e;AutoCollectConsole.INSTANCE=this}AutoCollectConsole.prototype.enable=function(e,t){if(r.IsInitialized){n(593).enable(e&&t,this._client);n(5).enable(e,this._client);n(151).enable(e,this._client)}};AutoCollectConsole.prototype.isInitialized=function(){return this._isInitialized};AutoCollectConsole.prototype.dispose=function(){AutoCollectConsole.INSTANCE=null;this.enable(false,false)};AutoCollectConsole._methodNames=["debug","info","log","warn","error"];return AutoCollectConsole}();e.exports=i},718:function(e,t,n){var r=n(519).require(),i=n(622);r.existsSync=r.existsSync||i.existsSync;e.exports=function(e){var t=e||"",n=0,o=newAttr(),s=null;function newAttr(){return{directory:false,readonly:false,hidden:false,executable:false,mtime:0,atime:0}}if(t&&r.existsSync(t)){s=r.statSync(t);o.directory=s.isDirectory();o.mtime=s.mtime;o.atime=s.atime;o.executable=!!(1&parseInt((s.mode&parseInt("777",8)).toString(8)[0]));o.readonly=!!(2&parseInt((s.mode&parseInt("777",8)).toString(8)[0]));o.hidden=i.basename(t)[0]==="."}else{console.warn("Invalid path: "+t)}return{get directory(){return o.directory},get readOnly(){return o.readonly},get hidden(){return o.hidden},get mtime(){return o.mtime},get atime(){return o.atime},get executable(){return o.executable},decodeAttributes:function(e){},encodeAttributes:function(e){},toString:function(){return"{\n"+'\t"path" : "'+t+",\n"+'\t"isDirectory" : '+o.directory+",\n"+'\t"isReadOnly" : '+o.readonly+",\n"+'\t"isHidden" : '+o.hidden+",\n"+'\t"isExecutable" : '+o.executable+",\n"+'\t"mTime" : '+o.mtime+"\n"+'\t"aTime" : '+o.atime+"\n"+"}"}}}},721:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=[];t.subscriber=function(e){i.forEach(function(t){if(e.data.commandObj.command==="info"){return}t.trackDependency({target:e.data.address,name:e.data.commandObj.command,data:e.data.commandObj.command,duration:e.data.duration,success:!e.data.err,resultCode:e.data.err?"1":"0",dependencyTypeName:"redis"})})};function enable(e,n){if(e){if(i.length===0){r.channel.subscribe("redis",t.subscriber)}i.push(n)}else{i=i.filter(function(e){return e!=n});if(i.length===0){r.channel.unsubscribe("redis",t.subscriber)}}}t.enable=enable},724:function(e,t,n){"use strict";const r=n(669);const i=n(357);const o=n(848);const s=n(303);const a="cls@contexts";const c="error@context";const u=process.env.DEBUG_CLS_HOOKED;let f=-1;e.exports={getNamespace:getNamespace,createNamespace:createNamespace,destroyNamespace:destroyNamespace,reset:reset,ERROR_SYMBOL:c};function Namespace(e){this.name=e;this.active=null;this._set=[];this.id=null;this._contexts=new Map;this._indent=0}Namespace.prototype.set=function set(e,t){if(!this.active){throw new Error("No context available. ns.run() or ns.bind() must be called first.")}this.active[e]=t;if(u){const n=" ".repeat(this._indent<0?0:this._indent);debug2(n+"CONTEXT-SET KEY:"+e+"="+t+" in ns:"+this.name+" currentUid:"+f+" active:"+r.inspect(this.active,{showHidden:true,depth:2,colors:true}))}return t};Namespace.prototype.get=function get(e){if(!this.active){if(u){const t=s.currentId();const n=s.triggerAsyncId();const r=" ".repeat(this._indent<0?0:this._indent);debug2(`${r}CONTEXT-GETTING KEY NO ACTIVE NS: (${this.name}) ${e}=undefined currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length}`)}return undefined}if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(i+"CONTEXT-GETTING KEY:"+e+"="+this.active[e]+" ("+this.name+") currentUid:"+f+" active:"+r.inspect(this.active,{showHidden:true,depth:2,colors:true}));debug2(`${i}CONTEXT-GETTING KEY: (${this.name}) ${e}=${this.active[e]} currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} active:${r.inspect(this.active)}`)}return this.active[e]};Namespace.prototype.createContext=function createContext(){let e=Object.create(this.active?this.active:Object.prototype);e._ns_name=this.name;e.id=f;if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-CREATED Context: (${this.name}) currentUid:${f} asyncHooksCurrentId:${t} triggerId:${n} len:${this._set.length} context:${r.inspect(e,{showHidden:true,depth:2,colors:true})}`)}return e};Namespace.prototype.run=function run(e){let t=this.createContext();this.enter(t);try{if(u){const e=s.triggerAsyncId();const n=s.executionAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-RUN BEGIN: (${this.name}) currentUid:${f} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} context:${r.inspect(t)}`)}e(t);return t}catch(e){if(e){e[c]=t}throw e}finally{if(u){const e=s.triggerAsyncId();const n=s.executionAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-RUN END: (${this.name}) currentUid:${f} triggerId:${e} asyncHooksCurrentId:${n} len:${this._set.length} ${r.inspect(t)}`)}this.exit(t)}};Namespace.prototype.runAndReturn=function runAndReturn(e){let t;this.run(function(n){t=e(n)});return t};Namespace.prototype.runPromise=function runPromise(e){let t=this.createContext();this.enter(t);let n=e(t);if(!n||!n.then||!n.catch){throw new Error("fn must return a promise.")}if(u){debug2("CONTEXT-runPromise BEFORE: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}return n.then(e=>{if(u){debug2("CONTEXT-runPromise AFTER then: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);return e}).catch(e=>{e[c]=t;if(u){debug2("CONTEXT-runPromise AFTER catch: ("+this.name+") currentUid:"+f+" len:"+this._set.length+" "+r.inspect(t))}this.exit(t);throw e})};Namespace.prototype.bind=function bindFactory(e,t){if(!t){if(!this.active){t=this.createContext()}else{t=this.active}}let n=this;return function clsBind(){n.enter(t);try{return e.apply(this,arguments)}catch(e){if(e){e[c]=t}throw e}finally{n.exit(t)}}};Namespace.prototype.enter=function enter(e){i.ok(e,"context must be provided for entering");if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-ENTER: (${this.name}) currentUid:${f} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}this._set.push(this.active);this.active=e};Namespace.prototype.exit=function exit(e){i.ok(e,"context must be provided for exiting");if(u){const t=s.executionAsyncId();const n=s.triggerAsyncId();const i=" ".repeat(this._indent<0?0:this._indent);debug2(`${i}CONTEXT-EXIT: (${this.name}) currentUid:${f} triggerId:${n} asyncHooksCurrentId:${t} len:${this._set.length} ${r.inspect(e)}`)}if(this.active===e){i.ok(this._set.length,"can't remove top context");this.active=this._set.pop();return}let t=this._set.lastIndexOf(e);if(t<0){if(u){debug2("??ERROR?? context exiting but not entered - ignoring: "+r.inspect(e))}i.ok(t>=0,"context not currently entered; can't exit. \n"+r.inspect(this)+"\n"+r.inspect(e))}else{i.ok(t,"can't remove top context");this._set.splice(t,1)}};Namespace.prototype.bindEmitter=function bindEmitter(e){i.ok(e.on&&e.addListener&&e.emit,"can only bind real EEs");let t=this;let n="context@"+this.name;function attach(e){if(!e){return}if(!e[a]){e[a]=Object.create(null)}e[a][n]={namespace:t,context:t.active}}function bind(e){if(!(e&&e[a])){return e}let t=e;let n=e[a];Object.keys(n).forEach(function(e){let r=n[e];t=r.namespace.bind(t,r.context)});return t}o(e,attach,bind)};Namespace.prototype.fromException=function fromException(e){return e[c]};function getNamespace(e){return process.namespaces[e]}function createNamespace(e){i.ok(e,"namespace must be given a name.");if(u){debug2(`NS-CREATING NAMESPACE (${e})`)}let t=new Namespace(e);t.id=f;const n=s.createHook({init(n,i,o,a){f=s.executionAsyncId();if(t.active){t._contexts.set(n,t.active);if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(f===0){const o=s.triggerAsyncId();const c=t._contexts.get(o);if(c){t._contexts.set(n,c);if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT USING CONTEXT FROM TRIGGERID [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}else if(u){const s=" ".repeat(t._indent<0?0:t._indent);debug2(`${s}INIT MISSING CONTEXT [${i}] (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}}if(u&&i==="PROMISE"){debug2(r.inspect(a,{showHidden:true}));const s=a.parentId;const c=" ".repeat(t._indent<0?0:t._indent);debug2(`${c}INIT RESOURCE-PROMISE [${i}] (${e}) parentId:${s} asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} resource:${a}`)}},before(n){f=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(f);if(i){if(u){const o=s.triggerAsyncId();const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}BEFORE (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`);t._indent+=2}t.enter(i)}else if(u){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);debug2(`${o}BEFORE MISSING CONTEXT (${e}) asyncId:${n} currentUid:${f} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} namespace._contexts:${r.inspect(t._contexts,{showHidden:true,depth:2,colors:true})}`);t._indent+=2}},after(n){f=s.executionAsyncId();let i;i=t._contexts.get(n)||t._contexts.get(f);if(i){if(u){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}AFTER (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}t.exit(i)}else if(u){const o=s.triggerAsyncId();t._indent-=2;const a=" ".repeat(t._indent<0?0:t._indent);debug2(`${a}AFTER MISSING CONTEXT (${e}) asyncId:${n} currentUid:${f} triggerId:${o} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(i)}`)}},destroy(n){f=s.executionAsyncId();if(u){const i=s.triggerAsyncId();const o=" ".repeat(t._indent<0?0:t._indent);debug2(`${o}DESTROY (${e}) currentUid:${f} asyncId:${n} triggerId:${i} active:${r.inspect(t.active,{showHidden:true,depth:2,colors:true})} context:${r.inspect(t._contexts.get(f))}`)}t._contexts.delete(n)}});n.enable();process.namespaces[e]=t;return t}function destroyNamespace(e){let t=getNamespace(e);i.ok(t,"can't delete nonexistent namespace! \""+e+'"');i.ok(t.id,"don't assign to process.namespaces directly! "+r.inspect(t));process.namespaces[e]=null}function reset(){if(process.namespaces){Object.keys(process.namespaces).forEach(function(e){destroyNamespace(e)})}process.namespaces=Object.create(null)}process.namespaces={};function debug2(...e){if(u){process._rawDebug(`${r.format(...e)}`)}}},733:function(e,t,n){"use strict";var r=n(970);var i=n(39);var o=n(8);var s=n(635);var a=n(701);var c=n(485);var u=function(){function QuickPulseStateManager(e,t){this._isCollectingData=false;this._lastSuccessTime=Date.now();this._lastSendSucceeded=true;this._metrics={};this._documents=[];this._collectors=[];this.config=new i(e);this.context=t||new c;this._sender=new s(this.config);this._isEnabled=false}QuickPulseStateManager.prototype.addCollector=function(e){this._collectors.push(e)};QuickPulseStateManager.prototype.trackMetric=function(e){this._addMetric(e)};QuickPulseStateManager.prototype.addDocument=function(e){var t=o.telemetryEnvelopeToQuickPulseDocument(e);if(t){this._documents.push(t)}};QuickPulseStateManager.prototype.enable=function(e){if(e&&!this._isEnabled){this._isEnabled=true;this._goQuickPulse()}else if(!e&&this._isEnabled){this._isEnabled=false;clearTimeout(this._handle);this._handle=undefined}};QuickPulseStateManager.prototype.enableCollectors=function(e){this._collectors.forEach(function(t){t.enable(e)})};QuickPulseStateManager.prototype._addMetric=function(e){var t=e.value;var n=e.count||1;var r=a.PerformanceToQuickPulseCounter[e.name];if(r){if(this._metrics[r]){this._metrics[r].Value=(this._metrics[r].Value*this._metrics[r].Weight+t*n)/(this._metrics[r].Weight+n);this._metrics[r].Weight+=n}else{this._metrics[r]=o.createQuickPulseMetric(e);this._metrics[r].Name=r;this._metrics[r].Weight=1}}};QuickPulseStateManager.prototype._resetQuickPulseBuffer=function(){delete this._metrics;this._metrics={};this._documents.length=0};QuickPulseStateManager.prototype._goQuickPulse=function(){var e=this;var t=Object.keys(this._metrics).map(function(t){return e._metrics[t]});var n=o.createQuickPulseEnvelope(t,this._documents.slice(),this.config,this.context);this._resetQuickPulseBuffer();if(this._isCollectingData){this._post(n)}else{this._ping(n)}var r=this._isCollectingData?QuickPulseStateManager.POST_INTERVAL:QuickPulseStateManager.PING_INTERVAL;if(this._isCollectingData&&Date.now()-this._lastSuccessTime>=QuickPulseStateManager.MAX_POST_WAIT_TIME&&!this._lastSendSucceeded){this._isCollectingData=false;r=QuickPulseStateManager.FALLBACK_INTERVAL}else if(!this._isCollectingData&&Date.now()-this._lastSuccessTime>=QuickPulseStateManager.MAX_PING_WAIT_TIME&&!this._lastSendSucceeded){r=QuickPulseStateManager.FALLBACK_INTERVAL}this._lastSendSucceeded=null;this._handle=setTimeout(this._goQuickPulse.bind(this),r);this._handle.unref()};QuickPulseStateManager.prototype._ping=function(e){this._sender.ping(e,this._quickPulseDone.bind(this))};QuickPulseStateManager.prototype._post=function(e){this._sender.post(e,this._quickPulseDone.bind(this))};QuickPulseStateManager.prototype._quickPulseDone=function(e,t){if(e!=undefined){if(this._isCollectingData!==e){r.info("Live Metrics sending data",e);this.enableCollectors(e)}this._isCollectingData=e;if(t&&t.statusCode<300&&t.statusCode>=200){this._lastSuccessTime=Date.now();this._lastSendSucceeded=true}else{this._lastSendSucceeded=false}}else{this._lastSendSucceeded=false}};QuickPulseStateManager.MAX_POST_WAIT_TIME=2e4;QuickPulseStateManager.MAX_PING_WAIT_TIME=6e4;QuickPulseStateManager.FALLBACK_INTERVAL=6e4;QuickPulseStateManager.PING_INTERVAL=5e3;QuickPulseStateManager.POST_INTERVAL=1e3;return QuickPulseStateManager}();e.exports=u},737:function(e,t,n){"use strict";const r=n(213);function TimeoutWrap(){}function IntervalWrap(){}function ImmediateWrap(){}const i=new Map;const o=new Map;const s=new Map;let a=null;let c=false;e.exports=function patch(){patchTimer(this._hooks,this._state,"setTimeout","clearTimeout",TimeoutWrap,i,true);patchTimer(this._hooks,this._state,"setInterval","clearInterval",IntervalWrap,o,false);patchTimer(this._hooks,this._state,"setImmediate","clearImmediate",ImmediateWrap,s,true);global.setTimeout=r.setTimeout;global.setInterval=r.setInterval;global.setImmediate=r.setImmediate;global.clearTimeout=r.clearTimeout;global.clearInterval=r.clearInterval;global.clearImmediate=r.clearImmediate};function patchTimer(e,t,n,i,o,s,u){const f=r[n];const l=r[i];r[n]=function(){if(!t.enabled)return f.apply(r,arguments);const n=new Array(arguments.length);for(let e=0;e0){process.once("uncaughtException",function(){e.post.call(l,p,true);s.delete(d);e.destroy.call(null,p)})}}e.post.call(l,p,false);a=null;if(u||c){c=false;s.delete(d);e.destroy.call(null,p)}};d=f.apply(r,n);s.set(d,p);return d};r[i]=function(t){if(a===t&&t!==null){c=true}else if(s.has(t)){const n=s.get(t);s.delete(t);e.destroy.call(null,n)}l.apply(r,arguments)}}},747:function(e){e.exports=require("fs")},753:function(e,t,n){"use strict";var r=n(701);var i=function(){function ConnectionStringParser(){}ConnectionStringParser.parse=function(e){if(!e){return{}}var t=e.split(ConnectionStringParser._FIELDS_SEPARATOR);var n=t.reduce(function(e,t){var n=t.split(ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR);if(n.length===2){var r=n[0].toLowerCase();var i=n[1];e[r]=i}return e},{});if(Object.keys(n).length>0){if(n.endpointsuffix){var i=n.location?n.location+".":"";n.ingestionendpoint=n.ingestionendpoint||"https://"+i+"dc."+n.endpointsuffix;n.liveendpoint=n.liveendpoint||"https://"+i+"live."+n.endpointsuffix}n.ingestionendpoint=n.ingestionendpoint||r.DEFAULT_BREEZE_ENDPOINT;n.liveendpoint=n.liveendpoint||r.DEFAULT_LIVEMETRICS_ENDPOINT}return n};ConnectionStringParser._FIELDS_SEPARATOR=";";ConnectionStringParser._FIELD_KEY_VALUE_SEPARATOR="=";return ConnectionStringParser}();e.exports=i},761:function(e){e.exports=require("zlib")},764:function(e){"use strict";function NextTickWrap(){}e.exports=function patch(){const e=this._hooks;const t=this._state;const n=process.nextTick;process.nextTick=function(){if(!t.enabled)return n.apply(process,arguments);const r=new Array(arguments.length);for(let e=0;e0){process.once("uncaughtException",function(){e.post.call(o,s,true);e.destroy.call(null,s)})}}e.post.call(o,s,false);e.destroy.call(null,s)};return n.apply(process,r)}}},769:function(e,t,n){"use strict";var r=n(179);var i=n(970);var o=function(){function CorrelationIdManager(){}CorrelationIdManager.queryCorrelationId=function(e,t){var n=e.profileQueryEndpoint+"/api/profiles/"+e.instrumentationKey+"/appId";if(CorrelationIdManager.completedLookups.hasOwnProperty(n)){t(CorrelationIdManager.completedLookups[n]);return}else if(CorrelationIdManager.pendingLookups[n]){CorrelationIdManager.pendingLookups[n].push(t);return}CorrelationIdManager.pendingLookups[n]=[t];var o=function(){if(!CorrelationIdManager.pendingLookups[n]){return}var t={method:"GET",disableAppInsightsAutoCollection:true};i.info(CorrelationIdManager.TAG,t);var s=r.makeRequest(e,n,t,function(t){if(t.statusCode===200){var r="";t.setEncoding("utf-8");t.on("data",function(e){r+=e});t.on("end",function(){i.info(CorrelationIdManager.TAG,r);var e=CorrelationIdManager.correlationIdPrefix+r;CorrelationIdManager.completedLookups[n]=e;if(CorrelationIdManager.pendingLookups[n]){CorrelationIdManager.pendingLookups[n].forEach(function(t){return t(e)})}delete CorrelationIdManager.pendingLookups[n]})}else if(t.statusCode>=400&&t.statusCode<500){CorrelationIdManager.completedLookups[n]=undefined;delete CorrelationIdManager.pendingLookups[n]}else{setTimeout(o,e.correlationIdRetryIntervalMs)}});if(s){s.on("error",function(e){i.warn(CorrelationIdManager.TAG,e)});s.end()}};setTimeout(o,0)};CorrelationIdManager.cancelCorrelationIdQuery=function(e,t){var n=e.profileQueryEndpoint+"/api/profiles/"+e.instrumentationKey+"/appId";var r=CorrelationIdManager.pendingLookups[n];if(r){CorrelationIdManager.pendingLookups[n]=r.filter(function(e){return e!=t});if(CorrelationIdManager.pendingLookups[n].length==0){delete CorrelationIdManager.pendingLookups[n]}}};CorrelationIdManager.generateRequestId=function(e){if(e){e=e[0]=="|"?e:"|"+e;if(e[e.length-1]!=="."){e+="."}var t=(CorrelationIdManager.currentRootId++).toString(16);return CorrelationIdManager.appendSuffix(e,t,"_")}else{return CorrelationIdManager.generateRootId()}};CorrelationIdManager.getRootId=function(e){var t=e.indexOf(".");if(t<0){t=e.length}var n=e[0]==="|"?1:0;return e.substring(n,t)};CorrelationIdManager.generateRootId=function(){return"|"+r.w3cTraceId()+"."};CorrelationIdManager.appendSuffix=function(e,t,n){if(e.length+t.lengthi){for(;i>1;--i){var o=e[i-1];if(o==="."||o==="_"){break}}}if(i<=1){return CorrelationIdManager.generateRootId()}t=r.randomu32().toString(16);while(t.length<8){t="0"+t}return e.substring(0,i)+t+"#"};CorrelationIdManager.TAG="CorrelationIdManager";CorrelationIdManager.correlationIdPrefix="cid-v1:";CorrelationIdManager.w3cEnabled=false;CorrelationIdManager.pendingLookups={};CorrelationIdManager.completedLookups={};CorrelationIdManager.requestIdMaxLength=1024;CorrelationIdManager.currentRootId=r.randomu32();return CorrelationIdManager}();e.exports=o},771:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});class ComparisionReport{constructor(){this.baseApkLabel="";this.targetApkLabel="";this.comparisionMetrics=[]}}t.default=ComparisionReport},790:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(ExceptionData,e);function ExceptionData(){var t=e.call(this)||this;t.ver=2;t.exceptions=[];t.properties={};t.measurements={};return t}return ExceptionData}(i);e.exports=o},799:function(e){e.exports={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed",FILE_IN_THE_WAY:"There is a file in the way: %s",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:"File not found: %s",NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found"}},802:function(e,t,n){var r=n(967),i=n(864),o=n(402);e.exports=function(e,t){var n=[],s={},a=Buffer.alloc(0),c="",u=o.FileSystem.require(),f=null,l=new i.MainHeader;if(t===o.Constants.FILE){c=e;f=u.readFileSync(c);readMainHeader()}else if(t===o.Constants.BUFFER){f=e;readMainHeader()}else{}function readEntries(){s={};n=new Array(l.diskEntries);var e=l.offset;for(var t=0;t=t;e--){if(f[e]!==80)continue;if(f.readUInt32LE(e)===o.Constants.ENDSIG){n=e;break}}if(!~n)throw o.Errors.INVALID_FORMAT;l.loadFromBinary(f.slice(n,n+o.Constants.ENDHDR));if(l.commentLength){a=f.slice(n+o.Constants.ENDHDR)}readEntries()}return{get entries(){return n},get comment(){return a.toString()},set comment(e){l.commentLength=e.length;a=e},getEntry:function(e){return s[e]||null},setEntry:function(e){n.push(e);s[e.entryName]=e;l.totalEntries=n.length},deleteEntry:function(e){var t=s[e];if(t&&t.isDirectory){var r=this;this.getEntryChildren(t).forEach(function(t){if(t.entryName!==e){r.deleteEntry(t.entryName)}})}n.splice(n.indexOf(t),1);delete s[e];l.totalEntries=n.length},getEntryChildren:function(e){if(e.isDirectory){var t=[],r=e.entryName,i=r.length;n.forEach(function(e){if(e.entryName.substr(0,i)===r){t.push(e)}});return t}return[]},compressToBuffer:function(){if(n.length>1){n.sort(function(e,t){var n=e.entryName.toLowerCase();var r=t.entryName.toLowerCase();if(nr){return 1}return 0})}var e=0,t=[],r=[],i=0;l.size=0;l.offset=0;n.forEach(function(n){var o=n.getCompressedData();n.header.offset=i;var s=n.header.dataHeaderToBinary();var a=n.rawEntryName.length;var c=n.extra.toString();var u=Buffer.alloc(a+c.length);n.rawEntryName.copy(u,0);u.fill(c,a);var f=s.length+u.length+o.length;i+=f;t.push(s);t.push(u);t.push(o);var p=n.packHeader();r.push(p);l.size+=p.length;e+=f+p.length});e+=l.mainHeaderSize;l.offset=i;i=0;var s=Buffer.alloc(e);t.forEach(function(e){e.copy(s,i);i+=e.length});r.forEach(function(e){e.copy(s,i);i+=e.length});var c=l.toBinary();if(a){a.copy(c,o.Constants.ENDHDR)}c.copy(s,i);return s},toAsyncBuffer:function(e,t,r,i){if(n.length>1){n.sort(function(e,t){var n=e.entryName.toLowerCase();var r=t.entryName.toLowerCase();if(n>r){return-1}if(n0)_process(e,i)}function _wrap(e,t){if(!e)return;var n=e;if(typeof e==="function"){n=t(e)}else if(Array.isArray(e)){n=[];for(var r=0;r32)return null;for(var i=0,o=r;i>1}setTime(+new Date);return{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return n},set flags(e){n=e},get method(){return o},set method(e){o=e},get time(){return new Date((s>>25&127)+1980,(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(s&31)<<1)},set time(e){setTime(e)},get crc(){return a},set crc(e){a=e},get compressedSize(){return c},set compressedSize(e){c=e},get size(){return u},set size(e){u=e},get fileNameLength(){return f},set fileNameLength(e){f=e},get extraLength(){return l},set extraLength(e){l=e},get commentLength(){return p},set commentLength(e){p=e},get diskNumStart(){return d},set diskNumStart(e){d=e},get inAttr(){return h},set inAttr(e){h=e},get attr(){return v},set attr(e){v=e},get offset(){return y},set offset(e){y=e},get encripted(){return(n&1)===1},get entryHeaderSize(){return i.CENHDR+f+l+p},get realDataOffset(){return y+i.LOCHDR+g.fnameLen+g.extraLen},get dataHeader(){return g},loadDataHeaderFromBinary:function(e){var t=e.slice(y,y+i.LOCHDR);if(t.readUInt32LE(0)!==i.LOCSIG){throw r.Errors.INVALID_LOC}g={version:t.readUInt16LE(i.LOCVER),flags:t.readUInt16LE(i.LOCFLG),method:t.readUInt16LE(i.LOCHOW),time:t.readUInt32LE(i.LOCTIM),crc:t.readUInt32LE(i.LOCCRC),compressedSize:t.readUInt32LE(i.LOCSIZ),size:t.readUInt32LE(i.LOCLEN),fnameLen:t.readUInt16LE(i.LOCNAM),extraLen:t.readUInt16LE(i.LOCEXT)}},loadFromBinary:function(g){if(g.length!==i.CENHDR||g.readUInt32LE(0)!==i.CENSIG){throw r.Errors.INVALID_CEN}e=g.readUInt16LE(i.CENVEM);t=g.readUInt16LE(i.CENVER);n=g.readUInt16LE(i.CENFLG);o=g.readUInt16LE(i.CENHOW);s=g.readUInt32LE(i.CENTIM);a=g.readUInt32LE(i.CENCRC);c=g.readUInt32LE(i.CENSIZ);u=g.readUInt32LE(i.CENLEN);f=g.readUInt16LE(i.CENNAM);l=g.readUInt16LE(i.CENEXT);p=g.readUInt16LE(i.CENCOM);d=g.readUInt16LE(i.CENDSK);h=g.readUInt16LE(i.CENATT);v=g.readUInt32LE(i.CENATX);y=g.readUInt32LE(i.CENOFF)},dataHeaderToBinary:function(){var e=Buffer.alloc(i.LOCHDR);e.writeUInt32LE(i.LOCSIG,0);e.writeUInt16LE(t,i.LOCVER);e.writeUInt16LE(n,i.LOCFLG);e.writeUInt16LE(o,i.LOCHOW);e.writeUInt32LE(s,i.LOCTIM);e.writeUInt32LE(a,i.LOCCRC);e.writeUInt32LE(c,i.LOCSIZ);e.writeUInt32LE(u,i.LOCLEN);e.writeUInt16LE(f,i.LOCNAM);e.writeUInt16LE(l,i.LOCEXT);return e},entryHeaderToBinary:function(){var r=Buffer.alloc(i.CENHDR+f+l+p);r.writeUInt32LE(i.CENSIG,0);r.writeUInt16LE(e,i.CENVEM);r.writeUInt16LE(t,i.CENVER);r.writeUInt16LE(n,i.CENFLG);r.writeUInt16LE(o,i.CENHOW);r.writeUInt32LE(s,i.CENTIM);r.writeInt32LE(a&65535,i.CENCRC,true);r.writeUInt32LE(c,i.CENSIZ);r.writeUInt32LE(u,i.CENLEN);r.writeUInt16LE(f,i.CENNAM);r.writeUInt16LE(l,i.CENEXT);r.writeUInt16LE(p,i.CENCOM);r.writeUInt16LE(d,i.CENDSK);r.writeUInt16LE(h,i.CENATT);r.writeUInt32LE(v,i.CENATX);r.writeUInt32LE(y,i.CENOFF);r.fill(0,i.CENHDR);return r},toString:function(){return"{\n"+'\t"made" : '+e+",\n"+'\t"version" : '+t+",\n"+'\t"flags" : '+n+",\n"+'\t"method" : '+r.methodToString(o)+",\n"+'\t"time" : '+this.time+",\n"+'\t"crc" : 0x'+a.toString(16).toUpperCase()+",\n"+'\t"compressedSize" : '+c+" bytes,\n"+'\t"size" : '+u+" bytes,\n"+'\t"fileNameLength" : '+f+",\n"+'\t"extraLength" : '+l+" bytes,\n"+'\t"commentLength" : '+p+" bytes,\n"+'\t"diskNumStart" : '+d+",\n"+'\t"inAttr" : '+h+",\n"+'\t"attr" : '+v+",\n"+'\t"offset" : '+y+",\n"+'\t"entryHeaderSize" : '+(i.CENHDR+f+l+p)+" bytes\n"+"}"}}}},902:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=[];t.subscriber=function(e){i.forEach(function(t){var n=e.data.query;var r=n.preparable&&n.preparable.text||n.plan||n.text||"unknown query";var i=!e.data.error;var o=e.data.database.host+":"+e.data.database.port;t.trackDependency({target:o,data:r,name:r,duration:e.data.duration,success:i,resultCode:i?"0":"1",dependencyTypeName:"postgres"})})};function enable(e,n){if(e){if(i.length===0){r.channel.subscribe("postgres",t.subscriber)}i.push(n)}else{i=i.filter(function(e){return e!=n});if(i.length===0){r.channel.unsubscribe("postgres",t.subscriber)}}}t.enable=enable},916:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function fulfilled(e){try{step(r.next(e))}catch(e){o(e)}}function rejected(e){try{step(r["throw"](e))}catch(e){o(e)}}function step(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(Object.hasOwnProperty.call(e,n))t[n]=e[n];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=i(n(208));const a=o(n(622));const c=o(n(669));const u=i(n(227));const f=i(n(571));const l=n(708);class ApkAnalyzer{analyse(e,t,n){return r(this,void 0,void 0,function*(){if(c.isUndefined(n)){n=a.join(a.dirname(e),"extracted")}const r=new s.default(e);console.log("Extracting APK file to "+n);r.extractAllTo(n,true);const i=new u.default(n);yield i.parse();const o=new l.FilesSizeCalculator;const p=new f.default;p.apkLabel=t;p.sizeMetrics["apkSize"]=o.getFileSize(e);p.sizeMetrics["arscFile"]=o.getFilesSize(i.getFiles(".arsc"));p.sizeMetrics["dexFiles"]=o.getFilesSize(i.getFiles(".dex"));p.sizeMetrics["nativeLibs"]=o.getFilesSize(i.getFiles(".so"));p.sizeMetrics["installSize"]=p.sizeMetrics["apkSize"]+p.sizeMetrics["dexFiles"];return p})}}t.default=ApkAnalyzer},919:function(e){"use strict";var t=function(){function ExceptionDetails(){this.hasFullStack=true;this.parsedStack=[]}return ExceptionDetails}();e.exports=t},925:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=function(e){var t=e.Server.prototype.connect;e.Server.prototype.connect=function contextPreservingConnect(){var e=t.apply(this,arguments);var n=this.s.pool.write;this.s.pool.write=function contextPreservingWrite(){var e=typeof arguments[1]==="function"?1:2;if(typeof arguments[e]==="function"){arguments[e]=r.channel.bindToContext(arguments[e])}return n.apply(this,arguments)};var i=this.s.pool.logout;this.s.pool.logout=function contextPreservingLogout(){if(typeof arguments[1]==="function"){arguments[1]=r.channel.bindToContext(arguments[1])}return i.apply(this,arguments)};return e};return e};t.mongoCore={versionSpecifier:">= 2.0.0 < 4.0.0",patch:i};function enable(){r.channel.registerMonkeyPatch("mongodb-core",t.mongoCore)}t.enable=enable},928:function(e){"use strict";var t=function(){function RequestParser(){}RequestParser.prototype.getUrl=function(){return this.url};RequestParser.prototype.RequestParser=function(){this.startTime=+new Date};RequestParser.prototype._setStatus=function(e,t){var n=+new Date;this.duration=n-this.startTime;this.statusCode=e;var r=this.properties||{};if(t){if(typeof t==="string"){r["error"]=t}else if(t instanceof Error){r["error"]=t.message}else if(typeof t==="object"){for(var i in t){r[i]=t[i]&&t[i].toString&&t[i].toString()}}}this.properties=r};RequestParser.prototype._isSuccess=function(){return 00)c=l.pop();v=undefined;return n&&!f};d=function asyncWrap(e,t,n){var r=[];f=true;for(var a=0;a0){t[i].before(this,r[t[i].uid])}}f=false;var a=e.apply(this,arguments);f=true;for(i=0;i0){t[i].after(this,r[t[i].uid])}}f=false;c=l.pop();v=undefined;return a}};r(process,"_fatalException",function(e){return function _asyncFatalException(t){return p(t)||e(t)}})}else{var y=false;p=function uncaughtCatcher(e){if(y)throw e;var t=false;var n=c.length;for(var r=0;r0){t[d].before(this,r[t[d].uid])}}f=false;var h;try{h=e.apply(this,arguments)}catch(e){i=true;for(var d=0;d0){t[d].after(this,r[t[d].uid])}}f=false}c=l.pop()}return h}};process.addListener("uncaughtException",p)}function simpleWrap(e,t,n){f=true;for(var r=0;r0)return d(e,n,t)}return simpleWrap(e,n,t)}function AsyncListener(e,t){if(typeof e.create==="function"){this.create=e.create;this.flags|=i}if(typeof e.before==="function"){this.before=e.before;this.flags|=o}if(typeof e.after==="function"){this.after=e.after;this.flags|=s}if(typeof e.error==="function"){this.error=e.error;this.flags|=a}this.uid=++u;this.data=t===undefined?null:t}AsyncListener.prototype.create=undefined;AsyncListener.prototype.before=undefined;AsyncListener.prototype.after=undefined;AsyncListener.prototype.error=undefined;AsyncListener.prototype.data=undefined;AsyncListener.prototype.uid=0;AsyncListener.prototype.flags=0;function createAsyncListener(e,t){if(typeof e!=="object"||!e){throw new TypeError("callbacks argument must be an object")}if(e instanceof AsyncListener){return e}else{return new AsyncListener(e,t)}}function addAsyncListener(e,t){var n;if(!(e instanceof AsyncListener)){n=createAsyncListener(e,t)}else{n=e}var r=false;for(var i=0;i0){return t[0]}return""};HttpRequestParser.keys=new o.ContextTagKeys;return HttpRequestParser}(c);e.exports=p},937:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=n(614);function postgres6PatchFunction(e,t){var n=e.Client.prototype.query;var o="__diagnosticOriginalFunc";e.Client.prototype.query=function query(e,t,s){var a={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0};var c=process.hrtime();var u;function patchCallback(e){if(e&&e[o]){e=e[o]}var t=r.channel.bindToContext(function(t,n){var o=process.hrtime(c);a.result=n&&{rowCount:n.rowCount,command:n.command};a.error=t;a.duration=Math.ceil(o[0]*1e3+o[1]/1e6);r.channel.publish("postgres",a);if(t){if(e){return e.apply(this,arguments)}else if(u&&u instanceof i.EventEmitter){u.emit("error",t)}}else if(e){e.apply(this,arguments)}});try{Object.defineProperty(t,o,{value:e});return t}catch(t){return e}}try{if(typeof e==="string"){if(t instanceof Array){a.query.preparable={text:e,args:t};s=patchCallback(s)}else{a.query.text=e;if(s){s=patchCallback(s)}else{t=patchCallback(t)}}}else{if(typeof e.name==="string"){a.query.plan=e.name}else if(e.values instanceof Array){a.query.preparable={text:e.text,args:e.values}}else{a.query.text=e.text}if(s){s=patchCallback(s)}else if(t){t=patchCallback(t)}else{e.callback=patchCallback(e.callback)}}}catch(e){return n.apply(this,arguments)}arguments[0]=e;arguments[1]=t;arguments[2]=s;arguments.length=arguments.length>3?arguments.length:3;u=n.apply(this,arguments);return u};return e}function postgres7PatchFunction(e,t){var n=e.Client.prototype.query;var o="__diagnosticOriginalFunc";e.Client.prototype.query=function query(e,t,s){var a=this;var c=!!s;var u={query:{},database:{host:this.connectionParameters.host,port:this.connectionParameters.port},result:null,error:null,duration:0};var f=process.hrtime();var l;function patchCallback(e){if(e&&e[o]){e=e[o]}var t=r.channel.bindToContext(function(t,n){var o=process.hrtime(f);u.result=n&&{rowCount:n.rowCount,command:n.command};u.error=t;u.duration=Math.ceil(o[0]*1e3+o[1]/1e6);r.channel.publish("postgres",u);if(t){if(e){return e.apply(this,arguments)}else if(l&&l instanceof i.EventEmitter){l.emit("error",t)}}else if(e){e.apply(this,arguments)}});try{Object.defineProperty(t,o,{value:e});return t}catch(t){return e}}try{if(typeof e==="string"){if(t instanceof Array){u.query.preparable={text:e,args:t};c=typeof s==="function";s=s?patchCallback(s):s}else{u.query.text=e;if(s){c=typeof s==="function";s=c?patchCallback(s):s}else{c=typeof t==="function";t=c?patchCallback(t):t}}}else{if(typeof e.name==="string"){u.query.plan=e.name}else if(e.values instanceof Array){u.query.preparable={text:e.text,args:e.values}}else{u.query.text=e.text}if(s){c=typeof s==="function";s=patchCallback(s)}else if(t){c=typeof t==="function";t=c?patchCallback(t):t}else{c=typeof e.callback==="function";e.callback=c?patchCallback(e.callback):e.callback}}}catch(e){return n.apply(this,arguments)}arguments[0]=e;arguments[1]=t;arguments[2]=s;arguments.length=arguments.length>3?arguments.length:3;l=n.apply(this,arguments);if(!c){return l.then(function(e){patchCallback()(undefined,e);return new a._Promise(function(t,n){t(e)})}).catch(function(e){patchCallback()(e,undefined);return new a._Promise(function(t,n){n(e)})})}return l};return e}t.postgres6={versionSpecifier:"6.*",patch:postgres6PatchFunction};t.postgres7={versionSpecifier:"7.*",patch:postgres7PatchFunction};function enable(){r.channel.registerMonkeyPatch("pg",t.postgres6);r.channel.registerMonkeyPatch("pg",t.postgres7)}t.enable=enable},941:function(e,t,n){"use strict";var r=n(221);"use strict";var i=function(){function DataPoint(){this.kind=r.Measurement}return DataPoint}();e.exports=i},942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=function(e){var t=e.prototype._emit;e.prototype._emit=function(e,n){var i=t.apply(this,arguments);if(!n){var o=i;if(!o){o=t.call(this,e,true)}r.channel.publish("bunyan",{level:e.level,result:o})}return i};return e};t.bunyan={versionSpecifier:">= 1.0.0 < 2.0.0",patch:i};function enable(){r.channel.registerMonkeyPatch("bunyan",t.bunyan)}t.enable=enable},944:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:true});var r=n(243);var i=n(622);var o=function(e,t){var n=function(e,t){return function(t,n){var i=e[t];if(i){e[t]=function mysqlContextPreserver(){var e=arguments.length-1;for(var t=arguments.length-1;t>=0;--t){if(typeof arguments[t]==="function"){e=t;break}else if(typeof arguments[t]!=="undefined"){break}}var o=arguments[e];var s={result:null,startTime:null};if(typeof o==="function"){if(n){s.startTime=process.hrtime();arguments[e]=r.channel.bindToContext(n(s,o))}else{arguments[e]=r.channel.bindToContext(o)}}var a=i.apply(this,arguments);s.result=a;return a}}}};var o=function(e,t){return n(e.prototype,t+".prototype")};var s=["connect","changeUser","ping","statistics","end"];var a=require(i.dirname(t)+"/lib/Connection");s.forEach(function(e){return o(a,"Connection")(e)});n(a,"Connection")("createQuery",function(e,t){return function(n){var i=process.hrtime(e.startTime);var o=i[0]*1e3+i[1]/1e6|0;r.channel.publish("mysql",{query:e.result,callbackArgs:arguments,err:n,duration:o});t.apply(this,arguments)}});var c=["_enqueueCallback"];var u=require(i.dirname(t)+"/lib/Pool");c.forEach(function(e){return o(u,"Pool")(e)});return e};t.mysql={versionSpecifier:">= 2.0.0 < 3.0.0",patch:o};function enable(){r.channel.registerMonkeyPatch("mysql",t.mysql)}t.enable=enable},950:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(RequestData,e);function RequestData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return RequestData}(i);e.exports=o},953:function(e,t,n){"use strict";var r=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(t.hasOwnProperty(n))e[n]=t[n]};return function(t,n){e(t,n);function __(){this.constructor=t}t.prototype=n===null?Object.create(n):(__.prototype=n.prototype,new __)}}();var i=n(472);"use strict";var o=function(e){r(EventData,e);function EventData(){var t=e.call(this)||this;t.ver=2;t.properties={};t.measurements={};return t}return EventData}(i);e.exports=o},967:function(e,t,n){var r=n(402),i=n(864),o=r.Constants,s=n(818);e.exports=function(e){var t=new i.EntryHeader,n=Buffer.alloc(0),a=Buffer.alloc(0),c=false,u=null,f=Buffer.alloc(0);function getCompressedDataFromZip(){if(!e||!Buffer.isBuffer(e)){return Buffer.alloc(0)}t.loadDataHeaderFromBinary(e);return e.slice(t.realDataOffset,t.realDataOffset+t.compressedSize)}function crc32OK(e){if((t.flags&8)!==8){if(r.crc32(e)!==t.dataHeader.crc){return false}}else{}return true}function decompress(e,i,o){if(typeof i==="undefined"&&typeof e==="string"){o=e;e=void 0}if(c){if(e&&i){i(Buffer.alloc(0),r.Errors.DIRECTORY_CONTENT_ERROR)}return Buffer.alloc(0)}var a=getCompressedDataFromZip();if(a.length===0){if(e&&i)i(a,r.Errors.NO_DATA);return a}var u=Buffer.alloc(t.size);switch(t.method){case r.Constants.STORED:a.copy(u);if(!crc32OK(u)){if(e&&i)i(u,r.Errors.BAD_CRC);return r.Errors.BAD_CRC}else{if(e&&i)i(u);return u}case r.Constants.DEFLATED:var f=new s.Inflater(a);if(!e){var l=f.inflate(u);l.copy(u,0);if(!crc32OK(u)){console.warn(r.Errors.BAD_CRC+" "+n.toString())}return u}else{f.inflateAsync(function(e){e.copy(u,0);if(!crc32OK(u)){if(i)i(u,r.Errors.BAD_CRC)}else{if(i)i(u)}})}break;default:if(e&&i)i(Buffer.alloc(0),r.Errors.UNKNOWN_METHOD);return r.Errors.UNKNOWN_METHOD}}function compress(n,i){if((!u||!u.length)&&Buffer.isBuffer(e)){if(n&&i)i(getCompressedDataFromZip());return getCompressedDataFromZip()}if(u.length&&!c){var o;switch(t.method){case r.Constants.STORED:t.compressedSize=t.size;o=Buffer.alloc(u.length);u.copy(o);if(n&&i)i(o);return o;default:case r.Constants.DEFLATED:var a=new s.Deflater(u);if(!n){var f=a.deflate();t.compressedSize=f.length;return f}else{a.deflateAsync(function(e){o=Buffer.alloc(e.length);t.compressedSize=e.length;e.copy(o);i&&i(o)})}a=null;break}}else{if(n&&i){i(Buffer.alloc(0))}else{return Buffer.alloc(0)}}}function readUInt64LE(e,t){return(e.readUInt32LE(t+4)<<4)+e.readUInt32LE(t)}function parseExtra(e){var t=0;var n,r,i;while(t=o.EF_ZIP64_SCOMP){n=readUInt64LE(e,o.EF_ZIP64_SUNCOMP);if(t.size===o.EF_ZIP64_OR_32){t.size=n}}if(e.length>=o.EF_ZIP64_RHO){r=readUInt64LE(e,o.EF_ZIP64_SCOMP);if(t.compressedSize===o.EF_ZIP64_OR_32){t.compressedSize=r}}if(e.length>=o.EF_ZIP64_DSN){i=readUInt64LE(e,o.EF_ZIP64_RHO);if(t.offset===o.EF_ZIP64_OR_32){t.offset=i}}if(e.length>=o.EF_ZIP64_DSN+4){s=e.readUInt32LE(o.EF_ZIP64_DSN);if(t.diskNumStart===o.EF_ZIP64_OR_16){t.diskNumStart=s}}}return{get entryName(){return n.toString()},get rawEntryName(){return n},set entryName(e){n=r.toBuffer(e);var i=n[n.length-1];c=i===47||i===92;t.fileNameLength=n.length},get extra(){return f},set extra(e){f=e;t.extraLength=e.length;parseExtra(e)},get comment(){return a.toString()},set comment(e){a=r.toBuffer(e);t.commentLength=a.length},get name(){var e=n.toString();return c?e.substr(e.length-1).split("/").pop():e.split("/").pop()},get isDirectory(){return c},getCompressedData:function(){return compress(false,null)},getCompressedDataAsync:function(e){compress(true,e)},setData:function(e){u=r.toBuffer(e);if(!c&&u.length){t.size=u.length;t.method=r.Constants.DEFLATED;t.crc=r.crc32(e);t.changed=true}else{t.method=r.Constants.STORED}},getData:function(e){if(t.changed){return u}else{return decompress(false,null,e)}},getDataAsync:function(e,n){if(t.changed){e(u)}else{decompress(true,e,n)}},set attr(e){t.attr=e},get attr(){return t.attr},set header(e){t.loadFromBinary(e)},get header(){return t},packHeader:function(){var e=t.entryHeaderToBinary();n.copy(e,r.Constants.CENHDR);if(t.extraLength){f.copy(e,r.Constants.CENHDR+n.length)}if(t.commentLength){a.copy(e,r.Constants.CENHDR+n.length+t.extraLength,a.length)}return e},toString:function(){return"{\n"+'\t"entryName" : "'+n.toString()+'",\n'+'\t"name" : "'+(c?n.toString().replace(/\/$/,"").split("/").pop():n.toString().split("/").pop())+'",\n'+'\t"comment" : "'+a.toString()+'",\n'+'\t"isDirectory" : '+c+",\n"+'\t"header" : '+t.toString().replace(/\t/gm,"\t\t").replace(/}/gm,"\t}")+",\n"+'\t"compressedData" : <'+(e&&e.length+" bytes buffer"||"null")+">\n"+'\t"data" : <'+(u&&u.length+" bytes buffer"||"null")+">\n"+"}"}}}},970:function(e){"use strict";var t=function(){function Logging(){}Logging.info=function(e){var t=[];for(var n=1;n0){e+=" ";for(const t in this.properties){if(this.properties.hasOwnProperty(t)){const n=this.properties[t];if(n){e+=`${t}=${escape(`${n||""}`)},`}}}}e+=i;const t=`${this.message||""}`;e+=escapeData(t);return e}}function escapeData(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A")}function escape(e){return e.replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/]/g,"%5D").replace(/;/g,"%3B")}}}); \ No newline at end of file diff --git a/package.json b/package.json index c8577c5..af10fbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "android-app-size-diff", - "version": "0.0.29", + "version": "0.0.30", "description": "Azure DevOps task to measure the size in Android app size by looking at 2 given APKs and AABs", "main": "index.js", "scripts": { diff --git a/src/adoTask/adoTaskRunner.ts b/src/adoTask/adoTaskRunner.ts index 9b685fb..b275e63 100644 --- a/src/adoTask/adoTaskRunner.ts +++ b/src/adoTask/adoTaskRunner.ts @@ -40,7 +40,7 @@ export default class AdoTaskRunner { try { const adoCiCore = new AdoCiCore(); const ciRunner = new CiRunner(adoCiCore); - await ciRunner.runWithTelemetry(); + await ciRunner.run(); } catch (err) { adoTask.setResult(adoTask.TaskResult.Failed, err.message); diff --git a/src/apkAnalyzer/CiRunner.ts b/src/apkAnalyzer/CiRunner.ts index ad9d48a..7f5206e 100644 --- a/src/apkAnalyzer/CiRunner.ts +++ b/src/apkAnalyzer/CiRunner.ts @@ -42,12 +42,28 @@ export interface CiCore { export default class CiRunner { ciCore: CiCore; // either Github action core or ADO Task thresholdChecker: ThresholdChecker; - telemetryClient: appInsights.TelemetryClient; constructor(ciCore: CiCore) { this.ciCore = ciCore; this.thresholdChecker = new ThresholdChecker(ciCore); + } + /** + * Runs the ci runner with telemetry enabled if set + */ + public async run() { + const telemetryEnabled = Boolean(JSON.parse(this.ciCore.getInput('telemetryEnabled'))); + + if (telemetryEnabled) { + console.log("Running with usage telemetry.."); + return this.runAppSizeAnalysisWithTelemetry(); + } else { + console.log("Running with telemetry disabled.."); + return this.runAppSizeAnalysis(); + } + } + + private async runAppSizeAnalysisWithTelemetry() { // Configure and enable telemetry appInsights.setup('0ba004b8-ff05-41fa-a241-3f026d68fc3a') // Change this to your own instrumentation key .setAutoDependencyCorrelation(true) @@ -59,28 +75,26 @@ export default class CiRunner { .setUseDiskRetryCaching(true) .setSendLiveMetrics(true) .start(); - this.telemetryClient = appInsights.defaultClient; - } + const telemetryClient = appInsights.defaultClient; - public async runWithTelemetry() { // Send app start telemetry const startTime = new Date().getTime(); const telemetryProperties = { ciName: this.ciCore.getCiName() } - this.telemetryClient.trackEvent({ + telemetryClient.trackEvent({ name: 'RunStarted', properties: telemetryProperties }); var result: any; try { - result = await this.run(); + result = await this.runAppSizeAnalysis(); // Send success telemetry const endTime = new Date().getTime(); const elapsedTime = endTime - startTime; - this.telemetryClient.trackEvent({ + telemetryClient.trackEvent({ name: 'RunSuccess', measurements: { duration: elapsedTime @@ -89,24 +103,24 @@ export default class CiRunner { }); } catch (err) { // Send error telemetry - this.telemetryClient.trackEvent({ + telemetryClient.trackEvent({ name: 'RunFailed', properties: telemetryProperties }); - this.telemetryClient.trackException({ + telemetryClient.trackException({ exception: err, properties: telemetryProperties }); throw err; } finally { - this.telemetryClient.flush(); + telemetryClient.flush(); } return result; } - private async run() { + private async runAppSizeAnalysis() { const baseAppPath = this.ciCore.getInput('baseAppPath'); const targetAppPath = this.ciCore.getInput('targetAppPath'); const baseAppLabel = this.ciCore.getInput('baseAppLabel'); diff --git a/src/githubAction/GithubActionRunner.ts b/src/githubAction/GithubActionRunner.ts index 24fc7d6..d515fc6 100644 --- a/src/githubAction/GithubActionRunner.ts +++ b/src/githubAction/GithubActionRunner.ts @@ -40,7 +40,7 @@ export default class GithubActionRunner { try { const githubCore = new GithubCiCore(); const ciRunner = new CiRunner(githubCore); - await ciRunner.runWithTelemetry(); + await ciRunner.run(); } catch (err) { ghAction.setFailed(err.message); diff --git a/src/task.json b/src/task.json index 1b1fa08..cc65b37 100644 --- a/src/task.json +++ b/src/task.json @@ -10,7 +10,7 @@ "version": { "Major": 0, "Minor": 0, - "Patch": 29 + "Patch": 30 }, "instanceNameFormat": "Android App size change - $(baseAppPath) vs $(targetAppPath)", "inputs": [ @@ -69,6 +69,14 @@ "defaultValue": "", "required": false, "helpMarkDown": "A comma seperated list of thresholds for each of the metrics in bytes. If this is empty, no thresholding will apply. When this is not empty, the task will fail when any of the given thresholds are crossed." + }, + { + "name": "telemetryEnabled", + "type": "string", + "label": "Telemetry enabled", + "defaultValue": "true", + "required": false, + "helpMarkDown": "Set to `false` to disable telemetry" } ], "execution": { diff --git a/test/adoTask/success.ts b/test/adoTask/success.ts index d22d4dd..e2b55fb 100644 --- a/test/adoTask/success.ts +++ b/test/adoTask/success.ts @@ -12,5 +12,6 @@ tmr.setInput('targetAppLabel', 'Target APK'); tmr.setInput('metrics', 'apkSize, installSize'); tmr.setInput('thresholds', '20, 50'); tmr.setInput('summaryOutputPath', 'dist/test/testReport.md'); +tmr.setInput('telemetryEnabled', 'false'); tmr.run();