Socket
Socket
Sign inDemoInstall

@microsoft/applicationinsights-core-js

Package Overview
Dependencies
Maintainers
4
Versions
561
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@microsoft/applicationinsights-core-js - npm Package Compare versions

Comparing version 2.5.5 to 2.5.6

4

browser/applicationinsights-core-js.min.js
/*!
* Application Insights JavaScript SDK - Core, 2.5.5
* Application Insights JavaScript SDK - Core, 2.5.6
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var r="function",o="object",n="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function i(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[s](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object[a][s].call(n,r)&&(e[r]=n[r]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}l(e,n),e[a]=null===n?i(n):(t[a]=n[a],new t)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var n=y();return n&&n[e]?n[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return!(typeof history!==g||!history)}function S(){return!!(typeof JSON===g&&JSON||null!==m(v))}function N(){return S()?JSON||m(v):null}var b=n,L="attachEvent",E="addEventListener",F="detachEvent",M="removeEventListener";function P(e,n){return typeof e===n}function A(e){return P(e,n)||e===undefined}function O(e){return A(e)||null===e}function D(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function R(e){return P(e,o)}function U(e){return P(e,r)}function j(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!O(e))try{O(e[E])?O(e[L])||(e[L]("on"+n,t),r=!0):(e[E](n,t,i),r=!0)}catch(o){}return r}function k(e,n,t,i){if(void 0===i&&(i=!1),!O(e))try{O(e[M])?O(e[F])||e[F]("on"+n,t):e[M](n,t,i)}catch(r){}}var z=(B.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},B.isString=function(e){return P(e,"string")},B.isNumber=function(e){return P(e,"number")},B.isBoolean=function(e){return P(e,"boolean")},B.disableCookies=function(){B._canUseCookies=!1},B.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Q,function(e){var n,t=0|((n=m("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},B.toISOString=function(e){if(B.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},B.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},B.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},B.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},B.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},B.strTrim=function(e){return B.isString(e)?e.replace(/^\s+|\s+$/g,""):e},B.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(U(e)||R(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)D(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&t.push(r[a]);return t},B.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},B.addEventHandler=function(e,n){var t=!1,i=C();i&&(t=j(i,e,n),t=j(i.body,e,n)||t);var r=I();return r&&(t=V.Attach(r,e,n)||t),t},B.isTypeof=P,B.isUndefined=A,B.isNullOrUndefined=O,B.hasOwnProperty=D,B.isFunction=U,B.isObject=R,B.objCreate=i,B);function B(){}var q,Q=/[xy]/g,V=(W.Attach=j,W.AttachEvent=j,W.Detach=k,W.DetachEvent=k,W);function W(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var H={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},K=(G.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},G.dataType="MessageData",G.AiNonUserActionablePrefix="AI (Internal): ",G.AiUserActionablePrefix="AI: ",G);function G(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?G.AiUserActionablePrefix:G.AiNonUserActionablePrefix)+e;var r="";S()&&(r=N().stringify(i));var o=(n?" message:"+G.sanitizeDiagnosticText(n):"")+(i?" props:"+G.sanitizeDiagnosticText(r):"");this.message+=o}var J=(Z.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o,a=new K(n,t,r,i),s=this;if(s.enableDebugExceptions())throw a;!z.isUndefined(a)&&a&&(z.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},Z.prototype.warnToConsole=function(e){!z.isUndefined(console)&&console&&(z.isFunction(console.warn)?console.warn(e):z.isFunction(console.log)&&console.log(e))},Z.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},Z.prototype.logInternalMessage=function(e,n){var t,i,r,o=this;o._areInternalMessagesThrottled()||(t=!0,i=o.AIInternalMessagePrefix+n.messageId,o._messageLogged[i]?t=!1:o._messageLogged[i]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new K(H.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},Z.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},Z);function Z(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},z.isNullOrUndefined(e)||(z.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),z.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),z.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),z.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var $=z.isFunction,Y=function(r,o){var a=this,s=null,l=$(r.processTelemetry),u=$(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,H.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},X=z.isNullOrUndefined;function ee(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&z.isFunction(a.processTelemetry)&&(o=new Y(a,n),t.push(o),i&&i.setNext(o),i=o)}return 0<t.length?t[0]:null}var ne=function Oe(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&z.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),ee(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],z.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=ee(a,i)):z.isUndefined(n)&&(u=ee(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new J(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t,i;return void 0===n&&(n={}),!o||(i=o.extensionConfig)&&e&&(t=i[e]),t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!X(r[n])?i=r[n]:o&&!X(o[n])&&(i=o[n]),X(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new Oe(e||u,o,t,n)}},te=z.isFunction,ie="getPlugin",re=(oe.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},oe);function oe(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&te(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=s||new ne(null,{},o.core),t=l&&l[ie]?n.createNew(null,l[ie]):n.createNew(null,l)),t},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[ie]&&(r=l[ie]()),o.core=n,s=new ne(i,e,n,r),a=!0}}var ae=z.isFunction,se="processTelemetry",le="priority",ue="setNextPlugin",ce="isInitialized";function fe(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&ae(i[ue])&&ae(o[se])&&i[ue](o),ae(o[ce])&&o[ce]()||e.push(o),i=o,r=r.getNext())}z.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function ge(e){return e.sort(function(e,n){var t=0,i=ae(n[se]);return ae(e[se])?t=i?e[le]-n[le]:1:i&&(t=-1),t})}var de=z.arrForEach,he=z.objDefineAccessors;function pe(e,n){n&&0<n.length&&(n=n.sort(function(e,n){return e.priority-n.priority}),de(n,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ve,ye=(ve=re,__extends(me,ve),me.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&de(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},me.prototype.getChannelControls=function(){return this._channelQueue},me.prototype.initialize=function(n,t,i){var e,r,o,a,s;this.isInitialized()||(ve.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&z.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(n||{}).channels)&&de(r,function(e){return pe(s,e)}),o&&(a=[],de(o,function(e){500<e.priority&&a.push(e)}),pe(s,a)),s),de(e,function(e){return fe(new ne(e,n,t),i)}))},me._staticInit=(he(me.prototype,"ChannelControls",me.prototype.getChannelControls),void he(me.prototype,"channelQueue",me.prototype.getChannelControls)),me);function me(){var e=null!==ve&&ve.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var xe=z.arrForEach,Ce=z.isNullOrUndefined,Te=(Ie.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ce(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||z.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),r._notificationManager=t,e.extensions=Ce(e.extensions)?[]:e.extensions,(e.extensionConfig=Ce(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||z.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=ge(a);var s=[],l={};if(xe(a,function(e){if(Ce(e)||Ce(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(Ce(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=ge(a),r._extensions=a,fe(new ne([o],e,r),a),fe(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},Ie.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ie.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=z.toISOString(new Date)),Ce(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(xe(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},Ie.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new ne(n,this.config,this)},Ie);function Ie(){var n=!1,e=this;e._extensions=[],e._channelController=new ye,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var _e=(we.prototype.addNotificationListener=function(e){this.listeners.push(e)},we.prototype.removeNotificationListener=function(e){for(var n=z.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=z.arrIndexOf(this.listeners,e)},we.prototype.eventsSent=function(n){for(var t=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)}(e)},we.prototype.eventsDiscarded=function(n,t){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)}(e)},we.prototype.eventsSendRequest=function(t,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(t,i)},0);else try{o.listeners[e].eventsSendRequest(t,i)}catch(n){}}(e)},we);function we(){this.listeners=[]}var Se,Ne=(Se=Te,__extends(be,Se),be.prototype.initialize=function(e,n){var t=this;t._notificationManager=new _e,t.logger=new J(e),t.config=e,Se.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},be.prototype.getTransmissionControls=function(){return Se.prototype.getTransmissionControls.call(this)},be.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Se.prototype.track.call(this,e)},be.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},be.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},be.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];z.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:z.toISOString(new Date),baseType:K.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},be.prototype._validateTelemetryItem=function(e){if(z.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},be.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},be);function be(){return Se.call(this)||this}var Le="_aiHooks",Ee=["req","rsp","hkErr","fnErr"];function Fe(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Me(e,l,u,c,f){0<=f&&f<=2&&Fe(e,function(e,n){var t=e.cbks,i=t[Ee[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ee[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Pe(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(z.hasOwnProperty(e,n)?i=e:t&&(i=c(e[d],n,!1))),i}(e,n,i),o=r[n];if(typeof o===h){var a,s=o[Le];s||(u=s={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return Fe(e,function(e){n.push(e)}),n}Me(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Me(e,i,r,n,3),s}return Me(e,i,r,n,1),i.rslt})[Le]=s,r[n]=a);var l={id:s.i,cbks:t,rm:function(){var t=this.id;Fe(s.h,function(e,n){return e.id===t&&(s.h.splice(n,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Ae(t,e,i,r){void 0===r&&(r=!0);var o=null;return Fe(e,function(e){var n=Pe(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=Ne,c.BaseCore=Te,c.BaseTelemetryPlugin=re,c.CoreUtils=z,c.EventHelper=V,c.Undefined=b,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=function(){return _()?navigator:m("navigator")},c.hasHistory=w,c.getHistory=function(){return w()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=S,c.getJSON=N,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=_e,c.DiagnosticLogger=J,c._InternalLogMessage=K,c.ProcessTelemetryContext=ne,c.initializePlugins=fe,c.sortPlugins=ge,c._InternalMessageId=H,c.InstrumentProto=function(e,n,t){return e?Pe(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Ae(e[d],n,t,!1):null},c.InstrumentFunc=Pe,c.InstrumentFuncs=Ae,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",o="object",t="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==t&&globalThis?globalThis:typeof self!==t&&self?self:typeof window!==t&&window?window:typeof global!==t&&global?global:null}function i(e){var t=Object.create;if(t)return t(e);if(null==e)return{};var n=typeof e;if(n!=o&&n!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t[s](n)&&(e[n]=t[n])})(e,t)},n=e()||{};__assign=n.__assign=n.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object[a][s].call(t,r)&&(e[r]=t[r]);return e},__extends=n.__extends=n.__extends||function(e,t){function n(){this.constructor=e}l(e,t),e[a]=null===t?i(t):(n[a]=t[a],new n)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=t,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var t=y();return t&&t[e]?t[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return _()?navigator:m("navigator")}function S(){return!(typeof history!==g||!history)}function N(){return!!(typeof JSON===g&&JSON||null!==m(v))}function b(){return N()?JSON||m(v):null}var L=t,E="attachEvent",F="addEventListener",M="detachEvent",P="removeEventListener";function A(e,t){return typeof e===t}function O(e){return A(e,t)||e===undefined}function R(e){return O(e)||null===e}function D(e,t){return e&&Object[a].hasOwnProperty.call(e,t)}function U(e){return A(e,o)}function j(e){return A(e,r)}function k(e,t,n,i){void 0===i&&(i=!1);var r=!1;if(!R(e))try{R(e[F])?R(e[E])||(e[E]("on"+t,n),r=!0):(e[F](t,n,i),r=!0)}catch(o){}return r}function z(e,t,n,i){if(void 0===i&&(i=!1),!R(e))try{R(e[P])?R(e[M])||e[M]("on"+t,n):e[P](t,n,i)}catch(r){}}var B=(Q.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},Q.isString=function(e){return A(e,"string")},Q.isNumber=function(e){return A(e,"number")},Q.isBoolean=function(e){return A(e,"boolean")},Q.disableCookies=function(){Q._canUseCookies=!1},Q.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(V,function(e){var t,n=0|((t=m("crypto"))?t.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?n:3&n|8).toString(16)})},Q.toISOString=function(e){if(Q.isDate(e)){var t=function(e){var t=e+"";return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},Q.arrForEach=function(e,t,n){for(var i=e.length,r=0;r<i;r++)r in e&&t.call(n||e,e[r],r,e)},Q.arrIndexOf=function(e,t,n){for(var i=e.length,r=n||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===t)return o;return-1},Q.arrMap=function(e,t,n){for(var i=e.length,r=n||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=t.call(r,e[a],e));return o},Q.arrReduce=function(e,t,n){var i,r=e.length,o=0;if(3<=arguments.length)i=n;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=t(i,e[o],o,e)),o++;return i},Q.strTrim=function(e){return Q.isString(e)?e.replace(/^\s+|\s+$/g,""):e},Q.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(j(e)||U(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var i in e)D(e,i)&&n.push(i);if(t)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&n.push(r[a]);return n},Q.objDefineAccessors=function(e,t,n,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return n&&(o.get=n),i&&(o.set=i),r(e,t,o),!0}catch(a){}return!1},Q.addEventHandler=function(e,t){var n=!1,i=C();i&&(n=k(i,e,t),n=k(i.body,e,t)||n);var r=I();return r&&(n=W.Attach(r,e,t)||n),n},Q.isTypeof=A,Q.isUndefined=O,Q.isNullOrUndefined=R,Q.hasOwnProperty=D,Q.isFunction=j,Q.isObject=U,Q.objCreate=i,Q);function Q(){}var q,V=/[xy]/g,W=(H.Attach=k,H.AttachEvent=k,H.Detach=z,H.DetachEvent=z,H);function H(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var K={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},G=(J.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},J.dataType="MessageData",J.AiNonUserActionablePrefix="AI (Internal): ",J.AiUserActionablePrefix="AI: ",J);function J(e,t,n,i){void 0===n&&(n=!1),this.messageId=e,this.message=(n?J.AiUserActionablePrefix:J.AiNonUserActionablePrefix)+e;var r="";N()&&(r=b().stringify(i));var o=(t?" message:"+J.sanitizeDiagnosticText(t):"")+(i?" props:"+J.sanitizeDiagnosticText(r):"");this.message+=o}var Z=($.prototype.throwInternal=function(e,t,n,i,r){void 0===r&&(r=!1);var o,a=new G(t,n,r,i),s=this;if(s.enableDebugExceptions())throw a;!B.isUndefined(a)&&a&&(B.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},$.prototype.warnToConsole=function(e){!B.isUndefined(console)&&console&&(B.isFunction(console.warn)?console.warn(e):B.isFunction(console.log)&&console.log(e))},$.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},$.prototype.logInternalMessage=function(e,t){var n,i,r,o=this;o._areInternalMessagesThrottled()||(n=!0,i=o.AIInternalMessagePrefix+t.messageId,o._messageLogged[i]?n=!1:o._messageLogged[i]=!0,n&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(t),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new G(K.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},$.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},$);function $(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},B.isNullOrUndefined(e)||(B.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),B.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),B.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),B.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Y=B.isFunction,X=function(r,o){var a=this,s=null,l=Y(r.processTelemetry),u=Y(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,t){if(t=t||o,r&&l){a._hasRun=!0;try{t.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,t)}catch(i){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,K.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!n&&s.processTelemetry(e,t)}}else s&&(a._hasRun=!0,s.processTelemetry(e,t))}},ee=B.isNullOrUndefined;function te(e,t){var n=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&B.isFunction(a.processTelemetry)&&(o=new X(a,t),n.push(o),i&&i.setNext(o),i=o)}return 0<n.length?n[0]:null}var ne=function Re(e,o,n,t){var i,r,a,s,l=this,u=null;null!==t&&(e&&B.isFunction(e.getPlugin)?u=function(e,t,n){var i=[],r=!n;if(e)for(;e;){var o=e.getPlugin();!r&&o!==n||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(n),te(i,t)}(e,l,t||e.getPlugin()):t?(i=l,a=e,s=!1,(r=t)&&e&&(a=[],B.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=te(a,i)):B.isUndefined(t)&&(u=te(e,l))),l.core=function(){return n},l.diagLog=function(){return(n||{}).logger||new Z(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,t){var n,i;return void 0===t&&(t={}),!o||(i=o.extensionConfig)&&e&&(n=i[e]),n||t},l.getConfig=function(e,t,n){var i;void 0===n&&(n=!1);var r=l.getExtCfg(e,null);return r&&!ee(r[t])?i=r[t]:o&&!ee(o[t])&&(i=o[t]),ee(i)?n:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var t=u;t&&(u=t.getNext(),t.processTelemetry(e,l))},l.createNew=function(e,t){return void 0===e&&(e=null),new Re(e||u,o,n,t)}},ie=B.isFunction,re="getPlugin",oe=(ae.prototype.initialize=function(e,t,n,i){this._baseTelInit(e,t,n,i)},ae);function ae(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,t){t?t.processNext(e):l&&ie(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var t,n=e;return n||(t=s||new ne(null,{},o.core),n=l&&l[re]?t.createNew(null,l[re]):t.createNew(null,l)),n},o._baseTelInit=function(e,t,n,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&t&&(i=t.getProcessTelContext().getNext());var r=l;l&&l[re]&&(r=l[re]()),o.core=t,s=new ne(i,e,t,r),a=!0}}var se=B.isFunction,le="processTelemetry",ue="priority",ce="setNextPlugin",fe="isInitialized";function ge(t,n){for(var e=[],i=null,r=t.getNext();r;){var o=r.getPlugin();o&&(i&&se(i[ce])&&se(o[le])&&i[ce](o),se(o[fe])&&o[fe]()||e.push(o),i=o,r=r.getNext())}B.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function de(e){return e.sort(function(e,t){var n=0,i=se(t[le]);return se(e[le])?n=i?e[ue]-t[ue]:1:i&&(n=-1),n})}var he=B.arrForEach,pe=B.objDefineAccessors;function ve(e,t){t&&0<t.length&&(t=t.sort(function(e,t){return e.priority-t.priority}),he(t,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(t))}var ye,me=(ye=oe,__extends(xe,ye),xe.prototype.processTelemetry=function(t,n){var i=this;this._channelQueue&&he(this._channelQueue,function(e){0<e.length&&i._getTelCtx(n).createNew(e).processNext(t)})},xe.prototype.getChannelControls=function(){return this._channelQueue},xe.prototype.initialize=function(t,n,i){var e,r,o,a,s;this.isInitialized()||(ye.prototype.initialize.call(this,t,n,i),t.isCookieUseDisabled&&B.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(t||{}).channels)&&he(r,function(e){return ve(s,e)}),o&&(a=[],he(o,function(e){500<e.priority&&a.push(e)}),ve(s,a)),s),he(e,function(e){return ge(new ne(e,t,n),i)}))},xe._staticInit=(pe(xe.prototype,"ChannelControls",xe.prototype.getChannelControls),void pe(xe.prototype,"channelQueue",xe.prototype.getChannelControls)),xe);function xe(){var e=null!==ye&&ye.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var Ce=B.arrForEach,Te=B.isNullOrUndefined,Ie=(_e.prototype.initialize=function(e,t,i,n){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Te(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;n=n||B.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){},eventsSendRequest:function(e,t){}}),r._notificationManager=n,e.extensions=Te(e.extensions)?[]:e.extensions,(e.extensionConfig=Te(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,i=i||B.objCreate({throwInternal:function(e,t,n,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,t.concat(e.extensions)),a=de(a);var s=[],l={};if(Ce(a,function(e){if(Te(e)||Te(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Te(l[t])?l[t]=n:i.warnToConsole("Two extensions have same priority #"+t+" - "+l[t]+", "+n)),(!t||t<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=de(a),r._extensions=a,ge(new ne([o],e,r),a),ge(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0),r.releaseQueue()},_e.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},_e.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=B.toISOString(new Date)),Te(e.ver)&&(e.ver="4.0"),this.isInitialized()?this.getProcessTelContext().processNext(e):this._eventQueue.push(e)},_e.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new ne(t,this.config,this)},_e.prototype.releaseQueue=function(){var t=this;0<t._eventQueue.length&&(Ce(t._eventQueue,function(e){t.getProcessTelContext().processNext(e)}),t._eventQueue=[])},_e);function _e(){var t=!1,e=this;e._extensions=[],e._channelController=new me,e.isInitialized=function(){return t},e._setInit=function(e){t=e},e._eventQueue=[]}var we=(Se.prototype.addNotificationListener=function(e){this.listeners.push(e)},Se.prototype.removeNotificationListener=function(e){for(var t=B.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=B.arrIndexOf(this.listeners,e)},Se.prototype.eventsSent=function(t){for(var n=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)}(e)},Se.prototype.eventsDiscarded=function(t,n){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(t,n)},0)}(e)},Se.prototype.eventsSendRequest=function(n,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(n,i)},0);else try{o.listeners[e].eventsSendRequest(n,i)}catch(t){}}(e)},Se);function Se(){this.listeners=[]}var Ne,be=(Ne=Ie,__extends(Le,Ne),Le.prototype.initialize=function(e,t){var n=this;n._notificationManager=new we,n.logger=new Z(e),n.config=e,Ne.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},Le.prototype.getTransmissionControls=function(){return Ne.prototype.getTransmissionControls.call(this)},Le.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Ne.prototype.track.call(this,e)},Le.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Le.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Le.prototype.pollInternalLogs=function(i){var t=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];B.arrForEach(e,function(e){var t={name:i||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:B.toISOString(new Date),baseType:G.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},Le.prototype._validateTelemetryItem=function(e){if(B.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Le.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},Le);function Le(){return Ne.call(this)||this}var Ee="_aiHooks",Fe=["req","rsp","hkErr","fnErr"];function Me(e,t){if(e)for(var n=0;n<e.length&&!t(e[n],n);n++);}function Pe(e,l,u,c,f){0<=f&&f<=2&&Me(e,function(e,t){var n=e.cbks,i=n[Fe[f]];if(i){l.ctx=function(){return c[t]=c[t]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=n[Fe[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Ae(e,t,n,i){if(void 0===i&&(i=!0),e&&t&&n){var r=function c(e,t,n){var i=null;return e&&(B.hasOwnProperty(e,t)?i=e:n&&(i=c(e[d],t,!1))),i}(e,t,i),o=r[t];if(typeof o===h){var a,s=o[Ee];s||(u=s={i:0,n:t,f:o,h:[]},(a=function(){var n=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,t){(n=o([],n))[e]=t,r=o([i],n)}},t=[],r=o([i],n);function o(t,e){return Me(e,function(e){t.push(e)}),t}Pe(e,i,r,t,0);var a=u.f;try{i.rslt=a.apply(this,n)}catch(s){throw i.err=s,Pe(e,i,r,t,3),s}return Pe(e,i,r,t,1),i.rslt})[Ee]=s,r[t]=a);var l={id:s.i,cbks:n,rm:function(){var n=this.id;Me(s.h,function(e,t){return e.id===n&&(s.h.splice(t,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Oe(n,e,i,r){void 0===r&&(r=!0);var o=null;return Me(e,function(e){var t=Ae(n,e,i,r);t&&(o=o||[]).push(t)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=be,c.BaseCore=Ie,c.BaseTelemetryPlugin=oe,c.CoreUtils=B,c.EventHelper=W,c.Undefined=L,c.normalizeJsName=function(e){var t=e,n=/([^\w\d_$])/g;return n.test(e)&&(t=e.replace(n,"_")),t},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=w,c.hasHistory=S,c.getHistory=function(){return S()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=N,c.getJSON=b,c.isReactNative=function(){var e=w();return!(!e||!e.product)&&"ReactNative"===e.product},c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=we,c.DiagnosticLogger=Z,c._InternalLogMessage=G,c.ProcessTelemetryContext=ne,c.initializePlugins=ge,c.sortPlugins=de,c._InternalMessageId=K,c.InstrumentProto=function(e,t,n){return e?Ae(e[d],t,n,!1):null},c.InstrumentProtos=function(e,t,n){return e?Oe(e[d],t,n,!1):null},c.InstrumentFunc=Ae,c.InstrumentFuncs=Oe,function(e,t,n){var i=Object.defineProperty;if(i)try{return i(e,t,n)}catch(r){}typeof n.value!==undefined&&(e[t]=n.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map

@@ -10,3 +10,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

export { CoreUtils, EventHelper, Undefined, normalizeJsName } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

@@ -13,0 +13,0 @@ export { DiagnosticLogger, _InternalLogMessage } from './JavaScriptSDK/DiagnosticLogger';

@@ -109,2 +109,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

_this._setInit(true);
_this.releaseQueue();
};

@@ -129,9 +130,2 @@ BaseCore.prototype.getTransmissionControls = function () {

if (_this.isInitialized()) {
// Release queue
if (_this._eventQueue.length > 0) {
_arrForEach(_this._eventQueue, function (event) {
_this.getProcessTelContext().processNext(event);
});
_this._eventQueue = [];
}
// Process the telemetry plugin chain

@@ -156,2 +150,11 @@ _this.getProcessTelContext().processNext(telemetryItem);

};
BaseCore.prototype.releaseQueue = function () {
var _this = this;
if (_this._eventQueue.length > 0) {
_arrForEach(_this._eventQueue, function (event) {
_this.getProcessTelContext().processNext(event);
});
_this._eventQueue = [];
}
};
return BaseCore;

@@ -158,0 +161,0 @@ }());

@@ -189,3 +189,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

var len = arr.length;
for (var idx = 0; idx < len; ++idx) {
for (var idx = 0; idx < len; idx++) {
if (idx in arr) {

@@ -192,0 +192,0 @@ callbackfn.call(thisArg || arr, arr[idx], idx, arr);

@@ -23,2 +23,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

var strCrypto = "crypto";
var strReactNative = "ReactNative";
/**

@@ -186,2 +187,13 @@ * Returns the current global scope object, for a normal web page this will be the current

}
/**
* Returns whether the environment is reporting that we are running in a React Native Environment
*/
export function isReactNative() {
// If running in React Native, navigator.product will be populated
var nav = getNavigator();
if (nav && nav.product) {
return nav.product === strReactNative;
}
return false;
}
//# sourceMappingURL=EnvUtils.js.map
/*!
* Application Insights JavaScript SDK - Core, 2.5.5
* Application Insights JavaScript SDK - Core, 2.5.6
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(c){"use strict";var r="function",o="object",n="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==n&&globalThis?globalThis:typeof self!==n&&self?self:typeof window!==n&&window?window:typeof global!==n&&global?global:null}function i(e){var n=Object.create;if(n)return n(e);if(null==e)return{};var t=typeof e;if(t!=o&&t!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,n){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)n[s](t)&&(e[t]=n[t])})(e,n)},t=e()||{};__assign=t.__assign=t.__assign||Object.assign||function(e){for(var n,t=1,i=arguments.length;t<i;t++)for(var r in n=arguments[t])Object[a][s].call(n,r)&&(e[r]=n[r]);return e},__extends=t.__extends=t.__extends||function(e,n){function t(){this.constructor=e}l(e,n),e[a]=null===n?i(n):(t[a]=n[a],new t)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=n,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var n=y();return n&&n[e]?n[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return!(typeof history!==g||!history)}function S(){return!!(typeof JSON===g&&JSON||null!==m(v))}function N(){return S()?JSON||m(v):null}var b=n,L="attachEvent",E="addEventListener",F="detachEvent",M="removeEventListener";function P(e,n){return typeof e===n}function A(e){return P(e,n)||e===undefined}function O(e){return A(e)||null===e}function D(e,n){return e&&Object[a].hasOwnProperty.call(e,n)}function R(e){return P(e,o)}function U(e){return P(e,r)}function j(e,n,t,i){void 0===i&&(i=!1);var r=!1;if(!O(e))try{O(e[E])?O(e[L])||(e[L]("on"+n,t),r=!0):(e[E](n,t,i),r=!0)}catch(o){}return r}function k(e,n,t,i){if(void 0===i&&(i=!1),!O(e))try{O(e[M])?O(e[F])||e[F]("on"+n,t):e[M](n,t,i)}catch(r){}}var z=(B.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},B.isString=function(e){return P(e,"string")},B.isNumber=function(e){return P(e,"number")},B.isBoolean=function(e){return P(e,"boolean")},B.disableCookies=function(){B._canUseCookies=!1},B.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(Q,function(e){var n,t=0|((n=m("crypto"))?n.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?t:3&t|8).toString(16)})},B.toISOString=function(e){if(B.isDate(e)){var n=function(e){var n=e+"";return 1===n.length&&(n="0"+n),n};return e.getUTCFullYear()+"-"+n(1+e.getUTCMonth())+"-"+n(e.getUTCDate())+"T"+n(e.getUTCHours())+":"+n(e.getUTCMinutes())+":"+n(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},B.arrForEach=function(e,n,t){for(var i=e.length,r=0;r<i;++r)r in e&&n.call(t||e,e[r],r,e)},B.arrIndexOf=function(e,n,t){for(var i=e.length,r=t||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===n)return o;return-1},B.arrMap=function(e,n,t){for(var i=e.length,r=t||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=n.call(r,e[a],e));return o},B.arrReduce=function(e,n,t){var i,r=e.length,o=0;if(3<=arguments.length)i=t;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=n(i,e[o],o,e)),o++;return i},B.strTrim=function(e){return B.isString(e)?e.replace(/^\s+|\s+$/g,""):e},B.objKeys=function(e){var n=!{toString:null}.propertyIsEnumerable("toString");if(!(U(e)||R(e)&&null!==e))throw new TypeError("objKeys called on non-object");var t=[];for(var i in e)D(e,i)&&t.push(i);if(n)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&t.push(r[a]);return t},B.objDefineAccessors=function(e,n,t,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return t&&(o.get=t),i&&(o.set=i),r(e,n,o),!0}catch(a){}return!1},B.addEventHandler=function(e,n){var t=!1,i=C();i&&(t=j(i,e,n),t=j(i.body,e,n)||t);var r=I();return r&&(t=V.Attach(r,e,n)||t),t},B.isTypeof=P,B.isUndefined=A,B.isNullOrUndefined=O,B.hasOwnProperty=D,B.isFunction=U,B.isObject=R,B.objCreate=i,B);function B(){}var q,Q=/[xy]/g,V=(W.Attach=j,W.AttachEvent=j,W.Detach=k,W.DetachEvent=k,W);function W(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var H={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},K=(G.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},G.dataType="MessageData",G.AiNonUserActionablePrefix="AI (Internal): ",G.AiUserActionablePrefix="AI: ",G);function G(e,n,t,i){void 0===t&&(t=!1),this.messageId=e,this.message=(t?G.AiUserActionablePrefix:G.AiNonUserActionablePrefix)+e;var r="";S()&&(r=N().stringify(i));var o=(n?" message:"+G.sanitizeDiagnosticText(n):"")+(i?" props:"+G.sanitizeDiagnosticText(r):"");this.message+=o}var J=(Z.prototype.throwInternal=function(e,n,t,i,r){void 0===r&&(r=!1);var o,a=new K(n,t,r,i),s=this;if(s.enableDebugExceptions())throw a;!z.isUndefined(a)&&a&&(z.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},Z.prototype.warnToConsole=function(e){!z.isUndefined(console)&&console&&(z.isFunction(console.warn)?console.warn(e):z.isFunction(console.log)&&console.log(e))},Z.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},Z.prototype.logInternalMessage=function(e,n){var t,i,r,o=this;o._areInternalMessagesThrottled()||(t=!0,i=o.AIInternalMessagePrefix+n.messageId,o._messageLogged[i]?t=!1:o._messageLogged[i]=!0,t&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(n),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new K(H.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},Z.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},Z);function Z(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},z.isNullOrUndefined(e)||(z.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),z.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),z.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),z.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var $=z.isFunction,Y=function(r,o){var a=this,s=null,l=$(r.processTelemetry),u=$(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,n){if(n=n||o,r&&l){a._hasRun=!0;try{n.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,n)}catch(i){var t=s&&s._hasRun;s&&t||n.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,H.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!t&&s.processTelemetry(e,n)}}else s&&(a._hasRun=!0,s.processTelemetry(e,n))}},X=z.isNullOrUndefined;function ee(e,n){var t=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&z.isFunction(a.processTelemetry)&&(o=new Y(a,n),t.push(o),i&&i.setNext(o),i=o)}return 0<t.length?t[0]:null}var ne=function Oe(e,o,t,n){var i,r,a,s,l=this,u=null;null!==n&&(e&&z.isFunction(e.getPlugin)?u=function(e,n,t){var i=[],r=!t;if(e)for(;e;){var o=e.getPlugin();!r&&o!==t||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(t),ee(i,n)}(e,l,n||e.getPlugin()):n?(i=l,a=e,s=!1,(r=n)&&e&&(a=[],z.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=ee(a,i)):z.isUndefined(n)&&(u=ee(e,l))),l.core=function(){return t},l.diagLog=function(){return(t||{}).logger||new J(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,n){var t,i;return void 0===n&&(n={}),!o||(i=o.extensionConfig)&&e&&(t=i[e]),t||n},l.getConfig=function(e,n,t){var i;void 0===t&&(t=!1);var r=l.getExtCfg(e,null);return r&&!X(r[n])?i=r[n]:o&&!X(o[n])&&(i=o[n]),X(i)?t:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var n=u;n&&(u=n.getNext(),n.processTelemetry(e,l))},l.createNew=function(e,n){return void 0===e&&(e=null),new Oe(e||u,o,t,n)}},te=z.isFunction,ie="getPlugin",re=(oe.prototype.initialize=function(e,n,t,i){this._baseTelInit(e,n,t,i)},oe);function oe(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,n){n?n.processNext(e):l&&te(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var n,t=e;return t||(n=s||new ne(null,{},o.core),t=l&&l[ie]?n.createNew(null,l[ie]):n.createNew(null,l)),t},o._baseTelInit=function(e,n,t,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&n&&(i=n.getProcessTelContext().getNext());var r=l;l&&l[ie]&&(r=l[ie]()),o.core=n,s=new ne(i,e,n,r),a=!0}}var ae=z.isFunction,se="processTelemetry",le="priority",ue="setNextPlugin",ce="isInitialized";function fe(n,t){for(var e=[],i=null,r=n.getNext();r;){var o=r.getPlugin();o&&(i&&ae(i[ue])&&ae(o[se])&&i[ue](o),ae(o[ce])&&o[ce]()||e.push(o),i=o,r=r.getNext())}z.arrForEach(e,function(e){e.initialize(n.getCfg(),n.core(),t,n.getNext())})}function ge(e){return e.sort(function(e,n){var t=0,i=ae(n[se]);return ae(e[se])?t=i?e[le]-n[le]:1:i&&(t=-1),t})}var de=z.arrForEach,he=z.objDefineAccessors;function pe(e,n){n&&0<n.length&&(n=n.sort(function(e,n){return e.priority-n.priority}),de(n,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(n))}var ve,ye=(ve=re,__extends(me,ve),me.prototype.processTelemetry=function(n,t){var i=this;this._channelQueue&&de(this._channelQueue,function(e){0<e.length&&i._getTelCtx(t).createNew(e).processNext(n)})},me.prototype.getChannelControls=function(){return this._channelQueue},me.prototype.initialize=function(n,t,i){var e,r,o,a,s;this.isInitialized()||(ve.prototype.initialize.call(this,n,t,i),n.isCookieUseDisabled&&z.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(n||{}).channels)&&de(r,function(e){return pe(s,e)}),o&&(a=[],de(o,function(e){500<e.priority&&a.push(e)}),pe(s,a)),s),de(e,function(e){return fe(new ne(e,n,t),i)}))},me._staticInit=(he(me.prototype,"ChannelControls",me.prototype.getChannelControls),void he(me.prototype,"channelQueue",me.prototype.getChannelControls)),me);function me(){var e=null!==ve&&ve.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var xe=z.arrForEach,Ce=z.isNullOrUndefined,Te=(Ie.prototype.initialize=function(e,n,i,t){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Ce(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;t=t||z.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,n){},eventsSendRequest:function(e,n){}}),r._notificationManager=t,e.extensions=Ce(e.extensions)?[]:e.extensions,(e.extensionConfig=Ce(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=t,i=i||z.objCreate({throwInternal:function(e,n,t,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,n.concat(e.extensions)),a=ge(a);var s=[],l={};if(xe(a,function(e){if(Ce(e)||Ce(e.initialize))throw Error("Extensions must provide callback to initialize");var n=e.priority,t=e.identifier;e&&n&&(Ce(l[n])?l[n]=t:i.warnToConsole("Two extensions have same priority #"+n+" - "+l[n]+", "+t)),(!n||n<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=ge(a),r._extensions=a,fe(new ne([o],e,r),a),fe(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0)},Ie.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ie.prototype.track=function(e){var n=this;e.iKey||(e.iKey=n.config.instrumentationKey),e.time||(e.time=z.toISOString(new Date)),Ce(e.ver)&&(e.ver="4.0"),n.isInitialized()?(0<n._eventQueue.length&&(xe(n._eventQueue,function(e){n.getProcessTelContext().processNext(e)}),n._eventQueue=[]),n.getProcessTelContext().processNext(e)):n._eventQueue.push(e)},Ie.prototype.getProcessTelContext=function(){var e=this._extensions,n=e;return e&&0!==e.length||(n=[this._channelController]),new ne(n,this.config,this)},Ie);function Ie(){var n=!1,e=this;e._extensions=[],e._channelController=new ye,e.isInitialized=function(){return n},e._setInit=function(e){n=e},e._eventQueue=[]}var _e=(we.prototype.addNotificationListener=function(e){this.listeners.push(e)},we.prototype.removeNotificationListener=function(e){for(var n=z.arrIndexOf(this.listeners,e);-1<n;)this.listeners.splice(n,1),n=z.arrIndexOf(this.listeners,e)},we.prototype.eventsSent=function(n){for(var t=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return t.listeners[e].eventsSent(n)},0)}(e)},we.prototype.eventsDiscarded=function(n,t){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(n,t)},0)}(e)},we.prototype.eventsSendRequest=function(t,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(t,i)},0);else try{o.listeners[e].eventsSendRequest(t,i)}catch(n){}}(e)},we);function we(){this.listeners=[]}var Se,Ne=(Se=Te,__extends(be,Se),be.prototype.initialize=function(e,n){var t=this;t._notificationManager=new _e,t.logger=new J(e),t.config=e,Se.prototype.initialize.call(this,e,n,t.logger,t._notificationManager)},be.prototype.getTransmissionControls=function(){return Se.prototype.getTransmissionControls.call(this)},be.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Se.prototype.track.call(this,e)},be.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},be.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},be.prototype.pollInternalLogs=function(i){var n=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var t=n,e=t.logger?t.logger.queue:[];z.arrForEach(e,function(e){var n={name:i||"InternalMessageId: "+e.messageId,iKey:t.config.instrumentationKey,time:z.toISOString(new Date),baseType:K.dataType,baseData:{message:e.message}};t.track(n)}),e.length=0},e)},be.prototype._validateTelemetryItem=function(e){if(z.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},be.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},be);function be(){return Se.call(this)||this}var Le="_aiHooks",Ee=["req","rsp","hkErr","fnErr"];function Fe(e,n){if(e)for(var t=0;t<e.length&&!n(e[t],t);t++);}function Me(e,l,u,c,f){0<=f&&f<=2&&Fe(e,function(e,n){var t=e.cbks,i=t[Ee[f]];if(i){l.ctx=function(){return c[n]=c[n]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=t[Ee[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Pe(e,n,t,i){if(void 0===i&&(i=!0),e&&n&&t){var r=function c(e,n,t){var i=null;return e&&(z.hasOwnProperty(e,n)?i=e:t&&(i=c(e[d],n,!1))),i}(e,n,i),o=r[n];if(typeof o===h){var a,s=o[Le];s||(u=s={i:0,n:n,f:o,h:[]},(a=function(){var t=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,n){(t=o([],t))[e]=n,r=o([i],t)}},n=[],r=o([i],t);function o(n,e){return Fe(e,function(e){n.push(e)}),n}Me(e,i,r,n,0);var a=u.f;try{i.rslt=a.apply(this,t)}catch(s){throw i.err=s,Me(e,i,r,n,3),s}return Me(e,i,r,n,1),i.rslt})[Le]=s,r[n]=a);var l={id:s.i,cbks:t,rm:function(){var t=this.id;Fe(s.h,function(e,n){return e.id===t&&(s.h.splice(n,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Ae(t,e,i,r){void 0===r&&(r=!0);var o=null;return Fe(e,function(e){var n=Pe(t,e,i,r);n&&(o=o||[]).push(n)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=Ne,c.BaseCore=Te,c.BaseTelemetryPlugin=re,c.CoreUtils=z,c.EventHelper=V,c.Undefined=b,c.normalizeJsName=function(e){var n=e,t=/([^\w\d_$])/g;return t.test(e)&&(n=e.replace(t,"_")),n},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=function(){return _()?navigator:m("navigator")},c.hasHistory=w,c.getHistory=function(){return w()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=S,c.getJSON=N,c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=_e,c.DiagnosticLogger=J,c._InternalLogMessage=K,c.ProcessTelemetryContext=ne,c.initializePlugins=fe,c.sortPlugins=ge,c._InternalMessageId=H,c.InstrumentProto=function(e,n,t){return e?Pe(e[d],n,t,!1):null},c.InstrumentProtos=function(e,n,t){return e?Ae(e[d],n,t,!1):null},c.InstrumentFunc=Pe,c.InstrumentFuncs=Ae,function(e,n,t){var i=Object.defineProperty;if(i)try{return i(e,n,t)}catch(r){}typeof t.value!==undefined&&(e[n]=t.value)}(c,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights=e.Microsoft.ApplicationInsights||{}))}(this,function(c){"use strict";var r="function",o="object",t="undefined",a="prototype",s="hasOwnProperty";function e(){return typeof globalThis!==t&&globalThis?globalThis:typeof self!==t&&self?self:typeof window!==t&&window?window:typeof global!==t&&global?global:null}function i(e){var t=Object.create;if(t)return t(e);if(null==e)return{};var n=typeof e;if(n!=o&&n!=r)throw new TypeError("Object prototype may only be an Object:"+e);function i(){}return i[a]=e,new i}var l=function(e,t){return(l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t[s](n)&&(e[n]=t[n])})(e,t)},n=e()||{};__assign=n.__assign=n.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object[a][s].call(t,r)&&(e[r]=t[r]);return e},__extends=n.__extends=n.__extends||function(e,t){function n(){this.constructor=e}l(e,t),e[a]=null===t?i(t):(n[a]=t[a],new n)};var u={Unknown:0,NonRetryableStatus:1,InvalidEvent:2,SizeLimitExceeded:3,KillSwitch:4,QueueFull:5},f=t,g=o,d=a,h=r,p="window",v="JSON",y=e;function m(e){var t=y();return t&&t[e]?t[e]:e===p&&x()?window:null}function x(){return!(typeof window!==g||!window)}function C(){return x()?window:m(p)}function T(){return!(typeof document!==g||!document)}function I(){return T()?document:m("document")}function _(){return!(typeof navigator!==g||!navigator)}function w(){return _()?navigator:m("navigator")}function S(){return!(typeof history!==g||!history)}function N(){return!!(typeof JSON===g&&JSON||null!==m(v))}function b(){return N()?JSON||m(v):null}var L=t,E="attachEvent",F="addEventListener",M="detachEvent",P="removeEventListener";function A(e,t){return typeof e===t}function O(e){return A(e,t)||e===undefined}function R(e){return O(e)||null===e}function D(e,t){return e&&Object[a].hasOwnProperty.call(e,t)}function U(e){return A(e,o)}function j(e){return A(e,r)}function k(e,t,n,i){void 0===i&&(i=!1);var r=!1;if(!R(e))try{R(e[F])?R(e[E])||(e[E]("on"+t,n),r=!0):(e[F](t,n,i),r=!0)}catch(o){}return r}function z(e,t,n,i){if(void 0===i&&(i=!1),!R(e))try{R(e[P])?R(e[M])||e[M]("on"+t,n):e[P](t,n,i)}catch(r){}}var B=(Q.isDate=function(e){return"[object Date]"===Object[a].toString.call(e)},Q.isString=function(e){return A(e,"string")},Q.isNumber=function(e){return A(e,"number")},Q.isBoolean=function(e){return A(e,"boolean")},Q.disableCookies=function(){Q._canUseCookies=!1},Q.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(V,function(e){var t,n=0|((t=m("crypto"))?t.getRandomValues(new Uint8Array(1))[0]%16:16*Math.random());return("x"===e?n:3&n|8).toString(16)})},Q.toISOString=function(e){if(Q.isDate(e)){var t=function(e){var t=e+"";return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(1+e.getUTCMonth())+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"}},Q.arrForEach=function(e,t,n){for(var i=e.length,r=0;r<i;r++)r in e&&t.call(n||e,e[r],r,e)},Q.arrIndexOf=function(e,t,n){for(var i=e.length,r=n||0,o=Math.max(0<=r?r:i-Math.abs(r),0);o<i;o++)if(o in e&&e[o]===t)return o;return-1},Q.arrMap=function(e,t,n){for(var i=e.length,r=n||e,o=Array(i),a=0;a<i;a++)a in e&&(o[a]=t.call(r,e[a],e));return o},Q.arrReduce=function(e,t,n){var i,r=e.length,o=0;if(3<=arguments.length)i=n;else{for(;o<r&&!(o in e);)o++;i=e[o++]}for(;o<r;)o in e&&(i=t(i,e[o],o,e)),o++;return i},Q.strTrim=function(e){return Q.isString(e)?e.replace(/^\s+|\s+$/g,""):e},Q.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(j(e)||U(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var i in e)D(e,i)&&n.push(i);if(t)for(var r=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],o=r.length,a=0;a<o;a++)D(e,r[a])&&n.push(r[a]);return n},Q.objDefineAccessors=function(e,t,n,i){var r=Object.defineProperty;if(r)try{var o={enumerable:!0,configurable:!0};return n&&(o.get=n),i&&(o.set=i),r(e,t,o),!0}catch(a){}return!1},Q.addEventHandler=function(e,t){var n=!1,i=C();i&&(n=k(i,e,t),n=k(i.body,e,t)||n);var r=I();return r&&(n=W.Attach(r,e,t)||n),n},Q.isTypeof=A,Q.isUndefined=O,Q.isNullOrUndefined=R,Q.hasOwnProperty=D,Q.isFunction=j,Q.isObject=U,Q.objCreate=i,Q);function Q(){}var q,V=/[xy]/g,W=(H.Attach=k,H.AttachEvent=k,H.Detach=z,H.DetachEvent=z,H);function H(){}(q=c.LoggingSeverity||(c.LoggingSeverity={}))[q.CRITICAL=1]="CRITICAL",q[q.WARNING=2]="WARNING";var K={BrowserDoesNotSupportLocalStorage:0,BrowserCannotReadLocalStorage:1,BrowserCannotReadSessionStorage:2,BrowserCannotWriteLocalStorage:3,BrowserCannotWriteSessionStorage:4,BrowserFailedRemovalFromLocalStorage:5,BrowserFailedRemovalFromSessionStorage:6,CannotSendEmptyTelemetry:7,ClientPerformanceMathError:8,ErrorParsingAISessionCookie:9,ErrorPVCalc:10,ExceptionWhileLoggingError:11,FailedAddingTelemetryToBuffer:12,FailedMonitorAjaxAbort:13,FailedMonitorAjaxDur:14,FailedMonitorAjaxOpen:15,FailedMonitorAjaxRSC:16,FailedMonitorAjaxSend:17,FailedMonitorAjaxGetCorrelationHeader:18,FailedToAddHandlerForOnBeforeUnload:19,FailedToSendQueuedTelemetry:20,FailedToReportDataLoss:21,FlushFailed:22,MessageLimitPerPVExceeded:23,MissingRequiredFieldSpecification:24,NavigationTimingNotSupported:25,OnError:26,SessionRenewalDateIsZero:27,SenderNotInitialized:28,StartTrackEventFailed:29,StopTrackEventFailed:30,StartTrackFailed:31,StopTrackFailed:32,TelemetrySampledAndNotSent:33,TrackEventFailed:34,TrackExceptionFailed:35,TrackMetricFailed:36,TrackPVFailed:37,TrackPVFailedCalc:38,TrackTraceFailed:39,TransmissionFailed:40,FailedToSetStorageBuffer:41,FailedToRestoreStorageBuffer:42,InvalidBackendResponse:43,FailedToFixDepricatedValues:44,InvalidDurationValue:45,TelemetryEnvelopeInvalid:46,CreateEnvelopeError:47,CannotSerializeObject:48,CannotSerializeObjectNonSerializable:49,CircularReferenceDetected:50,ClearAuthContextFailed:51,ExceptionTruncated:52,IllegalCharsInName:53,ItemNotInArray:54,MaxAjaxPerPVExceeded:55,MessageTruncated:56,NameTooLong:57,SampleRateOutOfRange:58,SetAuthContextFailed:59,SetAuthContextFailedAccountName:60,StringValueTooLong:61,StartCalledMoreThanOnce:62,StopCalledWithoutStart:63,TelemetryInitializerFailed:64,TrackArgumentsNotSpecified:65,UrlTooLong:66,SessionStorageBufferFull:67,CannotAccessCookie:68,IdTooLong:69,InvalidEvent:70,FailedMonitorAjaxSetRequestHeader:71,SendBrowserInfoOnUserInit:72,PluginException:73,NotificationException:74,SnippetScriptLoadFailure:99},G=(J.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},J.dataType="MessageData",J.AiNonUserActionablePrefix="AI (Internal): ",J.AiUserActionablePrefix="AI: ",J);function J(e,t,n,i){void 0===n&&(n=!1),this.messageId=e,this.message=(n?J.AiUserActionablePrefix:J.AiNonUserActionablePrefix)+e;var r="";N()&&(r=b().stringify(i));var o=(t?" message:"+J.sanitizeDiagnosticText(t):"")+(i?" props:"+J.sanitizeDiagnosticText(r):"");this.message+=o}var Z=($.prototype.throwInternal=function(e,t,n,i,r){void 0===r&&(r=!1);var o,a=new G(t,n,r,i),s=this;if(s.enableDebugExceptions())throw a;!B.isUndefined(a)&&a&&(B.isUndefined(a.message)||(r?(o=+a.messageId,!s._messageLogged[o]&&s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&(s.warnToConsole(a.message),s._messageLogged[o]=!0)):s.consoleLoggingLevel()>=c.LoggingSeverity.WARNING&&s.warnToConsole(a.message),s.logInternalMessage(e,a)))},$.prototype.warnToConsole=function(e){!B.isUndefined(console)&&console&&(B.isFunction(console.warn)?console.warn(e):B.isFunction(console.log)&&console.log(e))},$.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},$.prototype.logInternalMessage=function(e,t){var n,i,r,o=this;o._areInternalMessagesThrottled()||(n=!0,i=o.AIInternalMessagePrefix+t.messageId,o._messageLogged[i]?n=!1:o._messageLogged[i]=!0,n&&(e<=o.telemetryLoggingLevel()&&(o.queue.push(t),o._messageCount++),o._messageCount===o.maxInternalMessageLimit()&&(r=new G(K.MessageLimitPerPVExceeded,"Internal events throttle limit per PageView reached for this app.",!1),o.queue.push(r),o.warnToConsole("Internal events throttle limit per PageView reached for this app."))))},$.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},$);function $(e){this.queue=[],this.AIInternalMessagePrefix="AITR_",this._messageCount=0,this._messageLogged={},this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},B.isNullOrUndefined(e)||(B.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),B.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),B.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),B.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Y=B.isFunction,X=function(r,o){var a=this,s=null,l=Y(r.processTelemetry),u=Y(r.setNextPlugin);a._hasRun=!1,a.getPlugin=function(){return r},a.getNext=function(){return s},a.setNext=function(e){s=e},a.processTelemetry=function(e,t){if(t=t||o,r&&l){a._hasRun=!0;try{t.setNext(s),u&&r.setNextPlugin(s),s&&(s._hasRun=!1),r.processTelemetry(e,t)}catch(i){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(c.LoggingSeverity.CRITICAL,K.PluginException,"Plugin ["+r.identifier+"] failed during processTelemetry - "+i),s&&!n&&s.processTelemetry(e,t)}}else s&&(a._hasRun=!0,s.processTelemetry(e,t))}},ee=B.isNullOrUndefined;function te(e,t){var n=[];if(e&&0<e.length)for(var i=null,r=0;r<e.length;r++){var o,a=e[r];a&&B.isFunction(a.processTelemetry)&&(o=new X(a,t),n.push(o),i&&i.setNext(o),i=o)}return 0<n.length?n[0]:null}var ne=function Re(e,o,n,t){var i,r,a,s,l=this,u=null;null!==t&&(e&&B.isFunction(e.getPlugin)?u=function(e,t,n){var i=[],r=!n;if(e)for(;e;){var o=e.getPlugin();!r&&o!==n||(r=!0,i.push(o)),e=e.getNext()}return r||i.push(n),te(i,t)}(e,l,t||e.getPlugin()):t?(i=l,a=e,s=!1,(r=t)&&e&&(a=[],B.arrForEach(e,function(e){!s&&e!==r||(s=!0,a.push(e))})),r&&!s&&(a=a||[]).push(r),u=te(a,i)):B.isUndefined(t)&&(u=te(e,l))),l.core=function(){return n},l.diagLog=function(){return(n||{}).logger||new Z(o||{})},l.getCfg=function(){return o},l.getExtCfg=function(e,t){var n,i;return void 0===t&&(t={}),!o||(i=o.extensionConfig)&&e&&(n=i[e]),n||t},l.getConfig=function(e,t,n){var i;void 0===n&&(n=!1);var r=l.getExtCfg(e,null);return r&&!ee(r[t])?i=r[t]:o&&!ee(o[t])&&(i=o[t]),ee(i)?n:i},l.hasNext=function(){return null!=u},l.getNext=function(){return u},l.setNext=function(e){u=e},l.processNext=function(e){var t=u;t&&(u=t.getNext(),t.processTelemetry(e,l))},l.createNew=function(e,t){return void 0===e&&(e=null),new Re(e||u,o,n,t)}},ie=B.isFunction,re="getPlugin",oe=(ae.prototype.initialize=function(e,t,n,i){this._baseTelInit(e,t,n,i)},ae);function ae(){var o=this,a=!1,s=null,l=null;o.core=null,o.diagLog=function(e){return o._getTelCtx(e).diagLog()},o.isInitialized=function(){return a},o.setInitialized=function(e){a=e},o.setNextPlugin=function(e){l=e},o.processNext=function(e,t){t?t.processNext(e):l&&ie(l.processTelemetry)&&l.processTelemetry(e,null)},o._getTelCtx=function(e){void 0===e&&(e=null);var t,n=e;return n||(t=s||new ne(null,{},o.core),n=l&&l[re]?t.createNew(null,l[re]):t.createNew(null,l)),n},o._baseTelInit=function(e,t,n,i){e&&(e.extensionConfig=e.extensionConfig||[]),!i&&t&&(i=t.getProcessTelContext().getNext());var r=l;l&&l[re]&&(r=l[re]()),o.core=t,s=new ne(i,e,t,r),a=!0}}var se=B.isFunction,le="processTelemetry",ue="priority",ce="setNextPlugin",fe="isInitialized";function ge(t,n){for(var e=[],i=null,r=t.getNext();r;){var o=r.getPlugin();o&&(i&&se(i[ce])&&se(o[le])&&i[ce](o),se(o[fe])&&o[fe]()||e.push(o),i=o,r=r.getNext())}B.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function de(e){return e.sort(function(e,t){var n=0,i=se(t[le]);return se(e[le])?n=i?e[ue]-t[ue]:1:i&&(n=-1),n})}var he=B.arrForEach,pe=B.objDefineAccessors;function ve(e,t){t&&0<t.length&&(t=t.sort(function(e,t){return e.priority-t.priority}),he(t,function(e){if(e.priority<500)throw Error("Channel has invalid priority"+e.identifier)}),e.push(t))}var ye,me=(ye=oe,__extends(xe,ye),xe.prototype.processTelemetry=function(t,n){var i=this;this._channelQueue&&he(this._channelQueue,function(e){0<e.length&&i._getTelCtx(n).createNew(e).processNext(t)})},xe.prototype.getChannelControls=function(){return this._channelQueue},xe.prototype.initialize=function(t,n,i){var e,r,o,a,s;this.isInitialized()||(ye.prototype.initialize.call(this,t,n,i),t.isCookieUseDisabled&&B.disableCookies(),e=this._channelQueue=(o=i,s=[],(r=(t||{}).channels)&&he(r,function(e){return ve(s,e)}),o&&(a=[],he(o,function(e){500<e.priority&&a.push(e)}),ve(s,a)),s),he(e,function(e){return ge(new ne(e,t,n),i)}))},xe._staticInit=(pe(xe.prototype,"ChannelControls",xe.prototype.getChannelControls),void pe(xe.prototype,"channelQueue",xe.prototype.getChannelControls)),xe);function xe(){var e=null!==ye&&ye.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=500,e}var Ce=B.arrForEach,Te=B.isNullOrUndefined,Ie=(_e.prototype.initialize=function(e,t,i,n){var r=this;if(r.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Te(e.instrumentationKey))throw Error("Please provide instrumentation key");r.config=e;var o=r._channelController;n=n||B.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){},eventsSendRequest:function(e,t){}}),r._notificationManager=n,e.extensions=Te(e.extensions)?[]:e.extensions,(e.extensionConfig=Te(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,i=i||B.objCreate({throwInternal:function(e,t,n,i,r){void 0===r&&(r=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),r.logger=i;var a=[];a.push.apply(a,t.concat(e.extensions)),a=de(a);var s=[],l={};if(Ce(a,function(e){if(Te(e)||Te(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Te(l[t])?l[t]=n:i.warnToConsole("Two extensions have same priority #"+t+" - "+l[t]+", "+n)),(!t||t<o.priority)&&s.push(e)}),a.push(o),s.push(o),a=de(a),r._extensions=a,ge(new ne([o],e,r),a),ge(new ne(s,e,r),a),r._extensions=s,0===r.getTransmissionControls().length)throw Error("No channels available");r._setInit(!0),r.releaseQueue()},_e.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},_e.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=B.toISOString(new Date)),Te(e.ver)&&(e.ver="4.0"),this.isInitialized()?this.getProcessTelContext().processNext(e):this._eventQueue.push(e)},_e.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new ne(t,this.config,this)},_e.prototype.releaseQueue=function(){var t=this;0<t._eventQueue.length&&(Ce(t._eventQueue,function(e){t.getProcessTelContext().processNext(e)}),t._eventQueue=[])},_e);function _e(){var t=!1,e=this;e._extensions=[],e._channelController=new me,e.isInitialized=function(){return t},e._setInit=function(e){t=e},e._eventQueue=[]}var we=(Se.prototype.addNotificationListener=function(e){this.listeners.push(e)},Se.prototype.removeNotificationListener=function(e){for(var t=B.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=B.arrIndexOf(this.listeners,e)},Se.prototype.eventsSent=function(t){for(var n=this,i=this,e=0;e<this.listeners.length;++e)!function(e){i.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)}(e)},Se.prototype.eventsDiscarded=function(t,n){for(var i=this,r=this,e=0;e<this.listeners.length;++e)!function(e){r.listeners[e].eventsDiscarded&&setTimeout(function(){return i.listeners[e].eventsDiscarded(t,n)},0)}(e)},Se.prototype.eventsSendRequest=function(n,i){for(var r=this,o=this,e=0;e<this.listeners.length;++e)!function(e){if(o.listeners[e].eventsSendRequest)if(i)setTimeout(function(){return r.listeners[e].eventsSendRequest(n,i)},0);else try{o.listeners[e].eventsSendRequest(n,i)}catch(t){}}(e)},Se);function Se(){this.listeners=[]}var Ne,be=(Ne=Ie,__extends(Le,Ne),Le.prototype.initialize=function(e,t){var n=this;n._notificationManager=new we,n.logger=new Z(e),n.config=e,Ne.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},Le.prototype.getTransmissionControls=function(){return Ne.prototype.getTransmissionControls.call(this)},Le.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Ne.prototype.track.call(this,e)},Le.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Le.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Le.prototype.pollInternalLogs=function(i){var t=this,e=this.config.diagnosticLogInterval;return e&&0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];B.arrForEach(e,function(e){var t={name:i||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:B.toISOString(new Date),baseType:G.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},Le.prototype._validateTelemetryItem=function(e){if(B.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Le.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u.InvalidEvent)},Le);function Le(){return Ne.call(this)||this}var Ee="_aiHooks",Fe=["req","rsp","hkErr","fnErr"];function Me(e,t){if(e)for(var n=0;n<e.length&&!t(e[n],n);n++);}function Pe(e,l,u,c,f){0<=f&&f<=2&&Me(e,function(e,t){var n=e.cbks,i=n[Fe[f]];if(i){l.ctx=function(){return c[t]=c[t]||{}};try{i.apply(l.inst,u)}catch(a){var r=l.err;try{var o=n[Fe[2]];o&&(l.err=a,o.apply(l.inst,u))}catch(s){}finally{l.err=r}}}})}function Ae(e,t,n,i){if(void 0===i&&(i=!0),e&&t&&n){var r=function c(e,t,n){var i=null;return e&&(B.hasOwnProperty(e,t)?i=e:n&&(i=c(e[d],t,!1))),i}(e,t,i),o=r[t];if(typeof o===h){var a,s=o[Ee];s||(u=s={i:0,n:t,f:o,h:[]},(a=function(){var n=arguments,e=u.h,i={name:u.n,inst:this,ctx:null,set:function(e,t){(n=o([],n))[e]=t,r=o([i],n)}},t=[],r=o([i],n);function o(t,e){return Me(e,function(e){t.push(e)}),t}Pe(e,i,r,t,0);var a=u.f;try{i.rslt=a.apply(this,n)}catch(s){throw i.err=s,Pe(e,i,r,t,3),s}return Pe(e,i,r,t,1),i.rslt})[Ee]=s,r[t]=a);var l={id:s.i,cbks:n,rm:function(){var n=this.id;Me(s.h,function(e,t){return e.id===n&&(s.h.splice(t,1),1)})}};return s.i++,s.h.push(l),l}}var u;return null}function Oe(n,e,i,r){void 0===r&&(r=!0);var o=null;return Me(e,function(e){var t=Ae(n,e,i,r);t&&(o=o||[]).push(t)}),o}c.MinChannelPriorty=100,c.EventsDiscardedReason=u,c.AppInsightsCore=be,c.BaseCore=Ie,c.BaseTelemetryPlugin=oe,c.CoreUtils=B,c.EventHelper=W,c.Undefined=L,c.normalizeJsName=function(e){var t=e,n=/([^\w\d_$])/g;return n.test(e)&&(t=e.replace(n,"_")),t},c.getGlobal=y,c.getGlobalInst=m,c.hasWindow=x,c.getWindow=C,c.hasDocument=T,c.getDocument=I,c.hasNavigator=_,c.getNavigator=w,c.hasHistory=S,c.getHistory=function(){return S()?history:m("history")},c.getLocation=function(){return typeof location===g&&location?location:m("location")},c.getPerformance=function(){return m("performance")},c.hasJSON=N,c.getJSON=b,c.isReactNative=function(){var e=w();return!(!e||!e.product)&&"ReactNative"===e.product},c.strUndefined=f,c.strObject=g,c.strPrototype=d,c.strFunction=h,c.NotificationManager=we,c.DiagnosticLogger=Z,c._InternalLogMessage=G,c.ProcessTelemetryContext=ne,c.initializePlugins=ge,c.sortPlugins=de,c._InternalMessageId=K,c.InstrumentProto=function(e,t,n){return e?Ae(e[d],t,n,!1):null},c.InstrumentProtos=function(e,t,n){return e?Oe(e[d],t,n,!1):null},c.InstrumentFunc=Ae,c.InstrumentFuncs=Oe,function(e,t,n){var i=Object.defineProperty;if(i)try{return i(e,t,n)}catch(r){}typeof n.value!==undefined&&(e[t]=n.value)}(c,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-core-js.min.js.map
{
"name": "@microsoft/applicationinsights-core-js",
"author": "Microsoft Corporation",
"version": "2.5.5",
"version": "2.5.6",
"description": "Microsoft Application Insights Core Javascript SDK",

@@ -33,3 +33,3 @@ "keywords": [

"devDependencies": {
"@microsoft/applicationinsights-rollup-es3" : "1.1.1",
"@microsoft/applicationinsights-rollup-es3" : "1.1.2",
"grunt": "1.0.1",

@@ -50,5 +50,5 @@ "grunt-contrib-clean": "^1.1.0",

"dependencies": {
"@microsoft/applicationinsights-shims" : "1.0.0",
"@microsoft/applicationinsights-shims" : "1.0.1",
"@microsoft/dynamicproto-js": "^0.5.2"
}
}

@@ -95,4 +95,4 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

let coreExtensions:any[] = [];
let channelExtensions:any[] = [];
let coreExtensions: any[] = [];
let channelExtensions: any[] = [];

@@ -153,2 +153,3 @@ // Check if any two extensions have the same priority, then warn to console

_this._setInit(true);
_this.releaseQueue();
}

@@ -176,9 +177,2 @@

if (_this.isInitialized()) {
// Release queue
if (_this._eventQueue.length > 0) {
_arrForEach(_this._eventQueue, (event: ITelemetryItem) => {
_this.getProcessTelContext().processNext(event);
});
_this._eventQueue = [];
}
// Process the telemetry plugin chain

@@ -205,2 +199,12 @@ _this.getProcessTelContext().processNext(telemetryItem);

}
protected releaseQueue() {
let _this = this;
if (_this._eventQueue.length > 0) {
_arrForEach(_this._eventQueue, (event: ITelemetryItem) => {
_this.getProcessTelContext().processNext(event);
});
_this._eventQueue = [];
}
}
}

@@ -224,3 +224,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

let len = arr.length;
for (let idx = 0; idx < len; ++idx) {
for (let idx = 0; idx < len; idx++) {
if (idx in arr) {

@@ -227,0 +227,0 @@ callbackfn.call(thisArg || arr, arr[idx], idx, arr);

@@ -29,2 +29,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved.

const strCrypto = "crypto";
const strReactNative = "ReactNative";

@@ -216,1 +217,14 @@ /**

}
/**
* Returns whether the environment is reporting that we are running in a React Native Environment
*/
export function isReactNative(): boolean {
// If running in React Native, navigator.product will be populated
var nav = getNavigator();
if (nav && nav.product) {
return nav.product === strReactNative;
}
return false;
}

@@ -18,3 +18,3 @@ import '@microsoft/applicationinsights-shims';

export { CoreUtils, EventHelper, Undefined, normalizeJsName } from "./JavaScriptSDK/CoreUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { getGlobal, getGlobalInst, hasWindow, getWindow, hasDocument, getDocument, hasNavigator, getNavigator, hasHistory, getHistory, getLocation, getPerformance, hasJSON, getJSON, isReactNative, strUndefined, strObject, strPrototype, strFunction } from "./JavaScriptSDK/EnvUtils";
export { NotificationManager } from "./JavaScriptSDK/NotificationManager";

@@ -21,0 +21,0 @@ export { INotificationManager } from "./JavaScriptSDK.Interfaces/INotificationManager";

@@ -24,2 +24,3 @@ import { IAppInsightsCore } from "../JavaScriptSDK.Interfaces/IAppInsightsCore";

getProcessTelContext(): IProcessTelemetryContext;
protected releaseQueue(): void;
}

@@ -117,1 +117,5 @@ /**

export declare function getCrypto(): Crypto | null;
/**
* Returns whether the environment is reporting that we are running in a React Native Environment
*/
export declare function isReactNative(): boolean;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc