Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@microsoft/applicationinsights-dependencies-js

Package Overview
Dependencies
Maintainers
5
Versions
597
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.4.0-beta to 2.4.0

4

browser/applicationinsights-dependencies-js.min.js
/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.4.0-beta
* Application Insights JavaScript SDK - Dependencies Plugin, 2.4.0
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!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={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,p,a,l,o,s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=p=p||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(o=l=l||{})[o.AI=0]="AI",o[o.AI_AND_W3C=1]="AI_AND_W3C",o[o.W3C=2]="W3C";var c=2,u="object";function d(){return Boolean(typeof window===u&&window)}function f(){return d()?window:null}function g(){return function e(){return Boolean(typeof document===u&&document)}()?document:d()&&f().document||null}function h(){return Boolean(typeof JSON===u&&JSON)}function m(){return h()?JSON:null}var v="undefined",x="prototype",y="attachEvent",I="addEventListener",D="detachEvent",C="removeEventListener";function S(e,t){return typeof e===t}function b(e){return e===undefined||S(e,v)}function _(e){return b(e)||null===e}function T(e,t){return e&&Object[x].hasOwnProperty.call(e,t)}function N(e){return S(e,"object")}function A(e){return S(e,"function")}function M(e,t,n,r){void 0===r&&(r=!1);var a=!1;if(!_(e))try{_(e[I])?_(e[y])||(e[y]("on"+t,n),a=!0):(e[I](t,n,r),a=!0)}catch(i){}return a}function w(e,t,n,r){if(void 0===r&&(r=!1),!_(e))try{_(e[C])?_(e[D])||e[D]("on"+t,n):e[C](t,n,r)}catch(a){}}var L=(R.isDate=function(e){return"[object Date]"===Object[x].toString.call(e)},R.isString=function(e){return S(e,"string")},R.isNumber=function(e){return S(e,"number")},R.isBoolean=function(e){return S(e,"boolean")},R.disableCookies=function(){R._canUseCookies=!1},R.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(j,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},R.toISOString=function(e){if(R.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},R.arrForEach=function(e,t,n){for(var r=e.length,a=0;a<r;++a)a in e&&t.call(n||e,e[a],a,e)},R.arrIndexOf=function(e,t,n){for(var r=e.length,a=n||0,i=Math.max(0<=a?a:r-Math.abs(a),0);i<r;i++)if(i in e&&e[i]===t)return i;return-1},R.arrMap=function(e,t,n){for(var r=e.length,a=n||e,i=new Array(r),o=0;o<r;o++)o in e&&(i[o]=t.call(a,e[o],e));return i},R.arrReduce=function(e,t,n){var r,a=e.length,i=0;if(3<=arguments.length)r=n;else{for(;i<a&&!(i in e);)i++;r=e[i++]}for(;i<a;)i in e&&(r=t(r,e[i],i,e)),i++;return r},R.objCreate=function(e){if(null==e)return{};if(!N(e)&&!A(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[x]=e,new t},R.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(A(e)||N(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)T(e,r)&&n.push(r);if(t)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=a.length,o=0;o<i;o++)T(e,a[o])&&n.push(a[o]);return n},R.objDefineAccessors=function(e,t,n,r){var a=Object.defineProperty;if(a)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),a(e,t,i),!0}catch(o){}return!1},R.addEventHandler=function(e,t){var n=!1,r=f();r&&(n=M(r,e,t),n=M(r.body,e,t)||n);var a=g();return a&&(n=E.Attach(a,e,t)||n),n},R.isTypeof=S,R.isUndefined=b,R.isNullOrUndefined=_,R.hasOwnProperty=T,R.isFunction=A,R.isObject=N,R);function R(){}var q,H,j=/[xy]/g,E=(F.Attach=M,F.AttachEvent=M,F.Detach=w,F.DetachEvent=w,F);function F(){}(H=q=q||{})[H.CRITICAL=1]="CRITICAL",H[H.WARNING=2]="WARNING";var k=1,U=2,z=3,O=4,P=5,G=6,W=13,X=14,B=15,V=16,K=17,Q=18,J=23,$=49,Y=52,Z=55,ee=56,te=57,ne=61,re=66,ae=68,ie=69,oe=71,se=73,ce=(ue.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},ue.dataType="MessageData",ue.AiNonUserActionablePrefix="AI (Internal): ",ue.AiUserActionablePrefix="AI: ",ue);function ue(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ue.AiUserActionablePrefix:ue.AiNonUserActionablePrefix)+e;var a="";h()&&(a=m().stringify(r));var i=(t?" message:"+ue.sanitizeDiagnosticText(t):"")+(r?" props:"+ue.sanitizeDiagnosticText(a):"");this.message+=i}var le=(de.prototype.throwInternal=function(e,t,n,r,a){void 0===a&&(a=!1);var i=new ce(t,n,a,r),o=this;if(o.enableDebugExceptions())throw i;if(!L.isUndefined(i)&&i&&!L.isUndefined(i.message)){if(a){var s=+i.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=q.WARNING&&(o.warnToConsole(i.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=q.WARNING&&o.warnToConsole(i.message);o.logInternalMessage(e,i)}},de.prototype.warnToConsole=function(e){!L.isUndefined(console)&&console&&(L.isFunction(console.warn)?console.warn(e):L.isFunction(console.log)&&console.log(e))},de.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},de.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,a=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[a]?r=!1:n._messageLogged[a]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",o=new ce(J,i,!1);n.queue.push(o),n.warnToConsole(i)}}},de.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},de);function de(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},L.isNullOrUndefined(e)||(L.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),L.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),L.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),L.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var fe=L.isFunction,ge=function Tn(a,i){var o=this,s=null,c=fe(a.processTelemetry),u=fe(a.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return a},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||i,a&&c){o._hasRun=!0;try{t.setNext(s),u&&a.setNextPlugin(s),s&&(s._hasRun=!1),a.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(q.CRITICAL,se,"Plugin ["+a.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},pe=L.isNullOrUndefined;function he(e,t){var n=[];if(e&&0<e.length)for(var r=null,a=0;a<e.length;a++){var i=e[a];if(i&&L.isFunction(i.processTelemetry)){var o=new ge(i,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var me=function Nn(e,i,n,t){var o=this,r=null;null!==t&&(e&&L.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],a=!n;if(e)for(;e;){var i=e.getPlugin();!a&&i!==n||(a=!0,r.push(i)),e=e.getNext()}return a||r.push(n),he(r,t)}(e,o,t||e.getPlugin()):t?r=function c(e,t,n){var r=e,a=!1;return n&&e&&(r=[],L.arrForEach(e,function(e){!a&&e!==n||(a=!0,r.push(e))})),n&&!a&&(r=r||[]).push(n),he(r,t)}(e,o,t):L.isUndefined(t)&&(r=he(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new le(i||{})},o.getCfg=function(){return i},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),i){var r=i.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var a=o.getExtCfg(e,null);return a&&!pe(a[t])?r=a[t]:i&&!pe(i[t])&&(r=i[t]),pe(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Nn(e||r,i,n,t)}},ve=L.isFunction,xe="getPlugin",ye=(Ie.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},Ie);function Ie(){var i=this,o=!1,s=null,c=null;i.core=null,i.diagLog=function(e){return i._getTelCtx(e).diagLog()},i.isInitialized=function(){return o},i.setInitialized=function(e){o=e},i.setNextPlugin=function(e){c=e},i.processNext=function(e,t){t?t.processNext(e):c&&ve(c.processTelemetry)&&c.processTelemetry(e,null)},i._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new me(null,{},i.core);t=c&&c[xe]?n.createNew(null,c[xe]):n.createNew(null,c)}return t},i._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var a=c;c&&c[xe]&&(a=c[xe]()),i.core=t,s=new me(r,e,t,a),o=!0}}var De=L.isFunction,Ce="processTelemetry",Se="priority",be="setNextPlugin",_e="isInitialized";function Te(t,n){for(var e=[],r=null,a=t.getNext();a;){var i=a.getPlugin();i&&(r&&De(r[be])&&De(i[Ce])&&r[be](i),De(i[_e])&&i[_e]()||e.push(i),r=i,a=a.getNext())}L.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function Ne(e){return e.sort(function(e,t){var n=0,r=De(t[Ce]);return De(e[Ce])?n=r?e[Se]-t[Se]:1:r&&(n=-1),n})}var Ae=500,Me="Channel has invalid priority",we=L.arrForEach,Le=L.objDefineAccessors;function Re(e,t){t&&0<t.length&&(function n(e){we(e,function(e){if(e.priority<Ae)throw Error(Me+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var qe,He=(t(je,qe=ye),je.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&we(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},je.prototype.getChannelControls=function(){return this._channelQueue},je.prototype.initialize=function(t,n,r){if(!this.isInitialized()){qe.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&L.disableCookies();var e=this._channelQueue=function a(e,t){var n=[];if(e&&we(e,function(e){return Re(n,e)}),t){var r=[];we(t,function(e){e.priority>Ae&&r.push(e)}),Re(n,r)}return n}((t||{}).channels,r);we(e,function(e){return Te(new me(e,t,n),r)})}},je._staticInit=(Le(je.prototype,"ChannelControls",je.prototype.getChannelControls),void Le(je.prototype,"channelQueue",je.prototype.getChannelControls)),je);function je(){var e=null!==qe&&qe.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ae,e}var Ee=L.arrForEach,Fe=L.isNullOrUndefined,ke=(Ue.prototype.initialize=function(e,t,r,n){var a=this;if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Fe(e.instrumentationKey))throw Error("Please provide instrumentation key");a.config=e;var i=a._channelController;n=n||L.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),a._notificationManager=n,e.extensions=Fe(e.extensions)?[]:e.extensions,(e.extensionConfig=Fe(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||L.objCreate({throwInternal:function(e,t,n,r,a){void 0===a&&(a=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=Ne(o);var s=[],c={};if(Ee(o,function(e){if(Fe(e)||Fe(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Fe(c[t])?c[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+c[t]+", "+n)),(!t||t<i.priority)&&s.push(e)}),o.push(i),s.push(i),o=Ne(o),a._extensions=o,Te(new me([i],e,a),o),Te(new me(s,e,a),o),a._extensions=s,0===a.getTransmissionControls().length)throw new Error("No channels available");a._setInit(!0)},Ue.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ue.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=L.toISOString(new Date)),Fe(e.ver)&&(e.ver="4.0"),this.getProcessTelContext().processNext(e)},Ue.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new me(t,this.config,this)},Ue);function Ue(){var t=!1;this._extensions=new Array,this._channelController=new He,this.isInitialized=function(){return t},this._setInit=function(e){t=e}}var ze=(Oe.prototype.addNotificationListener=function(e){this.listeners.push(e)},Oe.prototype.removeNotificationListener=function(e){for(var t=L.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=L.arrIndexOf(this.listeners,e)},Oe.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,a=0;a<this.listeners.length;++a)e(a)},Oe.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){a.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},a=this,i=0;i<this.listeners.length;++i)e(i)},Oe);function Oe(){this.listeners=[]}var Pe;t(Ge,Pe=ke),Ge.prototype.initialize=function(e,t){var n=this;n._notificationManager=new ze,n.logger=new le(e),n.config=e,Pe.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},Ge.prototype.getTransmissionControls=function(){return Pe.prototype.getTransmissionControls.call(this)},Ge.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Pe.prototype.track.call(this,e)},Ge.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Ge.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Ge.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];L.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:L.toISOString(new Date),baseType:ce.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},Ge.prototype._validateTelemetryItem=function(e){if(L.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Ge.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],c)};function Ge(){return Pe.call(this)||this}var We=(Xe.requestContextHeader="Request-Context",Xe.requestContextTargetKey="appId",Xe.requestContextAppIdFormat="appId=cid-v1:",Xe.requestIdHeader="Request-Id",Xe.traceParentHeader="traceparent",Xe.sdkContextHeader="Sdk-Context",Xe.sdkContextHeaderAppIdRequest="appId",Xe.requestContextHeaderLowerCase="request-context",Xe);function Xe(){}var Be=(Ve.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=Ve.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;n[o]!==undefined;)i++,o=a.substring(0,Ve.MAX_NAME_LENGTH-3)+Ve.padNumber(i);a=o}return a},Ve.sanitizeKey=function(e,t){var n;return t&&(t=Ve.trim(t.toString())).length>Ve.MAX_NAME_LENGTH&&(n=t.substring(0,Ve.MAX_NAME_LENGTH),e.throwInternal(q.WARNING,te,"name is too long. It has been truncated to "+Ve.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},Ve.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=Ve.MAX_STRING_LENGTH),t&&(n=n||Ve.MAX_STRING_LENGTH,(t=Ve.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(q.WARNING,ne,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},Ve.sanitizeUrl=function(e,t){return Ve.sanitizeInput(e,t,Ve.MAX_URL_LENGTH,re)},Ve.sanitizeMessage=function(e,t){var n;return t&&t.length>Ve.MAX_MESSAGE_LENGTH&&(n=t.substring(0,Ve.MAX_MESSAGE_LENGTH),e.throwInternal(q.WARNING,ee,"message is too long, it has been truncated to "+Ve.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},Ve.sanitizeException=function(e,t){var n;return t&&t.length>Ve.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,Ve.MAX_EXCEPTION_LENGTH),e.throwInternal(q.WARNING,Y,"exception is too long, it has been truncated to "+Ve.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},Ve.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var a=t[r];if(L.isObject(a)&&h())try{a=m().stringify(a)}catch(i){e.throwInternal(q.WARNING,$,"custom property is not valid",{exception:i},!0)}a=Ve.sanitizeString(e,a,Ve.MAX_PROPERTY_LENGTH),n[r=Ve.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},Ve.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=Ve.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},Ve.sanitizeId=function(e,t){return t?Ve.sanitizeInput(e,t,Ve.MAX_ID_LENGTH,ie).toString():t},Ve.sanitizeInput=function(e,t,n,r){var a;return t&&(t=Ve.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(q.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},Ve.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},Ve.trim=function(e){return L.isString(e)?e.replace(/^\s+|\s+$/g,""):e},Ve.MAX_NAME_LENGTH=150,Ve.MAX_ID_LENGTH=128,Ve.MAX_PROPERTY_LENGTH=8192,Ve.MAX_STRING_LENGTH=1024,Ve.MAX_URL_LENGTH=2048,Ve.MAX_MESSAGE_LENGTH=32768,Ve.MAX_EXCEPTION_LENGTH=32768,Ve);function Ve(){}var Ke="prototype",Qe=f(),Je=function An(){return function e(){return Boolean(typeof navigator===u&&navigator)}()?navigator:null}(),$e=L.isString,Ye=(Ze.createDomEvent=function(e){var t=null;return L.isFunction(Event)?t=new Event(e):(t=g().createEvent("Event")).initEvent(e,!0,!0),t},Ze.disableStorage=function(){Ze._canUseLocalStorage=!1,Ze._canUseSessionStorage=!1},Ze._getLocalStorageObject=function(){return Ze.canUseLocalStorage()?Ze._getVerifiedStorageObject(i.LocalStorage):null},Ze._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(L.isNullOrUndefined(Qe))return null;n=new Date,(r=e===i.LocalStorage?Qe.localStorage:Qe.sessionStorage).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(a){r=null}return r},Ze.isInternalApplicationInsightsEndpoint=function(e){return-1!==Ze._internalEndpoints.indexOf(e.toLowerCase())},Ze.canUseLocalStorage=function(){return Ze._canUseLocalStorage===undefined&&(Ze._canUseLocalStorage=!!Ze._getVerifiedStorageObject(i.LocalStorage)),Ze._canUseLocalStorage},Ze.getStorage=function(e,t){var n=Ze._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,k,"Browser failed read of local storage. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return null},Ze.setStorage=function(e,t,n){var r=Ze._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,z,"Browser failed write to local storage. "+Ze.getExceptionName(a),{exception:Ze.dump(a)})}return!1},Ze.removeStorage=function(e,t){var n=Ze._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,P,"Browser failed removal of local storage item. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return!1},Ze._getSessionStorageObject=function(){return Ze.canUseSessionStorage()?Ze._getVerifiedStorageObject(i.SessionStorage):null},Ze.canUseSessionStorage=function(){return Ze._canUseSessionStorage===undefined&&(Ze._canUseSessionStorage=!!Ze._getVerifiedStorageObject(i.SessionStorage)),Ze._canUseSessionStorage},Ze.getSessionStorageKeys=function(){var e=[];if(Ze.canUseSessionStorage())for(var t in Qe.sessionStorage)e.push(t);return e},Ze.getSessionStorage=function(e,t){var n=Ze._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,U,"Browser failed read of session storage. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return null},Ze.setSessionStorage=function(e,t,n){var r=Ze._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,O,"Browser failed write to session storage. "+Ze.getExceptionName(a),{exception:Ze.dump(a)})}return!1},Ze.removeSessionStorage=function(e,t){var n=Ze._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,G,"Browser failed removal of session storage item. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return!1},Ze.disableCookies=function(){L.disableCookies()},Ze.canUseCookies=function(e){if(L._canUseCookies===undefined){L._canUseCookies=!1;try{L._canUseCookies=Ze.document.cookie!==undefined}catch(t){e.throwInternal(q.WARNING,ae,"Cannot access document.cookie - "+Ze.getExceptionName(t),{exception:Ze.dump(t)})}}return L._canUseCookies},Ze.setCookie=function(e,t,n,r){n+=";SameSite=None";var a="",i="";r&&(a=";domain="+r),Ze.document.location&&"https:"===Ze.document.location.protocol&&(i=";secure"),Ze.canUseCookies(e)&&(Ze.document.cookie=t+"="+n+a+";path=/"+i)},Ze.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},Ze.getCookie=function(e,t){if(Ze.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=Ze.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=Ze.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},Ze.deleteCookie=function(e,t){Ze.canUseCookies(e)&&(Ze.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Ze.trim=function(e){return $e(e)?e.replace(/^\s+|\s+$/g,""):e},Ze.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Ze.random32=function(){return 4294967296*Math.random()|0},Ze.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=Ze.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var a=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)},Ze.isArray=function(e){return"[object Array]"===Object[Ke].toString.call(e)},Ze.isError=function(e){return"[object Error]"===Object[Ke].toString.call(e)},Ze.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():Je?Je.userAgent.toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},Ze.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},Ze.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},Ze.dump=function(e){var t=Object[Ke].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":h()&&(n=m().stringify(e)),t+n},Ze.getExceptionName=function(e){return"[object Error]"===Object[Ke].toString.call(e)?e.name:""},Ze.addEventHandler=function(e,t){return E.Attach(Qe,e,t)},Ze.IsBeaconApiSupported=function(){return"sendBeacon"in Je&&Je.sendBeacon},Ze.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},Ze.document=g()||{},Ze._canUseLocalStorage=undefined,Ze._canUseSessionStorage=undefined,Ze._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Ze.NotSpecified="not_specified",Ze.isDate=L.isDate,Ze.toISOStringForIE8=L.toISOString,Ze);function Ze(){}var et=(tt.parseUrl=function(e){return tt.htmlAnchorElement||(tt.htmlAnchorElement=tt.document.createElement?tt.document.createElement("a"):{host:tt.parseHost(e)}),tt.htmlAnchorElement.href=e,tt.htmlAnchorElement},tt.getAbsoluteUrl=function(e){var t,n=tt.parseUrl(e);return n&&(t=n.href),t},tt.getPathName=function(e){var t,n=tt.parseUrl(e);return n&&(t=n.pathname),t},tt.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},tt.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&$e(t[2])&&0<t[2].length)return t[2]}return null},tt.document=g()||{},tt);function tt(){}var nt=(rt.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=et.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(L.arrForEach(i,function(e){var t=new RegExp(e.toLowerCase().replace(/\./g,".").replace(/\*/g,".*"));a=a||t.test(r)}),!a))return!1;var o=e&&e.correlationHeaderExcludedDomains;if(!o||0===o.length)return!0;for(var s=0;s<o.length;s++)if(new RegExp(o[s].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},rt.getCorrelationContext=function(e){if(e){var t=rt.getCorrelationContextValue(e,We.requestContextTargetKey);if(t&&t!==rt.correlationIdPrefix)return t}},rt.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2===a.length&&a[0]===t)return a[1]}},rt.correlationIdPrefix="cid-v1:",rt);function rt(){}var at=(it.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=et.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=Be.sanitizeString(e,n?n+" "+c:c)}else i=Be.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},it);function it(){}var ot=(st.Now=L.isUndefined(Qe)?function(){return(new Date).getTime()}:Qe.performance&&Qe.performance.now&&Qe.performance.timing?function(){return Qe.performance.now()+Qe.performance.timing.navigationStart}:function(){return(new Date).getTime()},st.GetDuration=function(e,t){var n=null;return 0===e||0===t||L.isNullOrUndefined(e)||L.isNullOrUndefined(t)||(n=t-e),n},st);function st(){}var ct,ut="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",lt=(t(dt,ct=function Mn(){}),dt);function dt(){return ct.call(this)||this}var ft;t(gt,ft=function wn(){this.ver=1,this.sampleRate=100,this.tags={}});function gt(e,t,n){var r=ft.call(this)||this;return r.name=Be.sanitizeString(e,n)||Ye.NotSpecified,r.data=t,r.time=L.toISOString(new Date),r.aiDataContract={time:p.Required,iKey:p.Required,name:p.Required,sampleRate:function(){return 100===r.sampleRate?p.Hidden:p.Required},tags:p.Required,data:p.Required},r}var pt,ht=function Ln(){},mt=(t(vt,pt=ht),vt);function vt(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var xt;t(yt,xt=mt),yt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",yt.dataType="EventData";function yt(e,t,n,r){var a=xt.call(this)||this;return a.aiDataContract={ver:p.Required,name:p.Required,properties:p.Default,measurements:p.Default},a.name=Be.sanitizeString(e,t)||Ye.NotSpecified,a.properties=Be.sanitizeProperties(e,n),a.measurements=Be.sanitizeMeasurements(e,r),a}var It,Dt=function Rn(){},Ct=(t(St,It=ht),St);function St(){var e=It.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var bt,_t=function qn(){this.hasFullStack=!0,this.parsedStack=[]};t(Tt,bt=Ct),Tt.CreateFromInterface=function(t,e){var n=e.exceptions&&L.arrMap(e.exceptions,function(e){return At.CreateFromInterface(t,e)});return new Tt(t,s({},e,{exceptions:n}))},Tt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&L.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:a,properties:n,measurements:r,problemGroup:i,id:o,isManual:s}},Tt.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},Tt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Tt.dataType="ExceptionData";function Tt(e,t,n,r,a,i){var o=bt.call(this)||this;return o.aiDataContract={ver:p.Required,exceptions:p.Required,severityLevel:p.Default,properties:p.Default,measurements:p.Default},t instanceof Error?(o.exceptions=[new At(e,t)],o.properties=Be.sanitizeProperties(e,n),o.measurements=Be.sanitizeMeasurements(e,r),a&&(o.severityLevel=a),i&&(o.id=i)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,L.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Nt,At=(t(Mt,Nt=_t),Mt.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&L.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Mt.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&L.arrMap(t.parsedStack,function(e){return Lt.CreateFromInterface(e)})||t.parsedStack;return new Mt(e,s({},t,{parsedStack:n}))},Mt.parseStack=function(e){var t;if(L.isString(e)){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(Lt.regex.test(o)){var s=new Lt(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var g=f-d+1;t.splice(d,g);break}d=c,f=u,c++,u--}}return t},Mt);function Mt(e,t){var n=Nt.call(this)||this;if(n.aiDataContract={id:p.Default,outerId:p.Default,typeName:p.Required,message:p.Required,hasFullStack:p.Default,stack:p.Default,parsedStack:p.Array},t instanceof Error){n.typeName=Be.sanitizeString(e,t.name)||Ye.NotSpecified,n.message=Be.sanitizeMessage(e,t.message)||Ye.NotSpecified;var r=t.stack;n.parsedStack=Mt.parseStack(r),n.stack=Be.sanitizeException(e,r),n.hasFullStack=Ye.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var wt,Lt=(t(Rt,wt=Dt),Rt.CreateFromInterface=function(e){return new Rt(e,null)},Rt.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Rt.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Rt.baseSize=58,Rt);function Rt(e,t){var n=wt.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:p.Required,method:p.Required,assembly:p.Default,fileName:p.Default,line:p.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Ye.trim(r),n.fileName="",n.line=0;var a=r.match(Rt.regex);a&&5<=a.length&&(n.method=Ye.trim(a[2])||n.method,n.fileName=Ye.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Rt.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qt,Ht,jt,Et=(t(Ft,qt=ht),Ft);function Ft(){var e=qt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(jt=Ht=Ht||{})[jt.Measurement=0]="Measurement",jt[jt.Aggregation=1]="Aggregation";var kt,Ut=(t(zt,kt=function Hn(){this.kind=Ht.Measurement}),zt);function zt(){var e=null!==kt&&kt.apply(this,arguments)||this;return e.aiDataContract={name:p.Required,kind:p.Default,value:p.Required,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default},e}var Ot;t(Pt,Ot=Et),Pt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Pt.dataType="MetricData";function Pt(e,t,n,r,a,i,o,s){var c=Ot.call(this)||this;c.aiDataContract={ver:p.Required,metrics:p.Required,properties:p.Default};var u=new Ut;return u.count=0<r?r:undefined,u.max=isNaN(i)||null===i?undefined:i,u.min=isNaN(a)||null===a?undefined:a,u.name=Be.sanitizeString(e,t)||Ye.NotSpecified,u.value=n,c.metrics=[u],c.properties=Be.sanitizeProperties(e,o),c.measurements=Be.sanitizeMeasurements(e,s),c}var Gt,Wt=(t(Xt,Gt=mt),Xt);function Xt(){var e=Gt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Bt;t(Vt,Bt=Wt),Vt.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Vt.dataType="PageviewData";function Vt(e,t,n,r,a,i,o){var s=Bt.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,properties:p.Default,measurements:p.Default,id:p.Default},s.id=Be.sanitizeId(e,o),s.url=Be.sanitizeUrl(e,n),s.name=Be.sanitizeString(e,t)||Ye.NotSpecified,isNaN(r)||(s.duration=Ye.msToTimeSpan(r)),s.properties=Be.sanitizeProperties(e,a),s.measurements=Be.sanitizeMeasurements(e,i),s}var Kt,Qt=(t(Jt,Kt=ht),Jt);function Jt(){var e=Kt.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var $t,Yt=(t(Zt,$t=Qt),Zt.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Zt.dataType="RemoteDependencyData",Zt);function Zt(e,t,n,r,a,i,o,s,c,u,l,d){void 0===c&&(c="Ajax");var f=$t.call(this)||this;f.aiDataContract={id:p.Required,ver:p.Required,name:p.Default,resultCode:p.Default,duration:p.Default,success:p.Default,data:p.Default,target:p.Default,type:p.Default,properties:p.Default,measurements:p.Default,kind:p.Default,value:p.Default,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default,dependencyKind:p.Default,dependencySource:p.Default,commandName:p.Default,dependencyTypeName:p.Default},f.id=t,f.duration=Ye.msToTimeSpan(a),f.success=i,f.resultCode=o+"",f.type=Be.sanitizeString(e,c);var g=at.ParseDependencyPath(e,n,s,r);return f.data=Be.sanitizeUrl(e,r)||g.data,f.target=Be.sanitizeString(e,g.target),u&&(f.target=f.target+" | "+u),f.name=Be.sanitizeString(e,g.name),f.properties=Be.sanitizeProperties(e,l),f.measurements=Be.sanitizeMeasurements(e,d),f}var en,tn=(t(nn,en=ht),nn);function nn(){var e=en.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var rn;t(an,rn=tn),an.envelopeType="Microsoft.ApplicationInsights.{0}.Message",an.dataType="MessageData";function an(e,t,n,r,a){var i=rn.call(this)||this;return i.aiDataContract={ver:p.Required,message:p.Required,severityLevel:p.Default,properties:p.Default},t=t||Ye.NotSpecified,i.message=Be.sanitizeMessage(e,t),i.properties=Be.sanitizeProperties(e,r),i.measurements=Be.sanitizeMeasurements(e,a),n&&(i.severityLevel=n),i}var on,sn=(t(cn,on=Wt),cn);function cn(){var e=on.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var un;t(ln,un=sn),ln.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",ln.dataType="PageviewPerformanceData";function ln(e,t,n,r,a,i,o){var s=un.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,perfTotal:p.Default,networkConnect:p.Default,sentRequest:p.Default,receivedResponse:p.Default,domProcessing:p.Default,properties:p.Default,measurements:p.Default},s.url=Be.sanitizeUrl(e,n),s.name=Be.sanitizeString(e,t)||Ye.NotSpecified,s.properties=Be.sanitizeProperties(e,a),s.measurements=Be.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var dn,fn,gn;t(pn,dn=lt);function pn(e,t){var n=dn.call(this)||this;return n.aiDataContract={baseType:p.Required,baseData:p.Required},n.baseType=e,n.baseData=t,n}(gn=fn=fn||{})[gn.Verbose=0]="Verbose",gn[gn.Information=1]="Information",gn[gn.Warning=2]="Warning",gn[gn.Error=3]="Error",gn[gn.Critical=4]="Critical";var hn=(mn.create=function(e,t,n,r,a,i){if(n=Be.sanitizeString(r,n)||Ye.NotSpecified,L.isNullOrUndefined(e)||L.isNullOrUndefined(t)||L.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:L.toISOString(new Date),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!L.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},mn);function mn(){}var vn=function jn(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},xn=(yn.prototype.getAbsoluteUrl=function(){return this.requestUrl?et.getAbsoluteUrl(this.requestUrl):null},yn.prototype.getPathName=function(){return this.requestUrl?Be.sanitizeUrl(this._logger,et.getCompleteUrl(this.method,this.requestUrl)):null},yn);function yn(e,t,n){this.completed=!1,this.requestHeadersSize=null,this.requestHeaders=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new vn,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*ot.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var In=(Dn.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},Dn.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},Dn.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},Dn.DEFAULT_TRACE_FLAG="01",Dn.DEFAULT_VERSION="00",Dn);function Dn(e,t){this.traceFlag=Dn.DEFAULT_TRACE_FLAG,this.version=Dn.DEFAULT_VERSION,e&&Dn.isValidTraceId(e)?this.traceId=e:this.traceId=Ye.generateW3CId(),t&&Dn.isValidSpanId(t)?this.spanId=t:this.spanId=Ye.generateW3CId().substr(0,16)}var Cn,Sn=L.isNullOrUndefined,bn=(t(_n,Cn=ye),_n.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:l.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},_n.getEmptyConfig=function(){return{maxAjaxCallsPerView:undefined,disableAjaxTracking:undefined,disableFetchTracking:undefined,disableCorrelationHeaders:undefined,distributedTracingMode:undefined,correlationHeaderExcludedDomains:undefined,appId:undefined,enableCorsCorrelation:undefined,correlationHeaderDomains:undefined,enableRequestHeaderTracking:undefined,enableResponseHeaderTracking:undefined}},_n.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{Sn(e)||Sn(e.ajaxData)||Sn(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(n){}return t},_n.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},_n.prototype.processTelemetry=function(e,t){this.processNext(e,t)},_n.prototype.includeCorrelationHeaders=function(e,t,n,r){var a=this;if(t){if(nt.canIncludeCorrelationHeader(a._config,e.getAbsoluteUrl(),a.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),a._isUsingAIHeaders){var i="|"+e.traceID+"."+e.spanID;n.headers.set(We.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.requestIdHeader]=i)}if((s=a._config.appId||a._context.appId())&&(n.headers.set(We.requestContextHeader,We.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.requestContextHeader]=We.requestContextAppIdFormat+s)),a._isUsingW3CHeaders){var o=new In(e.traceID,e.spanID);n.headers.set(We.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.traceParentHeader]=o.toString())}return n}return n}if(r){var s;if(a.currentWindowHost&&nt.canIncludeCorrelationHeader(a._config,r.ajaxData.getAbsoluteUrl(),a.currentWindowHost))a._isUsingAIHeaders&&(i="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(We.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.requestIdHeader]=i)),(s=a._config.appId||a._context.appId())&&(r.setRequestHeader(We.requestContextHeader,We.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.requestContextHeader]=We.requestContextAppIdFormat+s)),a._isUsingW3CHeaders&&(o=new In(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(We.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.traceParentHeader]=o.toString()));return r}return undefined},_n.prototype.initialize=function(e,t,n,r){var a=this;Cn.prototype.initialize.call(this,e,t,n,r);var i=a._getTelCtx();if(!a.initialized&&!a._fetchInitialized){var o=_n.getDefaultConfig();for(var s in a._config=_n.getEmptyConfig(),o)a._config[s]=i.getConfig(_n.identifier,s,o[s]);if(a._isUsingAIHeaders=a._config.distributedTracingMode===l.AI||a._config.distributedTracingMode===l.AI_AND_W3C,a._isUsingW3CHeaders=a._config.distributedTracingMode===l.AI_AND_W3C||a._config.distributedTracingMode===l.W3C,!1===a._config.disableAjaxTracking&&a.instrumentXhr(),!1===a._config.disableFetchTracking&&a.instrumentFetch(),0<n.length&&n){for(var c=void 0,u=0;!c&&u<n.length;)n[u]&&"AppInsightsPropertiesPlugin"===n[u].identifier&&(c=n[u]),u++;c&&(a._context=c.context)}}},_n.prototype.trackDependencyDataInternal=function(e,t,n){var r=this;if(-1===r._config.maxAjaxCallsPerView||r._trackAjaxAttempts<r._config.maxAjaxCallsPerView){var a=hn.create(e,Yt.dataType,Yt.envelopeType,r.diagLog(),t,n);r.core.track(a)}else r._trackAjaxAttempts===r._config.maxAjaxCallsPerView&&r.diagLog().throwInternal(q.CRITICAL,Z,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++r._trackAjaxAttempts},_n.prototype.instrumentFetch=function(){var a=this;if(a.supportsFetch()&&!a._fetchInitialized){var e=f(),i=e.fetch,o=a;e.fetch=function(t,e){var n;if(o.isFetchInstrumented(t)&&o.isMonitoredInstance(undefined,undefined,t,e))try{n=o.createFetchRecord(t,e),e=o.includeCorrelationHeaders(n,t,e)}catch(r){o.diagLog().throwInternal(q.CRITICAL,B,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedFetchDiagnosticsMessage(t),exception:Ye.dump(r)})}return i(t,e).then(function(e){return o.onFetchComplete(e,n),e})["catch"](function(e){throw o.onFetchFailed(t,n,e),e})},a._fetchInitialized=!0}},_n.prototype.instrumentXhr=function(){var e=this;e.supportsAjaxMonitoring()&&!e.initialized&&(e.instrumentOpen(),e.instrumentSend(),e.instrumentAbort(),e.instrumentSetRequestHeader(),e.initialized=!0)},_n.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[ut]||!!r&&!0===r[ut]):void 0!==e&&(o=this.initialized,a=!0===e[ut],i=!0===t||!Sn(e.ajaxData)),o&&i&&!a},_n.prototype.supportsAjaxMonitoring=function(){var e=!0;return("undefined"==typeof XMLHttpRequest||Sn(XMLHttpRequest)||Sn(XMLHttpRequest.prototype)||Sn(XMLHttpRequest.prototype.open)||Sn(XMLHttpRequest.prototype.send)||Sn(XMLHttpRequest.prototype.abort))&&(e=!1),e},_n.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,o=this;XMLHttpRequest.prototype.open=function(e,t,n){var r=this;try{!o.isMonitoredInstance(r,!0)||r.ajaxData&&r.ajaxData.xhrMonitoringState.openDone||o.openHandler(r,e,t,n)}catch(a){o.diagLog().throwInternal(q.CRITICAL,B,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(r),exception:Ye.dump(a)})}return i.apply(r,arguments)}},_n.prototype.openHandler=function(e,t,n,r){var a=this,i=a._context&&a._context.telemetryTrace&&a._context.telemetryTrace.traceID||Ye.generateW3CId(),o=Ye.generateW3CId().substr(0,16),s=new xn(i,o,a.diagLog());s.method=t,s.requestUrl=n,s.xhrMonitoringState.openDone=!0,s.requestHeaders={},e.ajaxData=s,a.attachToOnReadyStateChange(e)},_n.prototype.instrumentSend=function(){var r=XMLHttpRequest.prototype.send,a=this;XMLHttpRequest.prototype.send=function(e){var t=this;try{a.isMonitoredInstance(t)&&!t.ajaxData.xhrMonitoringState.sendDone&&a.sendHandler(t,e)}catch(n){a.diagLog().throwInternal(q.CRITICAL,K,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(t),exception:Ye.dump(n)})}return r.apply(t,arguments)}},_n.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=ot.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,undefined,undefined,e)).ajaxData.xhrMonitoringState.sendDone=!0},_n.prototype.instrumentAbort=function(){var n=XMLHttpRequest.prototype.abort,r=this;XMLHttpRequest.prototype.abort=function(){var e=this;try{r.isMonitoredInstance(e)&&!e.ajaxData.xhrMonitoringState.abortDone&&(e.ajaxData.aborted=1,e.ajaxData.xhrMonitoringState.abortDone=!0)}catch(t){r.diagLog().throwInternal(q.CRITICAL,W,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),exception:Ye.dump(t)})}return n.apply(e,arguments)}},_n.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var a=XMLHttpRequest.prototype.setRequestHeader,i=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){var n=this;try{i.isMonitoredInstance(n)&&(n.ajaxData.requestHeaders[e]=t)}catch(r){i.diagLog().throwInternal(q.CRITICAL,oe,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(n),exception:Ye.dump(r)})}return a.apply(n,arguments)}}},_n.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=E.Attach(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(t){var e=Ye.dump(t);e&&-1!==e.toLowerCase().indexOf("c00c023f")||r.diagLog().throwInternal(q.CRITICAL,V,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(n),exception:Ye.dump(t)})}})},_n.prototype.onAjaxComplete=function(e){var t=this;if(e.ajaxData.responseFinishedTime=ot.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)t.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var n={id:"|"+e.ajaxData.traceID+"."+e.ajaxData.spanID,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},r=t.getAjaxCorrelationContext(e);if(r&&(n.correlationContext=r),t._config.enableRequestHeaderTracking&&0<L.objKeys(e.ajaxData.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders={},n.properties.requestHeaders=e.ajaxData.requestHeaders),t._config.enableResponseHeaderTracking){var a=e.getAllResponseHeaders();if(a){var i=a.trim().split(/[\r\n]+/),o={};L.arrForEach(i,function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");o[n]=r}),0<L.objKeys(o).length&&(n.properties=n.properties||{},n.properties.responseHeaders={},n.properties.responseHeaders=o)}}t.trackDependencyDataInternal(n),e.ajaxData=null}},_n.prototype.getAjaxCorrelationContext=function(e){try{var t=e.getAllResponseHeaders();if(null!==t&&-1!==t.toLowerCase().indexOf(We.requestContextHeaderLowerCase)){var n=e.getResponseHeader(We.requestContextHeader);return nt.getCorrelationContext(n)}}catch(r){this.diagLog().throwInternal(q.WARNING,Q,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),exception:Ye.dump(r)})}},_n.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[ut]},_n.prototype.supportsFetch=function(){var e=!0,t=f();return(!t||Sn(t.Request)||Sn(t.Request.prototype)||Sn(t.fetch))&&(e=!1),e},_n.prototype.createFetchRecord=function(e,t){var n=this,r=n._context&&n._context.telemetryTrace&&n._context.telemetryTrace.traceID||Ye.generateW3CId(),a=Ye.generateW3CId().substr(0,16),i=new xn(r,a,n.diagLog());return i.requestSentTime=ot.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",t&&t.headers&&n._config.enableRequestHeaderTracking?i.requestHeaders=t.headers:i.requestHeaders={},i},_n.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{Sn(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(n){this.diagLog().throwInternal(q.CRITICAL,B,"Failed to grab failed fetch diagnostics message",{exception:Ye.dump(n)})}return t},_n.prototype.onFetchComplete=function(e,t){var n=this;if(t)try{if(t.responseFinishedTime=ot.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)n.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var r={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:200<=e.status&&e.status<400,responseCode:e.status,properties:{HttpMethod:t.method}},a=n.getFetchCorrelationContext(e);if(a&&(r.correlationContext=a),n._config.enableRequestHeaderTracking&&0<L.objKeys(t.requestHeaders).length&&(r.properties=r.properties||{},r.properties.requestHeaders=t.requestHeaders),n._config.enableResponseHeaderTracking){var i={};e.headers.forEach(function(e,t){i[t]=e}),0<L.objKeys(i).length&&(r.properties=r.properties||{},r.properties.responseHeaders=i)}n.trackDependencyDataInternal(r)}}catch(o){n.diagLog().throwInternal(q.WARNING,Q,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(o)})}},_n.prototype.onFetchFailed=function(e,t,n){var r=this;if(t)try{if(t.responseFinishedTime=ot.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)r.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var a={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:t.method}};r.trackDependencyDataInternal(a,{error:n.message})}}catch(i){r.diagLog().throwInternal(q.WARNING,Q,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(i)})}},_n.prototype.getFetchCorrelationContext=function(e){try{var t=e.headers.get(We.requestContextHeader);return nt.getCorrelationContext(t)}catch(n){this.diagLog().throwInternal(q.WARNING,Q,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(n)})}},_n.identifier="AjaxDependencyPlugin",_n);function _n(){var e=Cn.call(this)||this;e.identifier=_n.identifier,e.priority=120,e._trackAjaxAttempts=0;var t=f();return e.currentWindowHost=t&&t.location&&t.location.host&&t.location.host.toLowerCase(),e.initialized=!1,e._fetchInitialized=!1,e}e.AjaxPlugin=bn,e.ajaxRecord=xn,Object.defineProperty(e,"__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={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?function(e){var t=Object.create;if(t)return t(e);if(null==e)return{};var n=typeof e;if("object"!=n&&"function"!=n)throw new TypeError("Object prototype may only be an Object:"+e);function r(){}return r.prototype=e,new r}(t):(n.prototype=t.prototype,new n)}var i,n,g,a,l,o,s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=g=g||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(o=l=l||{})[o.AI=0]="AI",o[o.AI_AND_W3C=1]="AI_AND_W3C",o[o.W3C=2]="W3C";var u=2,c="undefined",d="object",f="window",p="location",h="JSON";function m(){return typeof globalThis!==c&&globalThis?globalThis:typeof self!==c&&self?self:typeof window!==c&&window?window:typeof global!==c&&global?global:null}function v(e){var t=m();return t&&t[e]?t[e]:e===f&&x()?window:null}function x(){return Boolean(typeof window===d&&window)}function y(){return x()?window:v(f)}function I(){return function e(){return Boolean(typeof document===d&&document)}()?document:v("document")}function C(){return function e(){return Boolean(typeof navigator===d&&navigator)}()?navigator:v("navigator")}function D(){return typeof location===d&&location?location:v(p)}function S(){return Boolean(typeof JSON===d&&JSON||null!==v(h))}function b(){return S()?JSON||v(h):null}var _=c,T="prototype",N="attachEvent",A="addEventListener",M="detachEvent",w="removeEventListener";function L(e,t){return typeof e===t}function R(e){return e===undefined||L(e,_)}function j(e){return R(e)||null===e}function q(e,t){return e&&Object[T].hasOwnProperty.call(e,t)}function H(e){return L(e,"object")}function E(e){return L(e,"function")}function k(e,t,n,r){void 0===r&&(r=!1);var a=!1;if(!j(e))try{j(e[A])?j(e[N])||(e[N]("on"+t,n),a=!0):(e[A](t,n,r),a=!0)}catch(i){}return a}function U(e,t,n,r){if(void 0===r&&(r=!1),!j(e))try{j(e[w])?j(e[M])||e[M]("on"+t,n):e[w](t,n,r)}catch(a){}}var F=(O.isDate=function(e){return"[object Date]"===Object[T].toString.call(e)},O.isString=function(e){return L(e,"string")},O.isNumber=function(e){return L(e,"number")},O.isBoolean=function(e){return L(e,"boolean")},O.disableCookies=function(){O._canUseCookies=!1},O.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(G,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},O.toISOString=function(e){if(O.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},O.arrForEach=function(e,t,n){for(var r=e.length,a=0;a<r;++a)a in e&&t.call(n||e,e[a],a,e)},O.arrIndexOf=function(e,t,n){for(var r=e.length,a=n||0,i=Math.max(0<=a?a:r-Math.abs(a),0);i<r;i++)if(i in e&&e[i]===t)return i;return-1},O.arrMap=function(e,t,n){for(var r=e.length,a=n||e,i=new Array(r),o=0;o<r;o++)o in e&&(i[o]=t.call(a,e[o],e));return i},O.arrReduce=function(e,t,n){var r,a=e.length,i=0;if(3<=arguments.length)r=n;else{for(;i<a&&!(i in e);)i++;r=e[i++]}for(;i<a;)i in e&&(r=t(r,e[i],i,e)),i++;return r},O.objCreate=function(e){if(null==e)return{};if(!H(e)&&!E(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[T]=e,new t},O.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(E(e)||H(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)q(e,r)&&n.push(r);if(t)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=a.length,o=0;o<i;o++)q(e,a[o])&&n.push(a[o]);return n},O.objDefineAccessors=function(e,t,n,r){var a=Object.defineProperty;if(a)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),a(e,t,i),!0}catch(o){}return!1},O.addEventHandler=function(e,t){var n=!1,r=y();r&&(n=k(r,e,t),n=k(r.body,e,t)||n);var a=I();return a&&(n=X.Attach(a,e,t)||n),n},O.isTypeof=L,O.isUndefined=R,O.isNullOrUndefined=j,O.hasOwnProperty=q,O.isFunction=E,O.isObject=H,O);function O(){}var z,P,G=/[xy]/g,X=(W.Attach=k,W.AttachEvent=k,W.Detach=U,W.DetachEvent=U,W);function W(){}(P=z=z||{})[P.CRITICAL=1]="CRITICAL",P[P.WARNING=2]="WARNING";var B=1,K=2,V=3,Q=4,J=5,$=6,Y=13,Z=14,ee=15,te=16,ne=17,re=18,ae=23,ie=49,oe=52,se=55,ue=56,ce=57,le=61,de=66,fe=68,pe=69,ge=71,he=73,me=(ve.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},ve.dataType="MessageData",ve.AiNonUserActionablePrefix="AI (Internal): ",ve.AiUserActionablePrefix="AI: ",ve);function ve(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ve.AiUserActionablePrefix:ve.AiNonUserActionablePrefix)+e;var a="";S()&&(a=b().stringify(r));var i=(t?" message:"+ve.sanitizeDiagnosticText(t):"")+(r?" props:"+ve.sanitizeDiagnosticText(a):"");this.message+=i}var xe=(ye.prototype.throwInternal=function(e,t,n,r,a){void 0===a&&(a=!1);var i=new me(t,n,a,r),o=this;if(o.enableDebugExceptions())throw i;if(!F.isUndefined(i)&&i&&!F.isUndefined(i.message)){if(a){var s=+i.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=z.WARNING&&(o.warnToConsole(i.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=z.WARNING&&o.warnToConsole(i.message);o.logInternalMessage(e,i)}},ye.prototype.warnToConsole=function(e){!F.isUndefined(console)&&console&&(F.isFunction(console.warn)?console.warn(e):F.isFunction(console.log)&&console.log(e))},ye.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ye.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,a=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[a]?r=!1:n._messageLogged[a]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",o=new me(ae,i,!1);n.queue.push(o),n.warnToConsole(i)}}},ye.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ye);function ye(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},F.isNullOrUndefined(e)||(F.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),F.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),F.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),F.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Ie=F.isFunction,Ce=function qn(a,i){var o=this,s=null,u=Ie(a.processTelemetry),c=Ie(a.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return a},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||i,a&&u){o._hasRun=!0;try{t.setNext(s),c&&a.setNextPlugin(s),s&&(s._hasRun=!1),a.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(z.CRITICAL,he,"Plugin ["+a.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},De=F.isNullOrUndefined;function Se(e,t){var n=[];if(e&&0<e.length)for(var r=null,a=0;a<e.length;a++){var i=e[a];if(i&&F.isFunction(i.processTelemetry)){var o=new Ce(i,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var be=function Hn(e,i,n,t){var o=this,r=null;null!==t&&(e&&F.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],a=!n;if(e)for(;e;){var i=e.getPlugin();!a&&i!==n||(a=!0,r.push(i)),e=e.getNext()}return a||r.push(n),Se(r,t)}(e,o,t||e.getPlugin()):t?r=function u(e,t,n){var r=e,a=!1;return n&&e&&(r=[],F.arrForEach(e,function(e){!a&&e!==n||(a=!0,r.push(e))})),n&&!a&&(r=r||[]).push(n),Se(r,t)}(e,o,t):F.isUndefined(t)&&(r=Se(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new xe(i||{})},o.getCfg=function(){return i},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),i){var r=i.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var a=o.getExtCfg(e,null);return a&&!De(a[t])?r=a[t]:i&&!De(i[t])&&(r=i[t]),De(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Hn(e||r,i,n,t)}},_e=F.isFunction,Te="getPlugin",Ne=(Ae.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},Ae);function Ae(){var i=this,o=!1,s=null,u=null;i.core=null,i.diagLog=function(e){return i._getTelCtx(e).diagLog()},i.isInitialized=function(){return o},i.setInitialized=function(e){o=e},i.setNextPlugin=function(e){u=e},i.processNext=function(e,t){t?t.processNext(e):u&&_e(u.processTelemetry)&&u.processTelemetry(e,null)},i._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new be(null,{},i.core);t=u&&u[Te]?n.createNew(null,u[Te]):n.createNew(null,u)}return t},i._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var a=u;u&&u[Te]&&(a=u[Te]()),i.core=t,s=new be(r,e,t,a),o=!0}}var Me=F.isFunction,we="processTelemetry",Le="priority",Re="setNextPlugin",je="isInitialized";function qe(t,n){for(var e=[],r=null,a=t.getNext();a;){var i=a.getPlugin();i&&(r&&Me(r[Re])&&Me(i[we])&&r[Re](i),Me(i[je])&&i[je]()||e.push(i),r=i,a=a.getNext())}F.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function He(e){return e.sort(function(e,t){var n=0,r=Me(t[we]);return Me(e[we])?n=r?e[Le]-t[Le]:1:r&&(n=-1),n})}var Ee=500,ke="Channel has invalid priority",Ue=F.arrForEach,Fe=F.objDefineAccessors;function Oe(e,t){t&&0<t.length&&(function n(e){Ue(e,function(e){if(e.priority<Ee)throw Error(ke+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var ze,Pe=(t(Ge,ze=Ne),Ge.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&Ue(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},Ge.prototype.getChannelControls=function(){return this._channelQueue},Ge.prototype.initialize=function(t,n,r){if(!this.isInitialized()){ze.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&F.disableCookies();var e=this._channelQueue=function a(e,t){var n=[];if(e&&Ue(e,function(e){return Oe(n,e)}),t){var r=[];Ue(t,function(e){e.priority>Ee&&r.push(e)}),Oe(n,r)}return n}((t||{}).channels,r);Ue(e,function(e){return qe(new be(e,t,n),r)})}},Ge._staticInit=(Fe(Ge.prototype,"ChannelControls",Ge.prototype.getChannelControls),void Fe(Ge.prototype,"channelQueue",Ge.prototype.getChannelControls)),Ge);function Ge(){var e=null!==ze&&ze.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ee,e}var Xe=F.arrForEach,We=F.isNullOrUndefined,Be=(Ke.prototype.initialize=function(e,t,r,n){var a=this;if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||We(e.instrumentationKey))throw Error("Please provide instrumentation key");a.config=e;var i=a._channelController;n=n||F.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),a._notificationManager=n,e.extensions=We(e.extensions)?[]:e.extensions,(e.extensionConfig=We(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||F.objCreate({throwInternal:function(e,t,n,r,a){void 0===a&&(a=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=He(o);var s=[],u={};if(Xe(o,function(e){if(We(e)||We(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(We(u[t])?u[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+u[t]+", "+n)),(!t||t<i.priority)&&s.push(e)}),o.push(i),s.push(i),o=He(o),a._extensions=o,qe(new be([i],e,a),o),qe(new be(s,e,a),o),a._extensions=s,0===a.getTransmissionControls().length)throw new Error("No channels available");a._setInit(!0)},Ke.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ke.prototype.track=function(e){var t=this;e.iKey||(e.iKey=t.config.instrumentationKey),e.time||(e.time=F.toISOString(new Date)),We(e.ver)&&(e.ver="4.0"),t.isInitialized()?(0<t._eventQueue.length&&(Xe(t._eventQueue,function(e){t.getProcessTelContext().processNext(e)}),t._eventQueue=[]),t.getProcessTelContext().processNext(e)):t._eventQueue.push(e)},Ke.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new be(t,this.config,this)},Ke);function Ke(){var t=!1,e=this;e._extensions=new Array,e._channelController=new Pe,e.isInitialized=function(){return t},e._setInit=function(e){t=e},e._eventQueue=[]}var Ve=(Qe.prototype.addNotificationListener=function(e){this.listeners.push(e)},Qe.prototype.removeNotificationListener=function(e){for(var t=F.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=F.arrIndexOf(this.listeners,e)},Qe.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,a=0;a<this.listeners.length;++a)e(a)},Qe.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){a.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},a=this,i=0;i<this.listeners.length;++i)e(i)},Qe);function Qe(){this.listeners=[]}var Je;t($e,Je=Be),$e.prototype.initialize=function(e,t){var n=this;n._notificationManager=new Ve,n.logger=new xe(e),n.config=e,Je.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},$e.prototype.getTransmissionControls=function(){return Je.prototype.getTransmissionControls.call(this)},$e.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Je.prototype.track.call(this,e)},$e.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},$e.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},$e.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];F.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:F.toISOString(new Date),baseType:me.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},$e.prototype._validateTelemetryItem=function(e){if(F.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},$e.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u)};function $e(){return Je.call(this)||this}var Ye=(Ze.requestContextHeader="Request-Context",Ze.requestContextTargetKey="appId",Ze.requestContextAppIdFormat="appId=cid-v1:",Ze.requestIdHeader="Request-Id",Ze.traceParentHeader="traceparent",Ze.sdkContextHeader="Sdk-Context",Ze.sdkContextHeaderAppIdRequest="appId",Ze.requestContextHeaderLowerCase="request-context",Ze);function Ze(){}var et=(tt.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=tt.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;n[o]!==undefined;)i++,o=a.substring(0,tt.MAX_NAME_LENGTH-3)+tt.padNumber(i);a=o}return a},tt.sanitizeKey=function(e,t){var n;return t&&(t=tt.trim(t.toString())).length>tt.MAX_NAME_LENGTH&&(n=t.substring(0,tt.MAX_NAME_LENGTH),e.throwInternal(z.WARNING,ce,"name is too long. It has been truncated to "+tt.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},tt.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=tt.MAX_STRING_LENGTH),t&&(n=n||tt.MAX_STRING_LENGTH,(t=tt.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(z.WARNING,le,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},tt.sanitizeUrl=function(e,t){return tt.sanitizeInput(e,t,tt.MAX_URL_LENGTH,de)},tt.sanitizeMessage=function(e,t){var n;return t&&t.length>tt.MAX_MESSAGE_LENGTH&&(n=t.substring(0,tt.MAX_MESSAGE_LENGTH),e.throwInternal(z.WARNING,ue,"message is too long, it has been truncated to "+tt.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},tt.sanitizeException=function(e,t){var n;return t&&t.length>tt.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,tt.MAX_EXCEPTION_LENGTH),e.throwInternal(z.WARNING,oe,"exception is too long, it has been truncated to "+tt.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},tt.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var a=t[r];if(F.isObject(a)&&S())try{a=b().stringify(a)}catch(i){e.throwInternal(z.WARNING,ie,"custom property is not valid",{exception:i},!0)}a=tt.sanitizeString(e,a,tt.MAX_PROPERTY_LENGTH),n[r=tt.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},tt.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=tt.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},tt.sanitizeId=function(e,t){return t?tt.sanitizeInput(e,t,tt.MAX_ID_LENGTH,pe).toString():t},tt.sanitizeInput=function(e,t,n,r){var a;return t&&(t=tt.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(z.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},tt.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},tt.trim=function(e){return F.isString(e)?e.replace(/^\s+|\s+$/g,""):e},tt.MAX_NAME_LENGTH=150,tt.MAX_ID_LENGTH=128,tt.MAX_PROPERTY_LENGTH=8192,tt.MAX_STRING_LENGTH=1024,tt.MAX_URL_LENGTH=2048,tt.MAX_MESSAGE_LENGTH=32768,tt.MAX_EXCEPTION_LENGTH=32768,tt);function tt(){}var nt="prototype",rt=C(),at=F.isString,it=null;var ot=(st.createDomEvent=function(e){var t=null;if(F.isFunction(Event))t=new Event(e);else{var n=I();n&&n.createEvent&&(t=n.createEvent("Event")).initEvent(e,!0,!0)}return t},st.disableStorage=function(){st._canUseLocalStorage=!1,st._canUseSessionStorage=!1},st._getLocalStorageObject=function(){return st.canUseLocalStorage()?st._getVerifiedStorageObject(i.LocalStorage):null},st._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(F.isNullOrUndefined(m()))return null;n=new Date,(r=e===i.LocalStorage?v("localStorage"):v("sessionStorage")).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(a){r=null}return r},st.isInternalApplicationInsightsEndpoint=function(e){return-1!==st._internalEndpoints.indexOf(e.toLowerCase())},st.canUseLocalStorage=function(){return st._canUseLocalStorage===undefined&&(st._canUseLocalStorage=!!st._getVerifiedStorageObject(i.LocalStorage)),st._canUseLocalStorage},st.getStorage=function(e,t){var n=st._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,B,"Browser failed read of local storage. "+st.getExceptionName(r),{exception:st.dump(r)})}return null},st.setStorage=function(e,t,n){var r=st._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,V,"Browser failed write to local storage. "+st.getExceptionName(a),{exception:st.dump(a)})}return!1},st.removeStorage=function(e,t){var n=st._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,J,"Browser failed removal of local storage item. "+st.getExceptionName(r),{exception:st.dump(r)})}return!1},st._getSessionStorageObject=function(){return st.canUseSessionStorage()?st._getVerifiedStorageObject(i.SessionStorage):null},st.canUseSessionStorage=function(){return st._canUseSessionStorage===undefined&&(st._canUseSessionStorage=!!st._getVerifiedStorageObject(i.SessionStorage)),st._canUseSessionStorage},st.getSessionStorageKeys=function(){var e=[];if(st.canUseSessionStorage())for(var t in v("sessionStorage"))e.push(t);return e},st.getSessionStorage=function(e,t){var n=st._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,K,"Browser failed read of session storage. "+st.getExceptionName(r),{exception:st.dump(r)})}return null},st.setSessionStorage=function(e,t,n){var r=st._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,Q,"Browser failed write to session storage. "+st.getExceptionName(a),{exception:st.dump(a)})}return!1},st.removeSessionStorage=function(e,t){var n=st._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,$,"Browser failed removal of session storage item. "+st.getExceptionName(r),{exception:st.dump(r)})}return!1},st.disableCookies=function(){F.disableCookies()},st.canUseCookies=function(e){if(F._canUseCookies===undefined){F._canUseCookies=!1;try{F._canUseCookies=st.document.cookie!==undefined}catch(t){e.throwInternal(z.WARNING,fe,"Cannot access document.cookie - "+st.getExceptionName(t),{exception:st.dump(t)})}}return F._canUseCookies&&st.document&&st.document.cookie},st.disallowsSameSiteNone=function(e){return!!at(e)&&(-1!==e.indexOf("CPU iPhone OS 12")||-1!==e.indexOf("iPad; CPU OS 12")||-1!==e.indexOf("Macintosh; Intel Mac OS X 10_14")&&-1!==e.indexOf("Version/")&&-1!==e.indexOf("Safari")||!(-1===e.indexOf("Macintosh; Intel Mac OS X 10_14")||!function a(e,t){var n=e.length,r=n-t.length;return e.substring(0<=r?r:0,n)===t}(e,"AppleWebKit/605.1.15 (KHTML, like Gecko)"))||-1!==e.indexOf("Chrome/5")||-1!==e.indexOf("Chrome/6")||-1!==e.indexOf("UnrealEngine")&&-1===e.indexOf("Chrome")||-1!==e.indexOf("UCBrowser/12")||-1!==e.indexOf("UCBrowser/11"))},st.setCookie=function(e,t,n,r){if(st.canUseCookies(e)){var a="",i="";r&&(a=";domain="+r);var o=D();o&&"https:"===o.protocol&&(i=";secure",null===it&&(it=st.disallowsSameSiteNone((C()||{}).userAgent)),it||(n+=";SameSite=None")),st.document.cookie=t+"="+n+a+";path=/"+i}},st.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},st.getCookie=function(e,t){if(st.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=st.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=st.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},st.deleteCookie=function(e,t){st.canUseCookies(e)&&(st.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},st.trim=function(e){return at(e)?e.replace(/^\s+|\s+$/g,""):e},st.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},st.random32=function(){return 4294967296*Math.random()|0},st.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=st.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var a=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)},st.isArray=function(e){return"[object Array]"===Object[nt].toString.call(e)},st.isError=function(e){return"[object Error]"===Object[nt].toString.call(e)},st.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():rt?(rt.userAgent||"").toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},st.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},st.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},st.dump=function(e){var t=Object[nt].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":S()&&(n=b().stringify(e)),t+n},st.getExceptionName=function(e){return"[object Error]"===Object[nt].toString.call(e)?e.name:""},st.addEventHandler=function(e,t){return X.Attach(y(),e,t)},st.IsBeaconApiSupported=function(){return"sendBeacon"in rt&&rt.sendBeacon},st.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},st.document=I()||{},st._canUseLocalStorage=undefined,st._canUseSessionStorage=undefined,st._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],st.NotSpecified="not_specified",st.isDate=F.isDate,st.toISOStringForIE8=F.toISOString,st);function st(){}var ut=(ct.parseUrl=function(e){return ct.htmlAnchorElement||(ct.htmlAnchorElement=ct.document.createElement?ct.document.createElement("a"):{host:ct.parseHost(e)}),ct.htmlAnchorElement.href=e,ct.htmlAnchorElement},ct.getAbsoluteUrl=function(e){var t,n=ct.parseUrl(e);return n&&(t=n.href),t},ct.getPathName=function(e){var t,n=ct.parseUrl(e);return n&&(t=n.pathname),t},ct.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ct.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&at(t[2])&&0<t[2].length)return t[2]}return null},ct.document=I()||{},ct);function ct(){}var lt=(dt.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=ut.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(F.arrForEach(i,function(e){var t=new RegExp(e.toLowerCase().replace(/\./g,".").replace(/\*/g,".*"));a=a||t.test(r)}),!a))return!1;var o=e&&e.correlationHeaderExcludedDomains;if(!o||0===o.length)return!0;for(var s=0;s<o.length;s++)if(new RegExp(o[s].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return r&&0<r.length},dt.getCorrelationContext=function(e){if(e){var t=dt.getCorrelationContextValue(e,Ye.requestContextTargetKey);if(t&&t!==dt.correlationIdPrefix)return t}},dt.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2===a.length&&a[0]===t)return a[1]}},dt.correlationIdPrefix="cid-v1:",dt);function dt(){}var ft=(pt.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=ut.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var u=0===s.pathname.length?"/":s.pathname;"/"!==u.charAt(0)&&(u="/"+u),o=s.pathname,i=et.sanitizeString(e,n?n+" "+u:u)}else i=et.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},pt);function pt(){}var gt=(ht.Now=function(){var e=function t(){return v("performance")}();return e&&e.now&&e.timing?e.now()+e.timing.navigationStart:(new Date).getTime()},ht.GetDuration=function(e,t){var n=null;return 0===e||0===t||F.isNullOrUndefined(e)||F.isNullOrUndefined(t)||(n=t-e),n},ht);function ht(){}var mt,vt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",xt=(t(yt,mt=function En(){}),yt);function yt(){return mt.call(this)||this}var It;t(Ct,It=function kn(){this.ver=1,this.sampleRate=100,this.tags={}});function Ct(e,t,n){var r=It.call(this)||this;return r.name=et.sanitizeString(e,n)||ot.NotSpecified,r.data=t,r.time=F.toISOString(new Date),r.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100===r.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},r}var Dt,St=function Un(){},bt=(t(_t,Dt=St),_t);function _t(){var e=Dt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Tt;t(Nt,Tt=bt),Nt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Nt.dataType="EventData";function Nt(e,t,n,r){var a=Tt.call(this)||this;return a.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},a.name=et.sanitizeString(e,t)||ot.NotSpecified,a.properties=et.sanitizeProperties(e,n),a.measurements=et.sanitizeMeasurements(e,r),a}var At,Mt=function Fn(){},wt=(t(Lt,At=St),Lt);function Lt(){var e=At.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var Rt,jt=function On(){this.hasFullStack=!0,this.parsedStack=[]};t(qt,Rt=wt),qt.CreateFromInterface=function(t,e){var n=e.exceptions&&F.arrMap(e.exceptions,function(e){return Et.CreateFromInterface(t,e)});return new qt(t,s({},e,{exceptions:n}))},qt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&F.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:a,properties:n,measurements:r,problemGroup:i,id:o,isManual:s}},qt.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},qt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",qt.dataType="ExceptionData";function qt(e,t,n,r,a,i){var o=Rt.call(this)||this;return o.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},t instanceof Error?(o.exceptions=[new Et(e,t)],o.properties=et.sanitizeProperties(e,n),o.measurements=et.sanitizeMeasurements(e,r),a&&(o.severityLevel=a),i&&(o.id=i)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,F.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Ht,Et=(t(kt,Ht=jt),kt.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&F.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},kt.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&F.arrMap(t.parsedStack,function(e){return Ft.CreateFromInterface(e)})||t.parsedStack;return new kt(e,s({},t,{parsedStack:n}))},kt.parseStack=function(e){var t;if(F.isString(e)){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(Ft.regex.test(o)){var s=new Ft(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var u=0,c=t.length-1,l=0,d=u,f=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=u,f=c,u++,c--}}return t},kt);function kt(e,t){var n=Ht.call(this)||this;if(n.aiDataContract={id:g.Default,outerId:g.Default,typeName:g.Required,message:g.Required,hasFullStack:g.Default,stack:g.Default,parsedStack:g.Array},t instanceof Error){n.typeName=et.sanitizeString(e,t.name)||ot.NotSpecified,n.message=et.sanitizeMessage(e,t.message)||ot.NotSpecified;var r=t.stack;n.parsedStack=kt.parseStack(r),n.stack=et.sanitizeException(e,r),n.hasFullStack=ot.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var Ut,Ft=(t(Ot,Ut=Mt),Ot.CreateFromInterface=function(e){return new Ot(e,null)},Ot.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Ot.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Ot.baseSize=58,Ot);function Ot(e,t){var n=Ut.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:g.Required,method:g.Required,assembly:g.Default,fileName:g.Default,line:g.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=ot.trim(r),n.fileName="",n.line=0;var a=r.match(Ot.regex);a&&5<=a.length&&(n.method=ot.trim(a[2])||n.method,n.fileName=ot.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Ot.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var zt,Pt,Gt,Xt=(t(Wt,zt=St),Wt);function Wt(){var e=zt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(Gt=Pt=Pt||{})[Gt.Measurement=0]="Measurement",Gt[Gt.Aggregation=1]="Aggregation";var Bt,Kt=(t(Vt,Bt=function zn(){this.kind=Pt.Measurement}),Vt);function Vt(){var e=null!==Bt&&Bt.apply(this,arguments)||this;return e.aiDataContract={name:g.Required,kind:g.Default,value:g.Required,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default},e}var Qt;t(Jt,Qt=Xt),Jt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Jt.dataType="MetricData";function Jt(e,t,n,r,a,i,o,s){var u=Qt.call(this)||this;u.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new Kt;return c.count=0<r?r:undefined,c.max=isNaN(i)||null===i?undefined:i,c.min=isNaN(a)||null===a?undefined:a,c.name=et.sanitizeString(e,t)||ot.NotSpecified,c.value=n,u.metrics=[c],u.properties=et.sanitizeProperties(e,o),u.measurements=et.sanitizeMeasurements(e,s),u}var $t,Yt=(t(Zt,$t=bt),Zt);function Zt(){var e=$t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var en;t(tn,en=Yt),tn.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",tn.dataType="PageviewData";function tn(e,t,n,r,a,i,o){var s=en.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,properties:g.Default,measurements:g.Default,id:g.Default},s.id=et.sanitizeId(e,o),s.url=et.sanitizeUrl(e,n),s.name=et.sanitizeString(e,t)||ot.NotSpecified,isNaN(r)||(s.duration=ot.msToTimeSpan(r)),s.properties=et.sanitizeProperties(e,a),s.measurements=et.sanitizeMeasurements(e,i),s}var nn,rn=(t(an,nn=St),an);function an(){var e=nn.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var on,sn=(t(un,on=rn),un.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",un.dataType="RemoteDependencyData",un);function un(e,t,n,r,a,i,o,s,u,c,l,d){void 0===u&&(u="Ajax");var f=on.call(this)||this;f.aiDataContract={id:g.Required,ver:g.Required,name:g.Default,resultCode:g.Default,duration:g.Default,success:g.Default,data:g.Default,target:g.Default,type:g.Default,properties:g.Default,measurements:g.Default,kind:g.Default,value:g.Default,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default,dependencyKind:g.Default,dependencySource:g.Default,commandName:g.Default,dependencyTypeName:g.Default},f.id=t,f.duration=ot.msToTimeSpan(a),f.success=i,f.resultCode=o+"",f.type=et.sanitizeString(e,u);var p=ft.ParseDependencyPath(e,n,s,r);return f.data=et.sanitizeUrl(e,r)||p.data,f.target=et.sanitizeString(e,p.target),c&&(f.target=f.target+" | "+c),f.name=et.sanitizeString(e,p.name),f.properties=et.sanitizeProperties(e,l),f.measurements=et.sanitizeMeasurements(e,d),f}var cn,ln=(t(dn,cn=St),dn);function dn(){var e=cn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var fn;t(pn,fn=ln),pn.envelopeType="Microsoft.ApplicationInsights.{0}.Message",pn.dataType="MessageData";function pn(e,t,n,r,a){var i=fn.call(this)||this;return i.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||ot.NotSpecified,i.message=et.sanitizeMessage(e,t),i.properties=et.sanitizeProperties(e,r),i.measurements=et.sanitizeMeasurements(e,a),n&&(i.severityLevel=n),i}var gn,hn=(t(mn,gn=Yt),mn);function mn(){var e=gn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var vn;t(xn,vn=hn),xn.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",xn.dataType="PageviewPerformanceData";function xn(e,t,n,r,a,i,o){var s=vn.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,perfTotal:g.Default,networkConnect:g.Default,sentRequest:g.Default,receivedResponse:g.Default,domProcessing:g.Default,properties:g.Default,measurements:g.Default},s.url=et.sanitizeUrl(e,n),s.name=et.sanitizeString(e,t)||ot.NotSpecified,s.properties=et.sanitizeProperties(e,a),s.measurements=et.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var yn,In,Cn;t(Dn,yn=xt);function Dn(e,t){var n=yn.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}(Cn=In=In||{})[Cn.Verbose=0]="Verbose",Cn[Cn.Information=1]="Information",Cn[Cn.Warning=2]="Warning",Cn[Cn.Error=3]="Error",Cn[Cn.Critical=4]="Critical";var Sn=(bn.create=function(e,t,n,r,a,i){if(n=et.sanitizeString(r,n)||ot.NotSpecified,F.isNullOrUndefined(e)||F.isNullOrUndefined(t)||F.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:F.toISOString(new Date),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!F.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},bn);function bn(){}var _n=function Pn(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},Tn=(Nn.prototype.getAbsoluteUrl=function(){return this.requestUrl?ut.getAbsoluteUrl(this.requestUrl):null},Nn.prototype.getPathName=function(){return this.requestUrl?et.sanitizeUrl(this._logger,ut.getCompleteUrl(this.method,this.requestUrl)):null},Nn);function Nn(e,t,n){this.completed=!1,this.requestHeadersSize=null,this.requestHeaders=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new _n,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*gt.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var An=(Mn.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},Mn.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},Mn.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},Mn.DEFAULT_TRACE_FLAG="01",Mn.DEFAULT_VERSION="00",Mn);function Mn(e,t){this.traceFlag=Mn.DEFAULT_TRACE_FLAG,this.version=Mn.DEFAULT_VERSION,e&&Mn.isValidTraceId(e)?this.traceId=e:this.traceId=ot.generateW3CId(),t&&Mn.isValidSpanId(t)?this.spanId=t:this.spanId=ot.generateW3CId().substr(0,16)}var wn,Ln=F.isNullOrUndefined,Rn=(t(jn,wn=Ne),jn.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:l.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1}},jn.getEmptyConfig=function(){return{maxAjaxCallsPerView:undefined,disableAjaxTracking:undefined,disableFetchTracking:undefined,disableCorrelationHeaders:undefined,distributedTracingMode:undefined,correlationHeaderExcludedDomains:undefined,appId:undefined,enableCorsCorrelation:undefined,correlationHeaderDomains:undefined,enableRequestHeaderTracking:undefined,enableResponseHeaderTracking:undefined,enableAjaxErrorStatusText:undefined}},jn.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{Ln(e)||Ln(e.ajaxData)||Ln(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(n){}return t},jn.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},jn.prototype.processTelemetry=function(e,t){this.processNext(e,t)},jn.prototype.includeCorrelationHeaders=function(e,t,n,r){var a=this;if(t){if(lt.canIncludeCorrelationHeader(a._config,e.getAbsoluteUrl(),a.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),a._isUsingAIHeaders){var i="|"+e.traceID+"."+e.spanID;n.headers.set(Ye.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.requestIdHeader]=i)}if((s=a._config.appId||a._context&&a._context.appId())&&(n.headers.set(Ye.requestContextHeader,Ye.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.requestContextHeader]=Ye.requestContextAppIdFormat+s)),a._isUsingW3CHeaders){var o=new An(e.traceID,e.spanID);n.headers.set(Ye.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.traceParentHeader]=o.toString())}return n}return n}if(r){var s;if(lt.canIncludeCorrelationHeader(a._config,r.ajaxData.getAbsoluteUrl(),a.currentWindowHost))a._isUsingAIHeaders&&(i="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(Ye.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.requestIdHeader]=i)),(s=a._config.appId||a._context&&a._context.appId())&&(r.setRequestHeader(Ye.requestContextHeader,Ye.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.requestContextHeader]=Ye.requestContextAppIdFormat+s)),a._isUsingW3CHeaders&&(o=new An(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(Ye.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.traceParentHeader]=o.toString()));return r}return undefined},jn.prototype.initialize=function(e,t,n,r){var a=this;wn.prototype.initialize.call(this,e,t,n,r);var i=a._getTelCtx();if(!a.initialized&&!a._fetchInitialized){var o=jn.getDefaultConfig();for(var s in o)a._config[s]=i.getConfig(jn.identifier,s,o[s]);if(a._isUsingAIHeaders=a._config.distributedTracingMode===l.AI||a._config.distributedTracingMode===l.AI_AND_W3C,a._isUsingW3CHeaders=a._config.distributedTracingMode===l.AI_AND_W3C||a._config.distributedTracingMode===l.W3C,!1===a._config.disableAjaxTracking&&a.instrumentXhr(),!1===a._config.disableFetchTracking&&a.instrumentFetch(),0<n.length&&n){for(var u=void 0,c=0;!u&&c<n.length;)n[c]&&"AppInsightsPropertiesPlugin"===n[c].identifier&&(u=n[c]),c++;u&&(a._context=u.context)}}},jn.prototype.trackDependencyDataInternal=function(e,t,n){var r=this;if(-1===r._config.maxAjaxCallsPerView||r._trackAjaxAttempts<r._config.maxAjaxCallsPerView){var a=Sn.create(e,sn.dataType,sn.envelopeType,r.diagLog(),t,n);r.core.track(a)}else r._trackAjaxAttempts===r._config.maxAjaxCallsPerView&&r.diagLog().throwInternal(z.CRITICAL,se,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++r._trackAjaxAttempts},jn.prototype.instrumentFetch=function(){var a=this;if(a.supportsFetch()&&!a._fetchInitialized){var e=m(),i=e.fetch,o=a;e.fetch=function(t,e){var n;if(o.isFetchInstrumented(t)&&o.isMonitoredInstance(undefined,undefined,t,e))try{n=o.createFetchRecord(t,e),e=o.includeCorrelationHeaders(n,t,e)}catch(r){o.diagLog().throwInternal(z.CRITICAL,ee,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedFetchDiagnosticsMessage(t),exception:ot.dump(r)})}return i(t,e).then(function(e){return o.onFetchComplete(e,n),e})["catch"](function(e){throw o.onFetchFailed(t,n,e),e})},a._fetchInitialized=!0}},jn.prototype.instrumentXhr=function(){var e=this;e.supportsAjaxMonitoring()&&!e.initialized&&(e.instrumentOpen(),e.instrumentSend(),e.instrumentAbort(),e.instrumentSetRequestHeader(),e.initialized=!0)},jn.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[vt]||!!r&&!0===r[vt]):void 0!==e&&(o=this.initialized,a=!0===e[vt],i=!0===t||!Ln(e.ajaxData)),o&&i&&!a},jn.prototype.supportsAjaxMonitoring=function(){var e=!0;return("undefined"==typeof XMLHttpRequest||Ln(XMLHttpRequest)||Ln(XMLHttpRequest.prototype)||Ln(XMLHttpRequest.prototype.open)||Ln(XMLHttpRequest.prototype.send)||Ln(XMLHttpRequest.prototype.abort))&&(e=!1),e},jn.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,o=this;XMLHttpRequest.prototype.open=function(e,t,n){var r=this;try{!o.isMonitoredInstance(r,!0)||r.ajaxData&&r.ajaxData.xhrMonitoringState.openDone||o.openHandler(r,e,t,n)}catch(a){o.diagLog().throwInternal(z.CRITICAL,ee,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(r),exception:ot.dump(a)})}return i.apply(r,arguments)}},jn.prototype.openHandler=function(e,t,n,r){var a=this,i=a._context&&a._context.telemetryTrace&&a._context.telemetryTrace.traceID||ot.generateW3CId(),o=ot.generateW3CId().substr(0,16),s=new Tn(i,o,a.diagLog());s.method=t,s.requestUrl=n,s.xhrMonitoringState.openDone=!0,s.requestHeaders={},e.ajaxData=s,a.attachToOnReadyStateChange(e)},jn.prototype.instrumentSend=function(){var r=XMLHttpRequest.prototype.send,a=this;XMLHttpRequest.prototype.send=function(e){var t=this;try{a.isMonitoredInstance(t)&&!t.ajaxData.xhrMonitoringState.sendDone&&a.sendHandler(t,e)}catch(n){a.diagLog().throwInternal(z.CRITICAL,ne,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(t),exception:ot.dump(n)})}return r.apply(t,arguments)}},jn.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=gt.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,undefined,undefined,e)).ajaxData.xhrMonitoringState.sendDone=!0},jn.prototype.instrumentAbort=function(){var n=XMLHttpRequest.prototype.abort,r=this;XMLHttpRequest.prototype.abort=function(){var e=this;try{r.isMonitoredInstance(e)&&!e.ajaxData.xhrMonitoringState.abortDone&&(e.ajaxData.aborted=1,e.ajaxData.xhrMonitoringState.abortDone=!0)}catch(t){r.diagLog().throwInternal(z.CRITICAL,Y,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),exception:ot.dump(t)})}return n.apply(e,arguments)}},jn.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var r=XMLHttpRequest.prototype.setRequestHeader,a=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{a.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(n){a.diagLog().throwInternal(z.CRITICAL,ge,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(this),exception:ot.dump(n)})}return r.apply(this,arguments)}}},jn.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=X.Attach(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(t){var e=ot.dump(t);e&&-1!==e.toLowerCase().indexOf("c00c023f")||r.diagLog().throwInternal(z.CRITICAL,te,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(n),exception:ot.dump(t)})}})},jn.prototype.onAjaxComplete=function(e){var t=this;if(e.ajaxData.responseFinishedTime=gt.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)t.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var n={id:"|"+e.ajaxData.traceID+"."+e.ajaxData.spanID,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},r=t.getAjaxCorrelationContext(e);if(r&&(n.correlationContext=r),t._config.enableRequestHeaderTracking&&0<F.objKeys(e.ajaxData.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders={},n.properties.requestHeaders=e.ajaxData.requestHeaders),t._config.enableResponseHeaderTracking){var a=e.getAllResponseHeaders();if(a){var i=a.trim().split(/[\r\n]+/),o={};F.arrForEach(i,function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");o[n]=r}),0<F.objKeys(o).length&&(n.properties=n.properties||{},n.properties.responseHeaders={},n.properties.responseHeaders=o)}}t._config.enableAjaxErrorStatusText&&400<=e.status&&(n.properties=n.properties||{},n.properties.responseText=e.statusText+" - "+e.responseText),t.trackDependencyDataInternal(n),e.ajaxData=null}},jn.prototype.getAjaxCorrelationContext=function(e){try{var t=e.getAllResponseHeaders();if(null!==t&&-1!==t.toLowerCase().indexOf(Ye.requestContextHeaderLowerCase)){var n=e.getResponseHeader(Ye.requestContextHeader);return lt.getCorrelationContext(n)}}catch(r){this.diagLog().throwInternal(z.WARNING,re,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),exception:ot.dump(r)})}},jn.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[vt]},jn.prototype.supportsFetch=function(){var e=!0,t=m();return(!t||Ln(t.Request)||Ln(t.Request.prototype)||Ln(t.fetch))&&(e=!1),e},jn.prototype.createFetchRecord=function(e,t){var n=this,r=n._context&&n._context.telemetryTrace&&n._context.telemetryTrace.traceID||ot.generateW3CId(),a=ot.generateW3CId().substr(0,16),i=new Tn(r,a,n.diagLog());return i.requestSentTime=gt.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",t&&t.headers&&n._config.enableRequestHeaderTracking?i.requestHeaders=t.headers:i.requestHeaders={},i},jn.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{Ln(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(n){this.diagLog().throwInternal(z.CRITICAL,ee,"Failed to grab failed fetch diagnostics message",{exception:ot.dump(n)})}return t},jn.prototype.onFetchComplete=function(e,t){var n=this;if(t)try{if(t.responseFinishedTime=gt.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)n.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var r={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:200<=e.status&&e.status<400,responseCode:e.status,properties:{HttpMethod:t.method}},a=n.getFetchCorrelationContext(e);if(a&&(r.correlationContext=a),n._config.enableRequestHeaderTracking&&0<F.objKeys(t.requestHeaders).length&&(r.properties=r.properties||{},r.properties.requestHeaders=t.requestHeaders),n._config.enableResponseHeaderTracking){var i={};e.headers.forEach(function(e,t){i[t]=e}),0<F.objKeys(i).length&&(r.properties=r.properties||{},r.properties.responseHeaders=i)}n.trackDependencyDataInternal(r)}}catch(o){n.diagLog().throwInternal(z.WARNING,re,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(o)})}},jn.prototype.onFetchFailed=function(e,t,n){var r=this;if(t)try{if(t.responseFinishedTime=gt.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)r.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var a={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:t.method}};r.trackDependencyDataInternal(a,{error:n.message})}}catch(i){r.diagLog().throwInternal(z.WARNING,re,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(i)})}},jn.prototype.getFetchCorrelationContext=function(e){try{var t=e.headers.get(Ye.requestContextHeader);return lt.getCorrelationContext(t)}catch(n){this.diagLog().throwInternal(z.WARNING,re,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(n)})}},jn.identifier="AjaxDependencyPlugin",jn);function jn(){var e=wn.call(this)||this;e.identifier=jn.identifier,e.priority=120,e._config=jn.getEmptyConfig(),e._trackAjaxAttempts=0;var t=D();return e.currentWindowHost=t&&t.host&&t.host.toLowerCase(),e.initialized=!1,e._fetchInitialized=!1,e}e.AjaxPlugin=Rn,e.ajaxRecord=Tn,function(e,t,n){var r=Object.defineProperty;if(r)try{return r(e,t,n)}catch(a){}typeof n.value!==undefined&&(e[t]=n.value)}(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map

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

import { RequestHeaders, Util, CorrelationIdHelper, TelemetryItemCreator, RemoteDependencyData, DateTimeUtils, DisabledPropertyName, PropertiesPluginIdentifier, DistributedTracingModes } from '@microsoft/applicationinsights-common';
import { CoreUtils, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getWindow } from '@microsoft/applicationinsights-core-js';
import { CoreUtils, LoggingSeverity, _InternalMessageId, BaseTelemetryPlugin, getLocation, getGlobal } from '@microsoft/applicationinsights-core-js';
import { ajaxRecord } from './ajaxRecord';

@@ -17,5 +17,6 @@ import { EventHelper } from './ajaxUtils';

_this.priority = 120;
_this._config = AjaxMonitor.getEmptyConfig();
_this._trackAjaxAttempts = 0;
var _window = getWindow();
_this.currentWindowHost = _window && _window.location && _window.location.host && _window.location.host.toLowerCase();
var location = getLocation();
_this.currentWindowHost = location && location.host && location.host.toLowerCase();
_this.initialized = false;

@@ -42,3 +43,4 @@ _this._fetchInitialized = false;

enableRequestHeaderTracking: false,
enableResponseHeaderTracking: false
enableResponseHeaderTracking: false,
enableAjaxErrorStatusText: false
};

@@ -59,3 +61,4 @@ return config;

enableRequestHeaderTracking: undefined,
enableResponseHeaderTracking: undefined
enableResponseHeaderTracking: undefined,
enableAjaxErrorStatusText: undefined
};

@@ -99,3 +102,3 @@ };

}
var appId = _self._config.appId || _self._context.appId();
var appId = _self._config.appId || (_self._context && _self._context.appId());
if (appId) {

@@ -119,3 +122,3 @@ init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);

else if (xhr) {
if (_self.currentWindowHost && CorrelationIdHelper.canIncludeCorrelationHeader(_self._config, xhr.ajaxData.getAbsoluteUrl(), _self.currentWindowHost)) {
if (CorrelationIdHelper.canIncludeCorrelationHeader(_self._config, xhr.ajaxData.getAbsoluteUrl(), _self.currentWindowHost)) {
if (_self._isUsingAIHeaders) {

@@ -128,3 +131,3 @@ var id = "|" + xhr.ajaxData.traceID + "." + xhr.ajaxData.spanID;

}
var appId = _self._config.appId || _self._context.appId();
var appId = _self._config.appId || (_self._context && _self._context.appId());
if (appId) {

@@ -154,3 +157,2 @@ xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);

var defaultConfig = AjaxMonitor.getDefaultConfig();
_self._config = AjaxMonitor.getEmptyConfig();
for (var field in defaultConfig) {

@@ -202,6 +204,7 @@ _self._config[field] = ctx.getConfig(AjaxMonitor.identifier, field, defaultConfig[field]);

}
var _window = getWindow();
var originalFetch = _window.fetch;
// Getting the global instance tp support web workers (which don't have window)
var global = getGlobal();
var originalFetch = global.fetch;
var fetchMonitorInstance = _self;
_window.fetch = function fetch(input, init) {
global.fetch = function fetch(input, init) {
var fetchData;

@@ -463,2 +466,6 @@ if (fetchMonitorInstance.isFetchInstrumented(input) && fetchMonitorInstance.isMonitoredInstance(undefined, undefined, input, init)) {

}
if (_self._config.enableAjaxErrorStatusText && xhr.status >= 400) {
dependency.properties = dependency.properties || {};
dependency.properties.responseText = xhr.statusText + " - " + xhr.responseText;
}
_self.trackDependencyDataInternal(dependency);

@@ -491,6 +498,6 @@ xhr.ajaxData = null;

var result = true;
var _window = getWindow();
if (!_window || _isNullOrUndefined(_window.Request) ||
_isNullOrUndefined(_window.Request.prototype) ||
_isNullOrUndefined(_window.fetch)) {
var _global = getGlobal();
if (!_global || _isNullOrUndefined(_global.Request) ||
_isNullOrUndefined(_global.Request.prototype) ||
_isNullOrUndefined(_global.fetch)) {
result = false;

@@ -497,0 +504,0 @@ }

/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.4.0-beta
* Application Insights JavaScript SDK - Dependencies Plugin, 2.4.0
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!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={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,p,a,l,o,s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=p=p||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(o=l=l||{})[o.AI=0]="AI",o[o.AI_AND_W3C=1]="AI_AND_W3C",o[o.W3C=2]="W3C";var c=2,u="object";function d(){return Boolean(typeof window===u&&window)}function f(){return d()?window:null}function g(){return function e(){return Boolean(typeof document===u&&document)}()?document:d()&&f().document||null}function h(){return Boolean(typeof JSON===u&&JSON)}function m(){return h()?JSON:null}var v="undefined",x="prototype",y="attachEvent",I="addEventListener",D="detachEvent",C="removeEventListener";function S(e,t){return typeof e===t}function b(e){return e===undefined||S(e,v)}function _(e){return b(e)||null===e}function T(e,t){return e&&Object[x].hasOwnProperty.call(e,t)}function N(e){return S(e,"object")}function A(e){return S(e,"function")}function M(e,t,n,r){void 0===r&&(r=!1);var a=!1;if(!_(e))try{_(e[I])?_(e[y])||(e[y]("on"+t,n),a=!0):(e[I](t,n,r),a=!0)}catch(i){}return a}function w(e,t,n,r){if(void 0===r&&(r=!1),!_(e))try{_(e[C])?_(e[D])||e[D]("on"+t,n):e[C](t,n,r)}catch(a){}}var L=(R.isDate=function(e){return"[object Date]"===Object[x].toString.call(e)},R.isString=function(e){return S(e,"string")},R.isNumber=function(e){return S(e,"number")},R.isBoolean=function(e){return S(e,"boolean")},R.disableCookies=function(){R._canUseCookies=!1},R.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(j,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},R.toISOString=function(e){if(R.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},R.arrForEach=function(e,t,n){for(var r=e.length,a=0;a<r;++a)a in e&&t.call(n||e,e[a],a,e)},R.arrIndexOf=function(e,t,n){for(var r=e.length,a=n||0,i=Math.max(0<=a?a:r-Math.abs(a),0);i<r;i++)if(i in e&&e[i]===t)return i;return-1},R.arrMap=function(e,t,n){for(var r=e.length,a=n||e,i=new Array(r),o=0;o<r;o++)o in e&&(i[o]=t.call(a,e[o],e));return i},R.arrReduce=function(e,t,n){var r,a=e.length,i=0;if(3<=arguments.length)r=n;else{for(;i<a&&!(i in e);)i++;r=e[i++]}for(;i<a;)i in e&&(r=t(r,e[i],i,e)),i++;return r},R.objCreate=function(e){if(null==e)return{};if(!N(e)&&!A(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[x]=e,new t},R.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(A(e)||N(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)T(e,r)&&n.push(r);if(t)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=a.length,o=0;o<i;o++)T(e,a[o])&&n.push(a[o]);return n},R.objDefineAccessors=function(e,t,n,r){var a=Object.defineProperty;if(a)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),a(e,t,i),!0}catch(o){}return!1},R.addEventHandler=function(e,t){var n=!1,r=f();r&&(n=M(r,e,t),n=M(r.body,e,t)||n);var a=g();return a&&(n=E.Attach(a,e,t)||n),n},R.isTypeof=S,R.isUndefined=b,R.isNullOrUndefined=_,R.hasOwnProperty=T,R.isFunction=A,R.isObject=N,R);function R(){}var q,H,j=/[xy]/g,E=(F.Attach=M,F.AttachEvent=M,F.Detach=w,F.DetachEvent=w,F);function F(){}(H=q=q||{})[H.CRITICAL=1]="CRITICAL",H[H.WARNING=2]="WARNING";var k=1,U=2,z=3,O=4,P=5,G=6,W=13,X=14,B=15,V=16,K=17,Q=18,J=23,$=49,Y=52,Z=55,ee=56,te=57,ne=61,re=66,ae=68,ie=69,oe=71,se=73,ce=(ue.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},ue.dataType="MessageData",ue.AiNonUserActionablePrefix="AI (Internal): ",ue.AiUserActionablePrefix="AI: ",ue);function ue(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ue.AiUserActionablePrefix:ue.AiNonUserActionablePrefix)+e;var a="";h()&&(a=m().stringify(r));var i=(t?" message:"+ue.sanitizeDiagnosticText(t):"")+(r?" props:"+ue.sanitizeDiagnosticText(a):"");this.message+=i}var le=(de.prototype.throwInternal=function(e,t,n,r,a){void 0===a&&(a=!1);var i=new ce(t,n,a,r),o=this;if(o.enableDebugExceptions())throw i;if(!L.isUndefined(i)&&i&&!L.isUndefined(i.message)){if(a){var s=+i.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=q.WARNING&&(o.warnToConsole(i.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=q.WARNING&&o.warnToConsole(i.message);o.logInternalMessage(e,i)}},de.prototype.warnToConsole=function(e){!L.isUndefined(console)&&console&&(L.isFunction(console.warn)?console.warn(e):L.isFunction(console.log)&&console.log(e))},de.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},de.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,a=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[a]?r=!1:n._messageLogged[a]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",o=new ce(J,i,!1);n.queue.push(o),n.warnToConsole(i)}}},de.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},de);function de(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},L.isNullOrUndefined(e)||(L.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),L.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),L.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),L.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var fe=L.isFunction,ge=function Tn(a,i){var o=this,s=null,c=fe(a.processTelemetry),u=fe(a.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return a},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||i,a&&c){o._hasRun=!0;try{t.setNext(s),u&&a.setNextPlugin(s),s&&(s._hasRun=!1),a.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(q.CRITICAL,se,"Plugin ["+a.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},pe=L.isNullOrUndefined;function he(e,t){var n=[];if(e&&0<e.length)for(var r=null,a=0;a<e.length;a++){var i=e[a];if(i&&L.isFunction(i.processTelemetry)){var o=new ge(i,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var me=function Nn(e,i,n,t){var o=this,r=null;null!==t&&(e&&L.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],a=!n;if(e)for(;e;){var i=e.getPlugin();!a&&i!==n||(a=!0,r.push(i)),e=e.getNext()}return a||r.push(n),he(r,t)}(e,o,t||e.getPlugin()):t?r=function c(e,t,n){var r=e,a=!1;return n&&e&&(r=[],L.arrForEach(e,function(e){!a&&e!==n||(a=!0,r.push(e))})),n&&!a&&(r=r||[]).push(n),he(r,t)}(e,o,t):L.isUndefined(t)&&(r=he(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new le(i||{})},o.getCfg=function(){return i},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),i){var r=i.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var a=o.getExtCfg(e,null);return a&&!pe(a[t])?r=a[t]:i&&!pe(i[t])&&(r=i[t]),pe(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Nn(e||r,i,n,t)}},ve=L.isFunction,xe="getPlugin",ye=(Ie.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},Ie);function Ie(){var i=this,o=!1,s=null,c=null;i.core=null,i.diagLog=function(e){return i._getTelCtx(e).diagLog()},i.isInitialized=function(){return o},i.setInitialized=function(e){o=e},i.setNextPlugin=function(e){c=e},i.processNext=function(e,t){t?t.processNext(e):c&&ve(c.processTelemetry)&&c.processTelemetry(e,null)},i._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new me(null,{},i.core);t=c&&c[xe]?n.createNew(null,c[xe]):n.createNew(null,c)}return t},i._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var a=c;c&&c[xe]&&(a=c[xe]()),i.core=t,s=new me(r,e,t,a),o=!0}}var De=L.isFunction,Ce="processTelemetry",Se="priority",be="setNextPlugin",_e="isInitialized";function Te(t,n){for(var e=[],r=null,a=t.getNext();a;){var i=a.getPlugin();i&&(r&&De(r[be])&&De(i[Ce])&&r[be](i),De(i[_e])&&i[_e]()||e.push(i),r=i,a=a.getNext())}L.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function Ne(e){return e.sort(function(e,t){var n=0,r=De(t[Ce]);return De(e[Ce])?n=r?e[Se]-t[Se]:1:r&&(n=-1),n})}var Ae=500,Me="Channel has invalid priority",we=L.arrForEach,Le=L.objDefineAccessors;function Re(e,t){t&&0<t.length&&(function n(e){we(e,function(e){if(e.priority<Ae)throw Error(Me+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var qe,He=(t(je,qe=ye),je.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&we(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},je.prototype.getChannelControls=function(){return this._channelQueue},je.prototype.initialize=function(t,n,r){if(!this.isInitialized()){qe.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&L.disableCookies();var e=this._channelQueue=function a(e,t){var n=[];if(e&&we(e,function(e){return Re(n,e)}),t){var r=[];we(t,function(e){e.priority>Ae&&r.push(e)}),Re(n,r)}return n}((t||{}).channels,r);we(e,function(e){return Te(new me(e,t,n),r)})}},je._staticInit=(Le(je.prototype,"ChannelControls",je.prototype.getChannelControls),void Le(je.prototype,"channelQueue",je.prototype.getChannelControls)),je);function je(){var e=null!==qe&&qe.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ae,e}var Ee=L.arrForEach,Fe=L.isNullOrUndefined,ke=(Ue.prototype.initialize=function(e,t,r,n){var a=this;if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||Fe(e.instrumentationKey))throw Error("Please provide instrumentation key");a.config=e;var i=a._channelController;n=n||L.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),a._notificationManager=n,e.extensions=Fe(e.extensions)?[]:e.extensions,(e.extensionConfig=Fe(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||L.objCreate({throwInternal:function(e,t,n,r,a){void 0===a&&(a=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=Ne(o);var s=[],c={};if(Ee(o,function(e){if(Fe(e)||Fe(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(Fe(c[t])?c[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+c[t]+", "+n)),(!t||t<i.priority)&&s.push(e)}),o.push(i),s.push(i),o=Ne(o),a._extensions=o,Te(new me([i],e,a),o),Te(new me(s,e,a),o),a._extensions=s,0===a.getTransmissionControls().length)throw new Error("No channels available");a._setInit(!0)},Ue.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ue.prototype.track=function(e){e.iKey||(e.iKey=this.config.instrumentationKey),e.time||(e.time=L.toISOString(new Date)),Fe(e.ver)&&(e.ver="4.0"),this.getProcessTelContext().processNext(e)},Ue.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new me(t,this.config,this)},Ue);function Ue(){var t=!1;this._extensions=new Array,this._channelController=new He,this.isInitialized=function(){return t},this._setInit=function(e){t=e}}var ze=(Oe.prototype.addNotificationListener=function(e){this.listeners.push(e)},Oe.prototype.removeNotificationListener=function(e){for(var t=L.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=L.arrIndexOf(this.listeners,e)},Oe.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,a=0;a<this.listeners.length;++a)e(a)},Oe.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){a.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},a=this,i=0;i<this.listeners.length;++i)e(i)},Oe);function Oe(){this.listeners=[]}var Pe;t(Ge,Pe=ke),Ge.prototype.initialize=function(e,t){var n=this;n._notificationManager=new ze,n.logger=new le(e),n.config=e,Pe.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},Ge.prototype.getTransmissionControls=function(){return Pe.prototype.getTransmissionControls.call(this)},Ge.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Pe.prototype.track.call(this,e)},Ge.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},Ge.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},Ge.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];L.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:L.toISOString(new Date),baseType:ce.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},Ge.prototype._validateTelemetryItem=function(e){if(L.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},Ge.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],c)};function Ge(){return Pe.call(this)||this}var We=(Xe.requestContextHeader="Request-Context",Xe.requestContextTargetKey="appId",Xe.requestContextAppIdFormat="appId=cid-v1:",Xe.requestIdHeader="Request-Id",Xe.traceParentHeader="traceparent",Xe.sdkContextHeader="Sdk-Context",Xe.sdkContextHeaderAppIdRequest="appId",Xe.requestContextHeaderLowerCase="request-context",Xe);function Xe(){}var Be=(Ve.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=Ve.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;n[o]!==undefined;)i++,o=a.substring(0,Ve.MAX_NAME_LENGTH-3)+Ve.padNumber(i);a=o}return a},Ve.sanitizeKey=function(e,t){var n;return t&&(t=Ve.trim(t.toString())).length>Ve.MAX_NAME_LENGTH&&(n=t.substring(0,Ve.MAX_NAME_LENGTH),e.throwInternal(q.WARNING,te,"name is too long. It has been truncated to "+Ve.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},Ve.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=Ve.MAX_STRING_LENGTH),t&&(n=n||Ve.MAX_STRING_LENGTH,(t=Ve.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(q.WARNING,ne,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},Ve.sanitizeUrl=function(e,t){return Ve.sanitizeInput(e,t,Ve.MAX_URL_LENGTH,re)},Ve.sanitizeMessage=function(e,t){var n;return t&&t.length>Ve.MAX_MESSAGE_LENGTH&&(n=t.substring(0,Ve.MAX_MESSAGE_LENGTH),e.throwInternal(q.WARNING,ee,"message is too long, it has been truncated to "+Ve.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},Ve.sanitizeException=function(e,t){var n;return t&&t.length>Ve.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,Ve.MAX_EXCEPTION_LENGTH),e.throwInternal(q.WARNING,Y,"exception is too long, it has been truncated to "+Ve.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},Ve.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var a=t[r];if(L.isObject(a)&&h())try{a=m().stringify(a)}catch(i){e.throwInternal(q.WARNING,$,"custom property is not valid",{exception:i},!0)}a=Ve.sanitizeString(e,a,Ve.MAX_PROPERTY_LENGTH),n[r=Ve.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},Ve.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=Ve.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},Ve.sanitizeId=function(e,t){return t?Ve.sanitizeInput(e,t,Ve.MAX_ID_LENGTH,ie).toString():t},Ve.sanitizeInput=function(e,t,n,r){var a;return t&&(t=Ve.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(q.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},Ve.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},Ve.trim=function(e){return L.isString(e)?e.replace(/^\s+|\s+$/g,""):e},Ve.MAX_NAME_LENGTH=150,Ve.MAX_ID_LENGTH=128,Ve.MAX_PROPERTY_LENGTH=8192,Ve.MAX_STRING_LENGTH=1024,Ve.MAX_URL_LENGTH=2048,Ve.MAX_MESSAGE_LENGTH=32768,Ve.MAX_EXCEPTION_LENGTH=32768,Ve);function Ve(){}var Ke="prototype",Qe=f(),Je=function An(){return function e(){return Boolean(typeof navigator===u&&navigator)}()?navigator:null}(),$e=L.isString,Ye=(Ze.createDomEvent=function(e){var t=null;return L.isFunction(Event)?t=new Event(e):(t=g().createEvent("Event")).initEvent(e,!0,!0),t},Ze.disableStorage=function(){Ze._canUseLocalStorage=!1,Ze._canUseSessionStorage=!1},Ze._getLocalStorageObject=function(){return Ze.canUseLocalStorage()?Ze._getVerifiedStorageObject(i.LocalStorage):null},Ze._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(L.isNullOrUndefined(Qe))return null;n=new Date,(r=e===i.LocalStorage?Qe.localStorage:Qe.sessionStorage).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(a){r=null}return r},Ze.isInternalApplicationInsightsEndpoint=function(e){return-1!==Ze._internalEndpoints.indexOf(e.toLowerCase())},Ze.canUseLocalStorage=function(){return Ze._canUseLocalStorage===undefined&&(Ze._canUseLocalStorage=!!Ze._getVerifiedStorageObject(i.LocalStorage)),Ze._canUseLocalStorage},Ze.getStorage=function(e,t){var n=Ze._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,k,"Browser failed read of local storage. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return null},Ze.setStorage=function(e,t,n){var r=Ze._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,z,"Browser failed write to local storage. "+Ze.getExceptionName(a),{exception:Ze.dump(a)})}return!1},Ze.removeStorage=function(e,t){var n=Ze._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){Ze._canUseLocalStorage=!1,e.throwInternal(q.WARNING,P,"Browser failed removal of local storage item. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return!1},Ze._getSessionStorageObject=function(){return Ze.canUseSessionStorage()?Ze._getVerifiedStorageObject(i.SessionStorage):null},Ze.canUseSessionStorage=function(){return Ze._canUseSessionStorage===undefined&&(Ze._canUseSessionStorage=!!Ze._getVerifiedStorageObject(i.SessionStorage)),Ze._canUseSessionStorage},Ze.getSessionStorageKeys=function(){var e=[];if(Ze.canUseSessionStorage())for(var t in Qe.sessionStorage)e.push(t);return e},Ze.getSessionStorage=function(e,t){var n=Ze._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,U,"Browser failed read of session storage. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return null},Ze.setSessionStorage=function(e,t,n){var r=Ze._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,O,"Browser failed write to session storage. "+Ze.getExceptionName(a),{exception:Ze.dump(a)})}return!1},Ze.removeSessionStorage=function(e,t){var n=Ze._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){Ze._canUseSessionStorage=!1,e.throwInternal(q.WARNING,G,"Browser failed removal of session storage item. "+Ze.getExceptionName(r),{exception:Ze.dump(r)})}return!1},Ze.disableCookies=function(){L.disableCookies()},Ze.canUseCookies=function(e){if(L._canUseCookies===undefined){L._canUseCookies=!1;try{L._canUseCookies=Ze.document.cookie!==undefined}catch(t){e.throwInternal(q.WARNING,ae,"Cannot access document.cookie - "+Ze.getExceptionName(t),{exception:Ze.dump(t)})}}return L._canUseCookies},Ze.setCookie=function(e,t,n,r){n+=";SameSite=None";var a="",i="";r&&(a=";domain="+r),Ze.document.location&&"https:"===Ze.document.location.protocol&&(i=";secure"),Ze.canUseCookies(e)&&(Ze.document.cookie=t+"="+n+a+";path=/"+i)},Ze.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},Ze.getCookie=function(e,t){if(Ze.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=Ze.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=Ze.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},Ze.deleteCookie=function(e,t){Ze.canUseCookies(e)&&(Ze.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Ze.trim=function(e){return $e(e)?e.replace(/^\s+|\s+$/g,""):e},Ze.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Ze.random32=function(){return 4294967296*Math.random()|0},Ze.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=Ze.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var a=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)},Ze.isArray=function(e){return"[object Array]"===Object[Ke].toString.call(e)},Ze.isError=function(e){return"[object Error]"===Object[Ke].toString.call(e)},Ze.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():Je?Je.userAgent.toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},Ze.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},Ze.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},Ze.dump=function(e){var t=Object[Ke].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":h()&&(n=m().stringify(e)),t+n},Ze.getExceptionName=function(e){return"[object Error]"===Object[Ke].toString.call(e)?e.name:""},Ze.addEventHandler=function(e,t){return E.Attach(Qe,e,t)},Ze.IsBeaconApiSupported=function(){return"sendBeacon"in Je&&Je.sendBeacon},Ze.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},Ze.document=g()||{},Ze._canUseLocalStorage=undefined,Ze._canUseSessionStorage=undefined,Ze._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Ze.NotSpecified="not_specified",Ze.isDate=L.isDate,Ze.toISOStringForIE8=L.toISOString,Ze);function Ze(){}var et=(tt.parseUrl=function(e){return tt.htmlAnchorElement||(tt.htmlAnchorElement=tt.document.createElement?tt.document.createElement("a"):{host:tt.parseHost(e)}),tt.htmlAnchorElement.href=e,tt.htmlAnchorElement},tt.getAbsoluteUrl=function(e){var t,n=tt.parseUrl(e);return n&&(t=n.href),t},tt.getPathName=function(e){var t,n=tt.parseUrl(e);return n&&(t=n.pathname),t},tt.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},tt.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&$e(t[2])&&0<t[2].length)return t[2]}return null},tt.document=g()||{},tt);function tt(){}var nt=(rt.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=et.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(L.arrForEach(i,function(e){var t=new RegExp(e.toLowerCase().replace(/\./g,".").replace(/\*/g,".*"));a=a||t.test(r)}),!a))return!1;var o=e&&e.correlationHeaderExcludedDomains;if(!o||0===o.length)return!0;for(var s=0;s<o.length;s++)if(new RegExp(o[s].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},rt.getCorrelationContext=function(e){if(e){var t=rt.getCorrelationContextValue(e,We.requestContextTargetKey);if(t&&t!==rt.correlationIdPrefix)return t}},rt.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2===a.length&&a[0]===t)return a[1]}},rt.correlationIdPrefix="cid-v1:",rt);function rt(){}var at=(it.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=et.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=Be.sanitizeString(e,n?n+" "+c:c)}else i=Be.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},it);function it(){}var ot=(st.Now=L.isUndefined(Qe)?function(){return(new Date).getTime()}:Qe.performance&&Qe.performance.now&&Qe.performance.timing?function(){return Qe.performance.now()+Qe.performance.timing.navigationStart}:function(){return(new Date).getTime()},st.GetDuration=function(e,t){var n=null;return 0===e||0===t||L.isNullOrUndefined(e)||L.isNullOrUndefined(t)||(n=t-e),n},st);function st(){}var ct,ut="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",lt=(t(dt,ct=function Mn(){}),dt);function dt(){return ct.call(this)||this}var ft;t(gt,ft=function wn(){this.ver=1,this.sampleRate=100,this.tags={}});function gt(e,t,n){var r=ft.call(this)||this;return r.name=Be.sanitizeString(e,n)||Ye.NotSpecified,r.data=t,r.time=L.toISOString(new Date),r.aiDataContract={time:p.Required,iKey:p.Required,name:p.Required,sampleRate:function(){return 100===r.sampleRate?p.Hidden:p.Required},tags:p.Required,data:p.Required},r}var pt,ht=function Ln(){},mt=(t(vt,pt=ht),vt);function vt(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var xt;t(yt,xt=mt),yt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",yt.dataType="EventData";function yt(e,t,n,r){var a=xt.call(this)||this;return a.aiDataContract={ver:p.Required,name:p.Required,properties:p.Default,measurements:p.Default},a.name=Be.sanitizeString(e,t)||Ye.NotSpecified,a.properties=Be.sanitizeProperties(e,n),a.measurements=Be.sanitizeMeasurements(e,r),a}var It,Dt=function Rn(){},Ct=(t(St,It=ht),St);function St(){var e=It.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var bt,_t=function qn(){this.hasFullStack=!0,this.parsedStack=[]};t(Tt,bt=Ct),Tt.CreateFromInterface=function(t,e){var n=e.exceptions&&L.arrMap(e.exceptions,function(e){return At.CreateFromInterface(t,e)});return new Tt(t,s({},e,{exceptions:n}))},Tt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&L.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:a,properties:n,measurements:r,problemGroup:i,id:o,isManual:s}},Tt.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},Tt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Tt.dataType="ExceptionData";function Tt(e,t,n,r,a,i){var o=bt.call(this)||this;return o.aiDataContract={ver:p.Required,exceptions:p.Required,severityLevel:p.Default,properties:p.Default,measurements:p.Default},t instanceof Error?(o.exceptions=[new At(e,t)],o.properties=Be.sanitizeProperties(e,n),o.measurements=Be.sanitizeMeasurements(e,r),a&&(o.severityLevel=a),i&&(o.id=i)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,L.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Nt,At=(t(Mt,Nt=_t),Mt.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&L.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},Mt.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&L.arrMap(t.parsedStack,function(e){return Lt.CreateFromInterface(e)})||t.parsedStack;return new Mt(e,s({},t,{parsedStack:n}))},Mt.parseStack=function(e){var t;if(L.isString(e)){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(Lt.regex.test(o)){var s=new Lt(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var g=f-d+1;t.splice(d,g);break}d=c,f=u,c++,u--}}return t},Mt);function Mt(e,t){var n=Nt.call(this)||this;if(n.aiDataContract={id:p.Default,outerId:p.Default,typeName:p.Required,message:p.Required,hasFullStack:p.Default,stack:p.Default,parsedStack:p.Array},t instanceof Error){n.typeName=Be.sanitizeString(e,t.name)||Ye.NotSpecified,n.message=Be.sanitizeMessage(e,t.message)||Ye.NotSpecified;var r=t.stack;n.parsedStack=Mt.parseStack(r),n.stack=Be.sanitizeException(e,r),n.hasFullStack=Ye.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var wt,Lt=(t(Rt,wt=Dt),Rt.CreateFromInterface=function(e){return new Rt(e,null)},Rt.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Rt.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Rt.baseSize=58,Rt);function Rt(e,t){var n=wt.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:p.Required,method:p.Required,assembly:p.Default,fileName:p.Default,line:p.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=Ye.trim(r),n.fileName="",n.line=0;var a=r.match(Rt.regex);a&&5<=a.length&&(n.method=Ye.trim(a[2])||n.method,n.fileName=Ye.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Rt.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qt,Ht,jt,Et=(t(Ft,qt=ht),Ft);function Ft(){var e=qt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(jt=Ht=Ht||{})[jt.Measurement=0]="Measurement",jt[jt.Aggregation=1]="Aggregation";var kt,Ut=(t(zt,kt=function Hn(){this.kind=Ht.Measurement}),zt);function zt(){var e=null!==kt&&kt.apply(this,arguments)||this;return e.aiDataContract={name:p.Required,kind:p.Default,value:p.Required,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default},e}var Ot;t(Pt,Ot=Et),Pt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Pt.dataType="MetricData";function Pt(e,t,n,r,a,i,o,s){var c=Ot.call(this)||this;c.aiDataContract={ver:p.Required,metrics:p.Required,properties:p.Default};var u=new Ut;return u.count=0<r?r:undefined,u.max=isNaN(i)||null===i?undefined:i,u.min=isNaN(a)||null===a?undefined:a,u.name=Be.sanitizeString(e,t)||Ye.NotSpecified,u.value=n,c.metrics=[u],c.properties=Be.sanitizeProperties(e,o),c.measurements=Be.sanitizeMeasurements(e,s),c}var Gt,Wt=(t(Xt,Gt=mt),Xt);function Xt(){var e=Gt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Bt;t(Vt,Bt=Wt),Vt.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Vt.dataType="PageviewData";function Vt(e,t,n,r,a,i,o){var s=Bt.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,properties:p.Default,measurements:p.Default,id:p.Default},s.id=Be.sanitizeId(e,o),s.url=Be.sanitizeUrl(e,n),s.name=Be.sanitizeString(e,t)||Ye.NotSpecified,isNaN(r)||(s.duration=Ye.msToTimeSpan(r)),s.properties=Be.sanitizeProperties(e,a),s.measurements=Be.sanitizeMeasurements(e,i),s}var Kt,Qt=(t(Jt,Kt=ht),Jt);function Jt(){var e=Kt.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var $t,Yt=(t(Zt,$t=Qt),Zt.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Zt.dataType="RemoteDependencyData",Zt);function Zt(e,t,n,r,a,i,o,s,c,u,l,d){void 0===c&&(c="Ajax");var f=$t.call(this)||this;f.aiDataContract={id:p.Required,ver:p.Required,name:p.Default,resultCode:p.Default,duration:p.Default,success:p.Default,data:p.Default,target:p.Default,type:p.Default,properties:p.Default,measurements:p.Default,kind:p.Default,value:p.Default,count:p.Default,min:p.Default,max:p.Default,stdDev:p.Default,dependencyKind:p.Default,dependencySource:p.Default,commandName:p.Default,dependencyTypeName:p.Default},f.id=t,f.duration=Ye.msToTimeSpan(a),f.success=i,f.resultCode=o+"",f.type=Be.sanitizeString(e,c);var g=at.ParseDependencyPath(e,n,s,r);return f.data=Be.sanitizeUrl(e,r)||g.data,f.target=Be.sanitizeString(e,g.target),u&&(f.target=f.target+" | "+u),f.name=Be.sanitizeString(e,g.name),f.properties=Be.sanitizeProperties(e,l),f.measurements=Be.sanitizeMeasurements(e,d),f}var en,tn=(t(nn,en=ht),nn);function nn(){var e=en.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var rn;t(an,rn=tn),an.envelopeType="Microsoft.ApplicationInsights.{0}.Message",an.dataType="MessageData";function an(e,t,n,r,a){var i=rn.call(this)||this;return i.aiDataContract={ver:p.Required,message:p.Required,severityLevel:p.Default,properties:p.Default},t=t||Ye.NotSpecified,i.message=Be.sanitizeMessage(e,t),i.properties=Be.sanitizeProperties(e,r),i.measurements=Be.sanitizeMeasurements(e,a),n&&(i.severityLevel=n),i}var on,sn=(t(cn,on=Wt),cn);function cn(){var e=on.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var un;t(ln,un=sn),ln.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",ln.dataType="PageviewPerformanceData";function ln(e,t,n,r,a,i,o){var s=un.call(this)||this;return s.aiDataContract={ver:p.Required,name:p.Default,url:p.Default,duration:p.Default,perfTotal:p.Default,networkConnect:p.Default,sentRequest:p.Default,receivedResponse:p.Default,domProcessing:p.Default,properties:p.Default,measurements:p.Default},s.url=Be.sanitizeUrl(e,n),s.name=Be.sanitizeString(e,t)||Ye.NotSpecified,s.properties=Be.sanitizeProperties(e,a),s.measurements=Be.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var dn,fn,gn;t(pn,dn=lt);function pn(e,t){var n=dn.call(this)||this;return n.aiDataContract={baseType:p.Required,baseData:p.Required},n.baseType=e,n.baseData=t,n}(gn=fn=fn||{})[gn.Verbose=0]="Verbose",gn[gn.Information=1]="Information",gn[gn.Warning=2]="Warning",gn[gn.Error=3]="Error",gn[gn.Critical=4]="Critical";var hn=(mn.create=function(e,t,n,r,a,i){if(n=Be.sanitizeString(r,n)||Ye.NotSpecified,L.isNullOrUndefined(e)||L.isNullOrUndefined(t)||L.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:L.toISOString(new Date),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!L.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},mn);function mn(){}var vn=function jn(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},xn=(yn.prototype.getAbsoluteUrl=function(){return this.requestUrl?et.getAbsoluteUrl(this.requestUrl):null},yn.prototype.getPathName=function(){return this.requestUrl?Be.sanitizeUrl(this._logger,et.getCompleteUrl(this.method,this.requestUrl)):null},yn);function yn(e,t,n){this.completed=!1,this.requestHeadersSize=null,this.requestHeaders=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new vn,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*ot.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var In=(Dn.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},Dn.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},Dn.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},Dn.DEFAULT_TRACE_FLAG="01",Dn.DEFAULT_VERSION="00",Dn);function Dn(e,t){this.traceFlag=Dn.DEFAULT_TRACE_FLAG,this.version=Dn.DEFAULT_VERSION,e&&Dn.isValidTraceId(e)?this.traceId=e:this.traceId=Ye.generateW3CId(),t&&Dn.isValidSpanId(t)?this.spanId=t:this.spanId=Ye.generateW3CId().substr(0,16)}var Cn,Sn=L.isNullOrUndefined,bn=(t(_n,Cn=ye),_n.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:l.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},_n.getEmptyConfig=function(){return{maxAjaxCallsPerView:undefined,disableAjaxTracking:undefined,disableFetchTracking:undefined,disableCorrelationHeaders:undefined,distributedTracingMode:undefined,correlationHeaderExcludedDomains:undefined,appId:undefined,enableCorsCorrelation:undefined,correlationHeaderDomains:undefined,enableRequestHeaderTracking:undefined,enableResponseHeaderTracking:undefined}},_n.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{Sn(e)||Sn(e.ajaxData)||Sn(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(n){}return t},_n.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},_n.prototype.processTelemetry=function(e,t){this.processNext(e,t)},_n.prototype.includeCorrelationHeaders=function(e,t,n,r){var a=this;if(t){if(nt.canIncludeCorrelationHeader(a._config,e.getAbsoluteUrl(),a.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),a._isUsingAIHeaders){var i="|"+e.traceID+"."+e.spanID;n.headers.set(We.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.requestIdHeader]=i)}if((s=a._config.appId||a._context.appId())&&(n.headers.set(We.requestContextHeader,We.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.requestContextHeader]=We.requestContextAppIdFormat+s)),a._isUsingW3CHeaders){var o=new In(e.traceID,e.spanID);n.headers.set(We.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(e.requestHeaders[We.traceParentHeader]=o.toString())}return n}return n}if(r){var s;if(a.currentWindowHost&&nt.canIncludeCorrelationHeader(a._config,r.ajaxData.getAbsoluteUrl(),a.currentWindowHost))a._isUsingAIHeaders&&(i="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(We.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.requestIdHeader]=i)),(s=a._config.appId||a._context.appId())&&(r.setRequestHeader(We.requestContextHeader,We.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.requestContextHeader]=We.requestContextAppIdFormat+s)),a._isUsingW3CHeaders&&(o=new In(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(We.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[We.traceParentHeader]=o.toString()));return r}return undefined},_n.prototype.initialize=function(e,t,n,r){var a=this;Cn.prototype.initialize.call(this,e,t,n,r);var i=a._getTelCtx();if(!a.initialized&&!a._fetchInitialized){var o=_n.getDefaultConfig();for(var s in a._config=_n.getEmptyConfig(),o)a._config[s]=i.getConfig(_n.identifier,s,o[s]);if(a._isUsingAIHeaders=a._config.distributedTracingMode===l.AI||a._config.distributedTracingMode===l.AI_AND_W3C,a._isUsingW3CHeaders=a._config.distributedTracingMode===l.AI_AND_W3C||a._config.distributedTracingMode===l.W3C,!1===a._config.disableAjaxTracking&&a.instrumentXhr(),!1===a._config.disableFetchTracking&&a.instrumentFetch(),0<n.length&&n){for(var c=void 0,u=0;!c&&u<n.length;)n[u]&&"AppInsightsPropertiesPlugin"===n[u].identifier&&(c=n[u]),u++;c&&(a._context=c.context)}}},_n.prototype.trackDependencyDataInternal=function(e,t,n){var r=this;if(-1===r._config.maxAjaxCallsPerView||r._trackAjaxAttempts<r._config.maxAjaxCallsPerView){var a=hn.create(e,Yt.dataType,Yt.envelopeType,r.diagLog(),t,n);r.core.track(a)}else r._trackAjaxAttempts===r._config.maxAjaxCallsPerView&&r.diagLog().throwInternal(q.CRITICAL,Z,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++r._trackAjaxAttempts},_n.prototype.instrumentFetch=function(){var a=this;if(a.supportsFetch()&&!a._fetchInitialized){var e=f(),i=e.fetch,o=a;e.fetch=function(t,e){var n;if(o.isFetchInstrumented(t)&&o.isMonitoredInstance(undefined,undefined,t,e))try{n=o.createFetchRecord(t,e),e=o.includeCorrelationHeaders(n,t,e)}catch(r){o.diagLog().throwInternal(q.CRITICAL,B,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedFetchDiagnosticsMessage(t),exception:Ye.dump(r)})}return i(t,e).then(function(e){return o.onFetchComplete(e,n),e})["catch"](function(e){throw o.onFetchFailed(t,n,e),e})},a._fetchInitialized=!0}},_n.prototype.instrumentXhr=function(){var e=this;e.supportsAjaxMonitoring()&&!e.initialized&&(e.instrumentOpen(),e.instrumentSend(),e.instrumentAbort(),e.instrumentSetRequestHeader(),e.initialized=!0)},_n.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[ut]||!!r&&!0===r[ut]):void 0!==e&&(o=this.initialized,a=!0===e[ut],i=!0===t||!Sn(e.ajaxData)),o&&i&&!a},_n.prototype.supportsAjaxMonitoring=function(){var e=!0;return("undefined"==typeof XMLHttpRequest||Sn(XMLHttpRequest)||Sn(XMLHttpRequest.prototype)||Sn(XMLHttpRequest.prototype.open)||Sn(XMLHttpRequest.prototype.send)||Sn(XMLHttpRequest.prototype.abort))&&(e=!1),e},_n.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,o=this;XMLHttpRequest.prototype.open=function(e,t,n){var r=this;try{!o.isMonitoredInstance(r,!0)||r.ajaxData&&r.ajaxData.xhrMonitoringState.openDone||o.openHandler(r,e,t,n)}catch(a){o.diagLog().throwInternal(q.CRITICAL,B,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(r),exception:Ye.dump(a)})}return i.apply(r,arguments)}},_n.prototype.openHandler=function(e,t,n,r){var a=this,i=a._context&&a._context.telemetryTrace&&a._context.telemetryTrace.traceID||Ye.generateW3CId(),o=Ye.generateW3CId().substr(0,16),s=new xn(i,o,a.diagLog());s.method=t,s.requestUrl=n,s.xhrMonitoringState.openDone=!0,s.requestHeaders={},e.ajaxData=s,a.attachToOnReadyStateChange(e)},_n.prototype.instrumentSend=function(){var r=XMLHttpRequest.prototype.send,a=this;XMLHttpRequest.prototype.send=function(e){var t=this;try{a.isMonitoredInstance(t)&&!t.ajaxData.xhrMonitoringState.sendDone&&a.sendHandler(t,e)}catch(n){a.diagLog().throwInternal(q.CRITICAL,K,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(t),exception:Ye.dump(n)})}return r.apply(t,arguments)}},_n.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=ot.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,undefined,undefined,e)).ajaxData.xhrMonitoringState.sendDone=!0},_n.prototype.instrumentAbort=function(){var n=XMLHttpRequest.prototype.abort,r=this;XMLHttpRequest.prototype.abort=function(){var e=this;try{r.isMonitoredInstance(e)&&!e.ajaxData.xhrMonitoringState.abortDone&&(e.ajaxData.aborted=1,e.ajaxData.xhrMonitoringState.abortDone=!0)}catch(t){r.diagLog().throwInternal(q.CRITICAL,W,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),exception:Ye.dump(t)})}return n.apply(e,arguments)}},_n.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var a=XMLHttpRequest.prototype.setRequestHeader,i=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){var n=this;try{i.isMonitoredInstance(n)&&(n.ajaxData.requestHeaders[e]=t)}catch(r){i.diagLog().throwInternal(q.CRITICAL,oe,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(n),exception:Ye.dump(r)})}return a.apply(n,arguments)}}},_n.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=E.Attach(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(t){var e=Ye.dump(t);e&&-1!==e.toLowerCase().indexOf("c00c023f")||r.diagLog().throwInternal(q.CRITICAL,V,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(n),exception:Ye.dump(t)})}})},_n.prototype.onAjaxComplete=function(e){var t=this;if(e.ajaxData.responseFinishedTime=ot.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)t.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var n={id:"|"+e.ajaxData.traceID+"."+e.ajaxData.spanID,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},r=t.getAjaxCorrelationContext(e);if(r&&(n.correlationContext=r),t._config.enableRequestHeaderTracking&&0<L.objKeys(e.ajaxData.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders={},n.properties.requestHeaders=e.ajaxData.requestHeaders),t._config.enableResponseHeaderTracking){var a=e.getAllResponseHeaders();if(a){var i=a.trim().split(/[\r\n]+/),o={};L.arrForEach(i,function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");o[n]=r}),0<L.objKeys(o).length&&(n.properties=n.properties||{},n.properties.responseHeaders={},n.properties.responseHeaders=o)}}t.trackDependencyDataInternal(n),e.ajaxData=null}},_n.prototype.getAjaxCorrelationContext=function(e){try{var t=e.getAllResponseHeaders();if(null!==t&&-1!==t.toLowerCase().indexOf(We.requestContextHeaderLowerCase)){var n=e.getResponseHeader(We.requestContextHeader);return nt.getCorrelationContext(n)}}catch(r){this.diagLog().throwInternal(q.WARNING,Q,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:_n.getFailedAjaxDiagnosticsMessage(e),exception:Ye.dump(r)})}},_n.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[ut]},_n.prototype.supportsFetch=function(){var e=!0,t=f();return(!t||Sn(t.Request)||Sn(t.Request.prototype)||Sn(t.fetch))&&(e=!1),e},_n.prototype.createFetchRecord=function(e,t){var n=this,r=n._context&&n._context.telemetryTrace&&n._context.telemetryTrace.traceID||Ye.generateW3CId(),a=Ye.generateW3CId().substr(0,16),i=new xn(r,a,n.diagLog());return i.requestSentTime=ot.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",t&&t.headers&&n._config.enableRequestHeaderTracking?i.requestHeaders=t.headers:i.requestHeaders={},i},_n.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{Sn(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(n){this.diagLog().throwInternal(q.CRITICAL,B,"Failed to grab failed fetch diagnostics message",{exception:Ye.dump(n)})}return t},_n.prototype.onFetchComplete=function(e,t){var n=this;if(t)try{if(t.responseFinishedTime=ot.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)n.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var r={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:200<=e.status&&e.status<400,responseCode:e.status,properties:{HttpMethod:t.method}},a=n.getFetchCorrelationContext(e);if(a&&(r.correlationContext=a),n._config.enableRequestHeaderTracking&&0<L.objKeys(t.requestHeaders).length&&(r.properties=r.properties||{},r.properties.requestHeaders=t.requestHeaders),n._config.enableResponseHeaderTracking){var i={};e.headers.forEach(function(e,t){i[t]=e}),0<L.objKeys(i).length&&(r.properties=r.properties||{},r.properties.responseHeaders=i)}n.trackDependencyDataInternal(r)}}catch(o){n.diagLog().throwInternal(q.WARNING,Q,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(o)})}},_n.prototype.onFetchFailed=function(e,t,n){var r=this;if(t)try{if(t.responseFinishedTime=ot.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)r.diagLog().throwInternal(q.WARNING,X,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var a={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:t.method}};r.trackDependencyDataInternal(a,{error:n.message})}}catch(i){r.diagLog().throwInternal(q.WARNING,Q,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(i)})}},_n.prototype.getFetchCorrelationContext=function(e){try{var t=e.headers.get(We.requestContextHeader);return nt.getCorrelationContext(t)}catch(n){this.diagLog().throwInternal(q.WARNING,Q,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(e),exception:Ye.dump(n)})}},_n.identifier="AjaxDependencyPlugin",_n);function _n(){var e=Cn.call(this)||this;e.identifier=_n.identifier,e.priority=120,e._trackAjaxAttempts=0;var t=f();return e.currentWindowHost=t&&t.location&&t.location.host&&t.location.host.toLowerCase(),e.initialized=!1,e._fetchInitialized=!1,e}e.AjaxPlugin=bn,e.ajaxRecord=xn,Object.defineProperty(e,"__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={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?function(e){var t=Object.create;if(t)return t(e);if(null==e)return{};var n=typeof e;if("object"!=n&&"function"!=n)throw new TypeError("Object prototype may only be an Object:"+e);function r(){}return r.prototype=e,new r}(t):(n.prototype=t.prototype,new n)}var i,n,g,a,l,o,s=function(){return(s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=g=g||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(o=l=l||{})[o.AI=0]="AI",o[o.AI_AND_W3C=1]="AI_AND_W3C",o[o.W3C=2]="W3C";var u=2,c="undefined",d="object",f="window",p="location",h="JSON";function m(){return typeof globalThis!==c&&globalThis?globalThis:typeof self!==c&&self?self:typeof window!==c&&window?window:typeof global!==c&&global?global:null}function v(e){var t=m();return t&&t[e]?t[e]:e===f&&x()?window:null}function x(){return Boolean(typeof window===d&&window)}function y(){return x()?window:v(f)}function I(){return function e(){return Boolean(typeof document===d&&document)}()?document:v("document")}function C(){return function e(){return Boolean(typeof navigator===d&&navigator)}()?navigator:v("navigator")}function D(){return typeof location===d&&location?location:v(p)}function S(){return Boolean(typeof JSON===d&&JSON||null!==v(h))}function b(){return S()?JSON||v(h):null}var _=c,T="prototype",N="attachEvent",A="addEventListener",M="detachEvent",w="removeEventListener";function L(e,t){return typeof e===t}function R(e){return e===undefined||L(e,_)}function j(e){return R(e)||null===e}function q(e,t){return e&&Object[T].hasOwnProperty.call(e,t)}function H(e){return L(e,"object")}function E(e){return L(e,"function")}function k(e,t,n,r){void 0===r&&(r=!1);var a=!1;if(!j(e))try{j(e[A])?j(e[N])||(e[N]("on"+t,n),a=!0):(e[A](t,n,r),a=!0)}catch(i){}return a}function U(e,t,n,r){if(void 0===r&&(r=!1),!j(e))try{j(e[w])?j(e[M])||e[M]("on"+t,n):e[w](t,n,r)}catch(a){}}var F=(O.isDate=function(e){return"[object Date]"===Object[T].toString.call(e)},O.isString=function(e){return L(e,"string")},O.isNumber=function(e){return L(e,"number")},O.isBoolean=function(e){return L(e,"boolean")},O.disableCookies=function(){O._canUseCookies=!1},O.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(G,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},O.toISOString=function(e){if(O.isDate(e)){var t=function(e){var t=String(e);return 1===t.length&&(t="0"+t),t};return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"."+String((e.getUTCMilliseconds()/1e3).toFixed(3)).slice(2,5)+"Z"}},O.arrForEach=function(e,t,n){for(var r=e.length,a=0;a<r;++a)a in e&&t.call(n||e,e[a],a,e)},O.arrIndexOf=function(e,t,n){for(var r=e.length,a=n||0,i=Math.max(0<=a?a:r-Math.abs(a),0);i<r;i++)if(i in e&&e[i]===t)return i;return-1},O.arrMap=function(e,t,n){for(var r=e.length,a=n||e,i=new Array(r),o=0;o<r;o++)o in e&&(i[o]=t.call(a,e[o],e));return i},O.arrReduce=function(e,t,n){var r,a=e.length,i=0;if(3<=arguments.length)r=n;else{for(;i<a&&!(i in e);)i++;r=e[i++]}for(;i<a;)i in e&&(r=t(r,e[i],i,e)),i++;return r},O.objCreate=function(e){if(null==e)return{};if(!H(e)&&!E(e))throw new TypeError("Object prototype may only be an Object: "+e);function t(){}return t[T]=e,new t},O.objKeys=function(e){var t=!{toString:null}.propertyIsEnumerable("toString");if(!(E(e)||H(e)&&null!==e))throw new TypeError("objKeys called on non-object");var n=[];for(var r in e)q(e,r)&&n.push(r);if(t)for(var a=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],i=a.length,o=0;o<i;o++)q(e,a[o])&&n.push(a[o]);return n},O.objDefineAccessors=function(e,t,n,r){var a=Object.defineProperty;if(a)try{var i={enumerable:!0,configurable:!0};return n&&(i.get=n),r&&(i.set=r),a(e,t,i),!0}catch(o){}return!1},O.addEventHandler=function(e,t){var n=!1,r=y();r&&(n=k(r,e,t),n=k(r.body,e,t)||n);var a=I();return a&&(n=X.Attach(a,e,t)||n),n},O.isTypeof=L,O.isUndefined=R,O.isNullOrUndefined=j,O.hasOwnProperty=q,O.isFunction=E,O.isObject=H,O);function O(){}var z,P,G=/[xy]/g,X=(W.Attach=k,W.AttachEvent=k,W.Detach=U,W.DetachEvent=U,W);function W(){}(P=z=z||{})[P.CRITICAL=1]="CRITICAL",P[P.WARNING=2]="WARNING";var B=1,K=2,V=3,Q=4,J=5,$=6,Y=13,Z=14,ee=15,te=16,ne=17,re=18,ae=23,ie=49,oe=52,se=55,ue=56,ce=57,le=61,de=66,fe=68,pe=69,ge=71,he=73,me=(ve.sanitizeDiagnosticText=function(e){return e?'"'+e.replace(/\"/g,"")+'"':""},ve.dataType="MessageData",ve.AiNonUserActionablePrefix="AI (Internal): ",ve.AiUserActionablePrefix="AI: ",ve);function ve(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?ve.AiUserActionablePrefix:ve.AiNonUserActionablePrefix)+e;var a="";S()&&(a=b().stringify(r));var i=(t?" message:"+ve.sanitizeDiagnosticText(t):"")+(r?" props:"+ve.sanitizeDiagnosticText(a):"");this.message+=i}var xe=(ye.prototype.throwInternal=function(e,t,n,r,a){void 0===a&&(a=!1);var i=new me(t,n,a,r),o=this;if(o.enableDebugExceptions())throw i;if(!F.isUndefined(i)&&i&&!F.isUndefined(i.message)){if(a){var s=+i.messageId;!o._messageLogged[s]&&o.consoleLoggingLevel()>=z.WARNING&&(o.warnToConsole(i.message),o._messageLogged[s]=!0)}else o.consoleLoggingLevel()>=z.WARNING&&o.warnToConsole(i.message);o.logInternalMessage(e,i)}},ye.prototype.warnToConsole=function(e){!F.isUndefined(console)&&console&&(F.isFunction(console.warn)?console.warn(e):F.isFunction(console.log)&&console.log(e))},ye.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ye.prototype.logInternalMessage=function(e,t){var n=this;if(!n._areInternalMessagesThrottled()){var r=!0,a=n.AIInternalMessagePrefix+t.messageId;if(n._messageLogged[a]?r=!1:n._messageLogged[a]=!0,r&&(e<=n.telemetryLoggingLevel()&&(n.queue.push(t),n._messageCount++),n._messageCount===n.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",o=new me(ae,i,!1);n.queue.push(o),n.warnToConsole(i)}}},ye.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ye);function ye(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},F.isNullOrUndefined(e)||(F.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),F.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),F.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),F.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}var Ie=F.isFunction,Ce=function qn(a,i){var o=this,s=null,u=Ie(a.processTelemetry),c=Ie(a.setNextPlugin);o._hasRun=!1,o.getPlugin=function(){return a},o.getNext=function(){return s},o.setNext=function(e){s=e},o.processTelemetry=function(e,t){if(t=t||i,a&&u){o._hasRun=!0;try{t.setNext(s),c&&a.setNextPlugin(s),s&&(s._hasRun=!1),a.processTelemetry(e,t)}catch(r){var n=s&&s._hasRun;s&&n||t.diagLog().throwInternal(z.CRITICAL,he,"Plugin ["+a.identifier+"] failed during processTelemetry - "+r),s&&!n&&s.processTelemetry(e,t)}}else s&&(o._hasRun=!0,s.processTelemetry(e,t))}},De=F.isNullOrUndefined;function Se(e,t){var n=[];if(e&&0<e.length)for(var r=null,a=0;a<e.length;a++){var i=e[a];if(i&&F.isFunction(i.processTelemetry)){var o=new Ce(i,t);n.push(o),r&&r.setNext(o),r=o}}return 0<n.length?n[0]:null}var be=function Hn(e,i,n,t){var o=this,r=null;null!==t&&(e&&F.isFunction(e.getPlugin)?r=function s(e,t,n){var r=[],a=!n;if(e)for(;e;){var i=e.getPlugin();!a&&i!==n||(a=!0,r.push(i)),e=e.getNext()}return a||r.push(n),Se(r,t)}(e,o,t||e.getPlugin()):t?r=function u(e,t,n){var r=e,a=!1;return n&&e&&(r=[],F.arrForEach(e,function(e){!a&&e!==n||(a=!0,r.push(e))})),n&&!a&&(r=r||[]).push(n),Se(r,t)}(e,o,t):F.isUndefined(t)&&(r=Se(e,o))),o.core=function(){return n},o.diagLog=function(){var e=(n||{}).logger;return e=e||new xe(i||{})},o.getCfg=function(){return i},o.getExtCfg=function(e,t){var n;if(void 0===t&&(t={}),i){var r=i.extensionConfig;r&&e&&(n=r[e])}return n||t},o.getConfig=function(e,t,n){var r;void 0===n&&(n=!1);var a=o.getExtCfg(e,null);return a&&!De(a[t])?r=a[t]:i&&!De(i[t])&&(r=i[t]),De(r)?n:r},o.hasNext=function(){return null!=r},o.getNext=function(){return r},o.setNext=function(e){r=e},o.processNext=function(e){var t=r;t&&(r=t.getNext(),t.processTelemetry(e,o))},o.createNew=function(e,t){return void 0===e&&(e=null),new Hn(e||r,i,n,t)}},_e=F.isFunction,Te="getPlugin",Ne=(Ae.prototype.initialize=function(e,t,n,r){this._baseTelInit(e,t,n,r)},Ae);function Ae(){var i=this,o=!1,s=null,u=null;i.core=null,i.diagLog=function(e){return i._getTelCtx(e).diagLog()},i.isInitialized=function(){return o},i.setInitialized=function(e){o=e},i.setNextPlugin=function(e){u=e},i.processNext=function(e,t){t?t.processNext(e):u&&_e(u.processTelemetry)&&u.processTelemetry(e,null)},i._getTelCtx=function(e){void 0===e&&(e=null);var t=e;if(!t){var n=s||new be(null,{},i.core);t=u&&u[Te]?n.createNew(null,u[Te]):n.createNew(null,u)}return t},i._baseTelInit=function(e,t,n,r){e&&(e.extensionConfig=e.extensionConfig||[]),!r&&t&&(r=t.getProcessTelContext().getNext());var a=u;u&&u[Te]&&(a=u[Te]()),i.core=t,s=new be(r,e,t,a),o=!0}}var Me=F.isFunction,we="processTelemetry",Le="priority",Re="setNextPlugin",je="isInitialized";function qe(t,n){for(var e=[],r=null,a=t.getNext();a;){var i=a.getPlugin();i&&(r&&Me(r[Re])&&Me(i[we])&&r[Re](i),Me(i[je])&&i[je]()||e.push(i),r=i,a=a.getNext())}F.arrForEach(e,function(e){e.initialize(t.getCfg(),t.core(),n,t.getNext())})}function He(e){return e.sort(function(e,t){var n=0,r=Me(t[we]);return Me(e[we])?n=r?e[Le]-t[Le]:1:r&&(n=-1),n})}var Ee=500,ke="Channel has invalid priority",Ue=F.arrForEach,Fe=F.objDefineAccessors;function Oe(e,t){t&&0<t.length&&(function n(e){Ue(e,function(e){if(e.priority<Ee)throw Error(ke+e.identifier)})}(t=t.sort(function(e,t){return e.priority-t.priority})),e.push(t))}var ze,Pe=(t(Ge,ze=Ne),Ge.prototype.processTelemetry=function(t,n){var r=this;this._channelQueue&&Ue(this._channelQueue,function(e){0<e.length&&r._getTelCtx(n).createNew(e).processNext(t)})},Ge.prototype.getChannelControls=function(){return this._channelQueue},Ge.prototype.initialize=function(t,n,r){if(!this.isInitialized()){ze.prototype.initialize.call(this,t,n,r),t.isCookieUseDisabled&&F.disableCookies();var e=this._channelQueue=function a(e,t){var n=[];if(e&&Ue(e,function(e){return Oe(n,e)}),t){var r=[];Ue(t,function(e){e.priority>Ee&&r.push(e)}),Oe(n,r)}return n}((t||{}).channels,r);Ue(e,function(e){return qe(new be(e,t,n),r)})}},Ge._staticInit=(Fe(Ge.prototype,"ChannelControls",Ge.prototype.getChannelControls),void Fe(Ge.prototype,"channelQueue",Ge.prototype.getChannelControls)),Ge);function Ge(){var e=null!==ze&&ze.apply(this,arguments)||this;return e.identifier="ChannelControllerPlugin",e.priority=Ee,e}var Xe=F.arrForEach,We=F.isNullOrUndefined,Be=(Ke.prototype.initialize=function(e,t,r,n){var a=this;if(a.isInitialized())throw Error("Core should not be initialized more than once");if(!e||We(e.instrumentationKey))throw Error("Please provide instrumentation key");a.config=e;var i=a._channelController;n=n||F.objCreate({addNotificationListener:function(e){},removeNotificationListener:function(e){},eventsSent:function(e){},eventsDiscarded:function(e,t){}}),a._notificationManager=n,e.extensions=We(e.extensions)?[]:e.extensions,(e.extensionConfig=We(e.extensionConfig)?{}:e.extensionConfig).NotificationManager=n,r=r||F.objCreate({throwInternal:function(e,t,n,r,a){void 0===a&&(a=!1)},warnToConsole:function(e){},resetInternalMessageCount:function(){}}),a.logger=r;var o=[];o.push.apply(o,t.concat(e.extensions)),o=He(o);var s=[],u={};if(Xe(o,function(e){if(We(e)||We(e.initialize))throw Error("Extensions must provide callback to initialize");var t=e.priority,n=e.identifier;e&&t&&(We(u[t])?u[t]=n:r.warnToConsole("Two extensions have same priority #"+t+" - "+u[t]+", "+n)),(!t||t<i.priority)&&s.push(e)}),o.push(i),s.push(i),o=He(o),a._extensions=o,qe(new be([i],e,a),o),qe(new be(s,e,a),o),a._extensions=s,0===a.getTransmissionControls().length)throw new Error("No channels available");a._setInit(!0)},Ke.prototype.getTransmissionControls=function(){return this._channelController.getChannelControls()},Ke.prototype.track=function(e){var t=this;e.iKey||(e.iKey=t.config.instrumentationKey),e.time||(e.time=F.toISOString(new Date)),We(e.ver)&&(e.ver="4.0"),t.isInitialized()?(0<t._eventQueue.length&&(Xe(t._eventQueue,function(e){t.getProcessTelContext().processNext(e)}),t._eventQueue=[]),t.getProcessTelContext().processNext(e)):t._eventQueue.push(e)},Ke.prototype.getProcessTelContext=function(){var e=this._extensions,t=e;return e&&0!==e.length||(t=[this._channelController]),new be(t,this.config,this)},Ke);function Ke(){var t=!1,e=this;e._extensions=new Array,e._channelController=new Pe,e.isInitialized=function(){return t},e._setInit=function(e){t=e},e._eventQueue=[]}var Ve=(Qe.prototype.addNotificationListener=function(e){this.listeners.push(e)},Qe.prototype.removeNotificationListener=function(e){for(var t=F.arrIndexOf(this.listeners,e);-1<t;)this.listeners.splice(t,1),t=F.arrIndexOf(this.listeners,e)},Qe.prototype.eventsSent=function(t){for(var n=this,e=function(e){r.listeners[e].eventsSent&&setTimeout(function(){return n.listeners[e].eventsSent(t)},0)},r=this,a=0;a<this.listeners.length;++a)e(a)},Qe.prototype.eventsDiscarded=function(t,n){for(var r=this,e=function(e){a.listeners[e].eventsDiscarded&&setTimeout(function(){return r.listeners[e].eventsDiscarded(t,n)},0)},a=this,i=0;i<this.listeners.length;++i)e(i)},Qe);function Qe(){this.listeners=[]}var Je;t($e,Je=Be),$e.prototype.initialize=function(e,t){var n=this;n._notificationManager=new Ve,n.logger=new xe(e),n.config=e,Je.prototype.initialize.call(this,e,t,n.logger,n._notificationManager)},$e.prototype.getTransmissionControls=function(){return Je.prototype.getTransmissionControls.call(this)},$e.prototype.track=function(e){if(null===e)throw this._notifyInvalidEvent(e),Error("Invalid telemetry item");this._validateTelemetryItem(e),Je.prototype.track.call(this,e)},$e.prototype.addNotificationListener=function(e){this._notificationManager&&this._notificationManager.addNotificationListener(e)},$e.prototype.removeNotificationListener=function(e){this._notificationManager&&this._notificationManager.removeNotificationListener(e)},$e.prototype.pollInternalLogs=function(r){var t=this,e=this.config.diagnosticLogInterval;return 0<e||(e=1e4),setInterval(function(){var n=t,e=n.logger?n.logger.queue:[];F.arrForEach(e,function(e){var t={name:r||"InternalMessageId: "+e.messageId,iKey:n.config.instrumentationKey,time:F.toISOString(new Date),baseType:me.dataType,baseData:{message:e.message}};n.track(t)}),e.length=0},e)},$e.prototype._validateTelemetryItem=function(e){if(F.isNullOrUndefined(e.name))throw this._notifyInvalidEvent(e),Error("telemetry name required")},$e.prototype._notifyInvalidEvent=function(e){this._notificationManager&&this._notificationManager.eventsDiscarded([e],u)};function $e(){return Je.call(this)||this}var Ye=(Ze.requestContextHeader="Request-Context",Ze.requestContextTargetKey="appId",Ze.requestContextAppIdFormat="appId=cid-v1:",Ze.requestIdHeader="Request-Id",Ze.traceParentHeader="traceparent",Ze.sdkContextHeader="Sdk-Context",Ze.sdkContextHeaderAppIdRequest="appId",Ze.requestContextHeaderLowerCase="request-context",Ze);function Ze(){}var et=(tt.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=tt.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;n[o]!==undefined;)i++,o=a.substring(0,tt.MAX_NAME_LENGTH-3)+tt.padNumber(i);a=o}return a},tt.sanitizeKey=function(e,t){var n;return t&&(t=tt.trim(t.toString())).length>tt.MAX_NAME_LENGTH&&(n=t.substring(0,tt.MAX_NAME_LENGTH),e.throwInternal(z.WARNING,ce,"name is too long. It has been truncated to "+tt.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},tt.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=tt.MAX_STRING_LENGTH),t&&(n=n||tt.MAX_STRING_LENGTH,(t=tt.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(z.WARNING,le,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},tt.sanitizeUrl=function(e,t){return tt.sanitizeInput(e,t,tt.MAX_URL_LENGTH,de)},tt.sanitizeMessage=function(e,t){var n;return t&&t.length>tt.MAX_MESSAGE_LENGTH&&(n=t.substring(0,tt.MAX_MESSAGE_LENGTH),e.throwInternal(z.WARNING,ue,"message is too long, it has been truncated to "+tt.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},tt.sanitizeException=function(e,t){var n;return t&&t.length>tt.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,tt.MAX_EXCEPTION_LENGTH),e.throwInternal(z.WARNING,oe,"exception is too long, it has been truncated to "+tt.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},tt.sanitizeProperties=function(e,t){if(t){var n={};for(var r in t){var a=t[r];if(F.isObject(a)&&S())try{a=b().stringify(a)}catch(i){e.throwInternal(z.WARNING,ie,"custom property is not valid",{exception:i},!0)}a=tt.sanitizeString(e,a,tt.MAX_PROPERTY_LENGTH),n[r=tt.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},tt.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=tt.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},tt.sanitizeId=function(e,t){return t?tt.sanitizeInput(e,t,tt.MAX_ID_LENGTH,pe).toString():t},tt.sanitizeInput=function(e,t,n,r){var a;return t&&(t=tt.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(z.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},tt.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},tt.trim=function(e){return F.isString(e)?e.replace(/^\s+|\s+$/g,""):e},tt.MAX_NAME_LENGTH=150,tt.MAX_ID_LENGTH=128,tt.MAX_PROPERTY_LENGTH=8192,tt.MAX_STRING_LENGTH=1024,tt.MAX_URL_LENGTH=2048,tt.MAX_MESSAGE_LENGTH=32768,tt.MAX_EXCEPTION_LENGTH=32768,tt);function tt(){}var nt="prototype",rt=C(),at=F.isString,it=null;var ot=(st.createDomEvent=function(e){var t=null;if(F.isFunction(Event))t=new Event(e);else{var n=I();n&&n.createEvent&&(t=n.createEvent("Event")).initEvent(e,!0,!0)}return t},st.disableStorage=function(){st._canUseLocalStorage=!1,st._canUseSessionStorage=!1},st._getLocalStorageObject=function(){return st.canUseLocalStorage()?st._getVerifiedStorageObject(i.LocalStorage):null},st._getVerifiedStorageObject=function(e){var t,n,r=null;try{if(F.isNullOrUndefined(m()))return null;n=new Date,(r=e===i.LocalStorage?v("localStorage"):v("sessionStorage")).setItem(n.toString(),n.toString()),t=r.getItem(n.toString())!==n.toString(),r.removeItem(n.toString()),t&&(r=null)}catch(a){r=null}return r},st.isInternalApplicationInsightsEndpoint=function(e){return-1!==st._internalEndpoints.indexOf(e.toLowerCase())},st.canUseLocalStorage=function(){return st._canUseLocalStorage===undefined&&(st._canUseLocalStorage=!!st._getVerifiedStorageObject(i.LocalStorage)),st._canUseLocalStorage},st.getStorage=function(e,t){var n=st._getLocalStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,B,"Browser failed read of local storage. "+st.getExceptionName(r),{exception:st.dump(r)})}return null},st.setStorage=function(e,t,n){var r=st._getLocalStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,V,"Browser failed write to local storage. "+st.getExceptionName(a),{exception:st.dump(a)})}return!1},st.removeStorage=function(e,t){var n=st._getLocalStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){st._canUseLocalStorage=!1,e.throwInternal(z.WARNING,J,"Browser failed removal of local storage item. "+st.getExceptionName(r),{exception:st.dump(r)})}return!1},st._getSessionStorageObject=function(){return st.canUseSessionStorage()?st._getVerifiedStorageObject(i.SessionStorage):null},st.canUseSessionStorage=function(){return st._canUseSessionStorage===undefined&&(st._canUseSessionStorage=!!st._getVerifiedStorageObject(i.SessionStorage)),st._canUseSessionStorage},st.getSessionStorageKeys=function(){var e=[];if(st.canUseSessionStorage())for(var t in v("sessionStorage"))e.push(t);return e},st.getSessionStorage=function(e,t){var n=st._getSessionStorageObject();if(null!==n)try{return n.getItem(t)}catch(r){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,K,"Browser failed read of session storage. "+st.getExceptionName(r),{exception:st.dump(r)})}return null},st.setSessionStorage=function(e,t,n){var r=st._getSessionStorageObject();if(null!==r)try{return r.setItem(t,n),!0}catch(a){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,Q,"Browser failed write to session storage. "+st.getExceptionName(a),{exception:st.dump(a)})}return!1},st.removeSessionStorage=function(e,t){var n=st._getSessionStorageObject();if(null!==n)try{return n.removeItem(t),!0}catch(r){st._canUseSessionStorage=!1,e.throwInternal(z.WARNING,$,"Browser failed removal of session storage item. "+st.getExceptionName(r),{exception:st.dump(r)})}return!1},st.disableCookies=function(){F.disableCookies()},st.canUseCookies=function(e){if(F._canUseCookies===undefined){F._canUseCookies=!1;try{F._canUseCookies=st.document.cookie!==undefined}catch(t){e.throwInternal(z.WARNING,fe,"Cannot access document.cookie - "+st.getExceptionName(t),{exception:st.dump(t)})}}return F._canUseCookies&&st.document&&st.document.cookie},st.disallowsSameSiteNone=function(e){return!!at(e)&&(-1!==e.indexOf("CPU iPhone OS 12")||-1!==e.indexOf("iPad; CPU OS 12")||-1!==e.indexOf("Macintosh; Intel Mac OS X 10_14")&&-1!==e.indexOf("Version/")&&-1!==e.indexOf("Safari")||!(-1===e.indexOf("Macintosh; Intel Mac OS X 10_14")||!function a(e,t){var n=e.length,r=n-t.length;return e.substring(0<=r?r:0,n)===t}(e,"AppleWebKit/605.1.15 (KHTML, like Gecko)"))||-1!==e.indexOf("Chrome/5")||-1!==e.indexOf("Chrome/6")||-1!==e.indexOf("UnrealEngine")&&-1===e.indexOf("Chrome")||-1!==e.indexOf("UCBrowser/12")||-1!==e.indexOf("UCBrowser/11"))},st.setCookie=function(e,t,n,r){if(st.canUseCookies(e)){var a="",i="";r&&(a=";domain="+r);var o=D();o&&"https:"===o.protocol&&(i=";secure",null===it&&(it=st.disallowsSameSiteNone((C()||{}).userAgent)),it||(n+=";SameSite=None")),st.document.cookie=t+"="+n+a+";path=/"+i}},st.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),e===undefined||null===e?t:"true"===e.toString().toLowerCase()},st.getCookie=function(e,t){if(st.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=st.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=st.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},st.deleteCookie=function(e,t){st.canUseCookies(e)&&(st.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},st.trim=function(e){return at(e)?e.replace(/^\s+|\s+$/g,""):e},st.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},st.random32=function(){return 4294967296*Math.random()|0},st.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=st.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var a=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+a+n.substr(16,3)+n.substr(19,12)},st.isArray=function(e){return"[object Array]"===Object[nt].toString.call(e)},st.isError=function(e){return"[object Error]"===Object[nt].toString.call(e)},st.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():rt?(rt.userAgent||"").toLowerCase():"";return-1!==t.indexOf("msie")?parseInt(t.split("msie")[1]):null},st.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},st.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},st.dump=function(e){var t=Object[nt].toString.call(e),n="";return"[object Error]"===t?n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'":S()&&(n=b().stringify(e)),t+n},st.getExceptionName=function(e){return"[object Error]"===Object[nt].toString.call(e)?e.name:""},st.addEventHandler=function(e,t){return X.Attach(y(),e,t)},st.IsBeaconApiSupported=function(){return"sendBeacon"in rt&&rt.sendBeacon},st.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},st.document=I()||{},st._canUseLocalStorage=undefined,st._canUseSessionStorage=undefined,st._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],st.NotSpecified="not_specified",st.isDate=F.isDate,st.toISOStringForIE8=F.toISOString,st);function st(){}var ut=(ct.parseUrl=function(e){return ct.htmlAnchorElement||(ct.htmlAnchorElement=ct.document.createElement?ct.document.createElement("a"):{host:ct.parseHost(e)}),ct.htmlAnchorElement.href=e,ct.htmlAnchorElement},ct.getAbsoluteUrl=function(e){var t,n=ct.parseUrl(e);return n&&(t=n.href),t},ct.getPathName=function(e){var t,n=ct.parseUrl(e);return n&&(t=n.pathname),t},ct.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ct.parseHost=function(e){if(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);if(null!=t&&2<t.length&&at(t[2])&&0<t[2].length)return t[2]}return null},ct.document=I()||{},ct);function ct(){}var lt=(dt.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=ut.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(F.arrForEach(i,function(e){var t=new RegExp(e.toLowerCase().replace(/\./g,".").replace(/\*/g,".*"));a=a||t.test(r)}),!a))return!1;var o=e&&e.correlationHeaderExcludedDomains;if(!o||0===o.length)return!0;for(var s=0;s<o.length;s++)if(new RegExp(o[s].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return r&&0<r.length},dt.getCorrelationContext=function(e){if(e){var t=dt.getCorrelationContextValue(e,Ye.requestContextTargetKey);if(t&&t!==dt.correlationIdPrefix)return t}},dt.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2===a.length&&a[0]===t)return a[1]}},dt.correlationIdPrefix="cid-v1:",dt);function dt(){}var ft=(pt.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=ut.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var u=0===s.pathname.length?"/":s.pathname;"/"!==u.charAt(0)&&(u="/"+u),o=s.pathname,i=et.sanitizeString(e,n?n+" "+u:u)}else i=et.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},pt);function pt(){}var gt=(ht.Now=function(){var e=function t(){return v("performance")}();return e&&e.now&&e.timing?e.now()+e.timing.navigationStart:(new Date).getTime()},ht.GetDuration=function(e,t){var n=null;return 0===e||0===t||F.isNullOrUndefined(e)||F.isNullOrUndefined(t)||(n=t-e),n},ht);function ht(){}var mt,vt="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",xt=(t(yt,mt=function En(){}),yt);function yt(){return mt.call(this)||this}var It;t(Ct,It=function kn(){this.ver=1,this.sampleRate=100,this.tags={}});function Ct(e,t,n){var r=It.call(this)||this;return r.name=et.sanitizeString(e,n)||ot.NotSpecified,r.data=t,r.time=F.toISOString(new Date),r.aiDataContract={time:g.Required,iKey:g.Required,name:g.Required,sampleRate:function(){return 100===r.sampleRate?g.Hidden:g.Required},tags:g.Required,data:g.Required},r}var Dt,St=function Un(){},bt=(t(_t,Dt=St),_t);function _t(){var e=Dt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Tt;t(Nt,Tt=bt),Nt.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Nt.dataType="EventData";function Nt(e,t,n,r){var a=Tt.call(this)||this;return a.aiDataContract={ver:g.Required,name:g.Required,properties:g.Default,measurements:g.Default},a.name=et.sanitizeString(e,t)||ot.NotSpecified,a.properties=et.sanitizeProperties(e,n),a.measurements=et.sanitizeMeasurements(e,r),a}var At,Mt=function Fn(){},wt=(t(Lt,At=St),Lt);function Lt(){var e=At.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}var Rt,jt=function On(){this.hasFullStack=!0,this.parsedStack=[]};t(qt,Rt=wt),qt.CreateFromInterface=function(t,e){var n=e.exceptions&&F.arrMap(e.exceptions,function(e){return Et.CreateFromInterface(t,e)});return new qt(t,s({},e,{exceptions:n}))},qt.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=(e.ver,e.problemGroup),o=e.id,s=e.isManual;return{ver:"4.0",exceptions:t instanceof Array&&F.arrMap(t,function(e){return e.toInterface()})||undefined,severityLevel:a,properties:n,measurements:r,problemGroup:i,id:o,isManual:s}},qt.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},qt.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",qt.dataType="ExceptionData";function qt(e,t,n,r,a,i){var o=Rt.call(this)||this;return o.aiDataContract={ver:g.Required,exceptions:g.Required,severityLevel:g.Default,properties:g.Default,measurements:g.Default},t instanceof Error?(o.exceptions=[new Et(e,t)],o.properties=et.sanitizeProperties(e,n),o.measurements=et.sanitizeMeasurements(e,r),a&&(o.severityLevel=a),i&&(o.id=i)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),o.ver=2,F.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Ht,Et=(t(kt,Ht=jt),kt.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&F.arrMap(this.parsedStack,function(e){return e.toInterface()});return{id:this.id,outerId:this.outerId,typeName:this.typeName,message:this.message,hasFullStack:this.hasFullStack,stack:this.stack,parsedStack:e||undefined}},kt.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&F.arrMap(t.parsedStack,function(e){return Ft.CreateFromInterface(e)})||t.parsedStack;return new kt(e,s({},t,{parsedStack:n}))},kt.parseStack=function(e){var t;if(F.isString(e)){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(Ft.regex.test(o)){var s=new Ft(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var u=0,c=t.length-1,l=0,d=u,f=c;u<c;){if(32768<(l+=t[u].sizeInBytes+t[c].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=u,f=c,u++,c--}}return t},kt);function kt(e,t){var n=Ht.call(this)||this;if(n.aiDataContract={id:g.Default,outerId:g.Default,typeName:g.Required,message:g.Required,hasFullStack:g.Default,stack:g.Default,parsedStack:g.Array},t instanceof Error){n.typeName=et.sanitizeString(e,t.name)||ot.NotSpecified,n.message=et.sanitizeMessage(e,t.message)||ot.NotSpecified;var r=t.stack;n.parsedStack=kt.parseStack(r),n.stack=et.sanitizeException(e,r),n.hasFullStack=ot.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var Ut,Ft=(t(Ot,Ut=Mt),Ot.CreateFromInterface=function(e){return new Ot(e,null)},Ot.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Ot.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Ot.baseSize=58,Ot);function Ot(e,t){var n=Ut.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:g.Required,method:g.Required,assembly:g.Default,fileName:g.Default,line:g.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=ot.trim(r),n.fileName="",n.line=0;var a=r.match(Ot.regex);a&&5<=a.length&&(n.method=ot.trim(a[2])||n.method,n.fileName=ot.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Ot.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var zt,Pt,Gt,Xt=(t(Wt,zt=St),Wt);function Wt(){var e=zt.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e.measurements={},e}(Gt=Pt=Pt||{})[Gt.Measurement=0]="Measurement",Gt[Gt.Aggregation=1]="Aggregation";var Bt,Kt=(t(Vt,Bt=function zn(){this.kind=Pt.Measurement}),Vt);function Vt(){var e=null!==Bt&&Bt.apply(this,arguments)||this;return e.aiDataContract={name:g.Required,kind:g.Default,value:g.Required,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default},e}var Qt;t(Jt,Qt=Xt),Jt.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Jt.dataType="MetricData";function Jt(e,t,n,r,a,i,o,s){var u=Qt.call(this)||this;u.aiDataContract={ver:g.Required,metrics:g.Required,properties:g.Default};var c=new Kt;return c.count=0<r?r:undefined,c.max=isNaN(i)||null===i?undefined:i,c.min=isNaN(a)||null===a?undefined:a,c.name=et.sanitizeString(e,t)||ot.NotSpecified,c.value=n,u.metrics=[c],u.properties=et.sanitizeProperties(e,o),u.measurements=et.sanitizeMeasurements(e,s),u}var $t,Yt=(t(Zt,$t=bt),Zt);function Zt(){var e=$t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var en;t(tn,en=Yt),tn.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",tn.dataType="PageviewData";function tn(e,t,n,r,a,i,o){var s=en.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,properties:g.Default,measurements:g.Default,id:g.Default},s.id=et.sanitizeId(e,o),s.url=et.sanitizeUrl(e,n),s.name=et.sanitizeString(e,t)||ot.NotSpecified,isNaN(r)||(s.duration=ot.msToTimeSpan(r)),s.properties=et.sanitizeProperties(e,a),s.measurements=et.sanitizeMeasurements(e,i),s}var nn,rn=(t(an,nn=St),an);function an(){var e=nn.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var on,sn=(t(un,on=rn),un.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",un.dataType="RemoteDependencyData",un);function un(e,t,n,r,a,i,o,s,u,c,l,d){void 0===u&&(u="Ajax");var f=on.call(this)||this;f.aiDataContract={id:g.Required,ver:g.Required,name:g.Default,resultCode:g.Default,duration:g.Default,success:g.Default,data:g.Default,target:g.Default,type:g.Default,properties:g.Default,measurements:g.Default,kind:g.Default,value:g.Default,count:g.Default,min:g.Default,max:g.Default,stdDev:g.Default,dependencyKind:g.Default,dependencySource:g.Default,commandName:g.Default,dependencyTypeName:g.Default},f.id=t,f.duration=ot.msToTimeSpan(a),f.success=i,f.resultCode=o+"",f.type=et.sanitizeString(e,u);var p=ft.ParseDependencyPath(e,n,s,r);return f.data=et.sanitizeUrl(e,r)||p.data,f.target=et.sanitizeString(e,p.target),c&&(f.target=f.target+" | "+c),f.name=et.sanitizeString(e,p.name),f.properties=et.sanitizeProperties(e,l),f.measurements=et.sanitizeMeasurements(e,d),f}var cn,ln=(t(dn,cn=St),dn);function dn(){var e=cn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var fn;t(pn,fn=ln),pn.envelopeType="Microsoft.ApplicationInsights.{0}.Message",pn.dataType="MessageData";function pn(e,t,n,r,a){var i=fn.call(this)||this;return i.aiDataContract={ver:g.Required,message:g.Required,severityLevel:g.Default,properties:g.Default},t=t||ot.NotSpecified,i.message=et.sanitizeMessage(e,t),i.properties=et.sanitizeProperties(e,r),i.measurements=et.sanitizeMeasurements(e,a),n&&(i.severityLevel=n),i}var gn,hn=(t(mn,gn=Yt),mn);function mn(){var e=gn.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var vn;t(xn,vn=hn),xn.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",xn.dataType="PageviewPerformanceData";function xn(e,t,n,r,a,i,o){var s=vn.call(this)||this;return s.aiDataContract={ver:g.Required,name:g.Default,url:g.Default,duration:g.Default,perfTotal:g.Default,networkConnect:g.Default,sentRequest:g.Default,receivedResponse:g.Default,domProcessing:g.Default,properties:g.Default,measurements:g.Default},s.url=et.sanitizeUrl(e,n),s.name=et.sanitizeString(e,t)||ot.NotSpecified,s.properties=et.sanitizeProperties(e,a),s.measurements=et.sanitizeMeasurements(e,i),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var yn,In,Cn;t(Dn,yn=xt);function Dn(e,t){var n=yn.call(this)||this;return n.aiDataContract={baseType:g.Required,baseData:g.Required},n.baseType=e,n.baseData=t,n}(Cn=In=In||{})[Cn.Verbose=0]="Verbose",Cn[Cn.Information=1]="Information",Cn[Cn.Warning=2]="Warning",Cn[Cn.Error=3]="Error",Cn[Cn.Critical=4]="Critical";var Sn=(bn.create=function(e,t,n,r,a,i){if(n=et.sanitizeString(r,n)||ot.NotSpecified,F.isNullOrUndefined(e)||F.isNullOrUndefined(t)||F.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:F.toISOString(new Date),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!F.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},bn);function bn(){}var _n=function Pn(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},Tn=(Nn.prototype.getAbsoluteUrl=function(){return this.requestUrl?ut.getAbsoluteUrl(this.requestUrl):null},Nn.prototype.getPathName=function(){return this.requestUrl?et.sanitizeUrl(this._logger,ut.getCompleteUrl(this.method,this.requestUrl)):null},Nn);function Nn(e,t,n){this.completed=!1,this.requestHeadersSize=null,this.requestHeaders=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new _n,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*gt.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var An=(Mn.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},Mn.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},Mn.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},Mn.DEFAULT_TRACE_FLAG="01",Mn.DEFAULT_VERSION="00",Mn);function Mn(e,t){this.traceFlag=Mn.DEFAULT_TRACE_FLAG,this.version=Mn.DEFAULT_VERSION,e&&Mn.isValidTraceId(e)?this.traceId=e:this.traceId=ot.generateW3CId(),t&&Mn.isValidSpanId(t)?this.spanId=t:this.spanId=ot.generateW3CId().substr(0,16)}var wn,Ln=F.isNullOrUndefined,Rn=(t(jn,wn=Ne),jn.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:l.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:undefined,appId:undefined,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1,enableAjaxErrorStatusText:!1}},jn.getEmptyConfig=function(){return{maxAjaxCallsPerView:undefined,disableAjaxTracking:undefined,disableFetchTracking:undefined,disableCorrelationHeaders:undefined,distributedTracingMode:undefined,correlationHeaderExcludedDomains:undefined,appId:undefined,enableCorsCorrelation:undefined,correlationHeaderDomains:undefined,enableRequestHeaderTracking:undefined,enableResponseHeaderTracking:undefined,enableAjaxErrorStatusText:undefined}},jn.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{Ln(e)||Ln(e.ajaxData)||Ln(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(n){}return t},jn.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},jn.prototype.processTelemetry=function(e,t){this.processNext(e,t)},jn.prototype.includeCorrelationHeaders=function(e,t,n,r){var a=this;if(t){if(lt.canIncludeCorrelationHeader(a._config,e.getAbsoluteUrl(),a.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),a._isUsingAIHeaders){var i="|"+e.traceID+"."+e.spanID;n.headers.set(Ye.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.requestIdHeader]=i)}if((s=a._config.appId||a._context&&a._context.appId())&&(n.headers.set(Ye.requestContextHeader,Ye.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.requestContextHeader]=Ye.requestContextAppIdFormat+s)),a._isUsingW3CHeaders){var o=new An(e.traceID,e.spanID);n.headers.set(Ye.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(e.requestHeaders[Ye.traceParentHeader]=o.toString())}return n}return n}if(r){var s;if(lt.canIncludeCorrelationHeader(a._config,r.ajaxData.getAbsoluteUrl(),a.currentWindowHost))a._isUsingAIHeaders&&(i="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(Ye.requestIdHeader,i),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.requestIdHeader]=i)),(s=a._config.appId||a._context&&a._context.appId())&&(r.setRequestHeader(Ye.requestContextHeader,Ye.requestContextAppIdFormat+s),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.requestContextHeader]=Ye.requestContextAppIdFormat+s)),a._isUsingW3CHeaders&&(o=new An(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(Ye.traceParentHeader,o.toString()),a._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[Ye.traceParentHeader]=o.toString()));return r}return undefined},jn.prototype.initialize=function(e,t,n,r){var a=this;wn.prototype.initialize.call(this,e,t,n,r);var i=a._getTelCtx();if(!a.initialized&&!a._fetchInitialized){var o=jn.getDefaultConfig();for(var s in o)a._config[s]=i.getConfig(jn.identifier,s,o[s]);if(a._isUsingAIHeaders=a._config.distributedTracingMode===l.AI||a._config.distributedTracingMode===l.AI_AND_W3C,a._isUsingW3CHeaders=a._config.distributedTracingMode===l.AI_AND_W3C||a._config.distributedTracingMode===l.W3C,!1===a._config.disableAjaxTracking&&a.instrumentXhr(),!1===a._config.disableFetchTracking&&a.instrumentFetch(),0<n.length&&n){for(var u=void 0,c=0;!u&&c<n.length;)n[c]&&"AppInsightsPropertiesPlugin"===n[c].identifier&&(u=n[c]),c++;u&&(a._context=u.context)}}},jn.prototype.trackDependencyDataInternal=function(e,t,n){var r=this;if(-1===r._config.maxAjaxCallsPerView||r._trackAjaxAttempts<r._config.maxAjaxCallsPerView){var a=Sn.create(e,sn.dataType,sn.envelopeType,r.diagLog(),t,n);r.core.track(a)}else r._trackAjaxAttempts===r._config.maxAjaxCallsPerView&&r.diagLog().throwInternal(z.CRITICAL,se,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++r._trackAjaxAttempts},jn.prototype.instrumentFetch=function(){var a=this;if(a.supportsFetch()&&!a._fetchInitialized){var e=m(),i=e.fetch,o=a;e.fetch=function(t,e){var n;if(o.isFetchInstrumented(t)&&o.isMonitoredInstance(undefined,undefined,t,e))try{n=o.createFetchRecord(t,e),e=o.includeCorrelationHeaders(n,t,e)}catch(r){o.diagLog().throwInternal(z.CRITICAL,ee,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:a.getFailedFetchDiagnosticsMessage(t),exception:ot.dump(r)})}return i(t,e).then(function(e){return o.onFetchComplete(e,n),e})["catch"](function(e){throw o.onFetchFailed(t,n,e),e})},a._fetchInitialized=!0}},jn.prototype.instrumentXhr=function(){var e=this;e.supportsAjaxMonitoring()&&!e.initialized&&(e.instrumentOpen(),e.instrumentSend(),e.instrumentAbort(),e.instrumentSetRequestHeader(),e.initialized=!0)},jn.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[vt]||!!r&&!0===r[vt]):void 0!==e&&(o=this.initialized,a=!0===e[vt],i=!0===t||!Ln(e.ajaxData)),o&&i&&!a},jn.prototype.supportsAjaxMonitoring=function(){var e=!0;return("undefined"==typeof XMLHttpRequest||Ln(XMLHttpRequest)||Ln(XMLHttpRequest.prototype)||Ln(XMLHttpRequest.prototype.open)||Ln(XMLHttpRequest.prototype.send)||Ln(XMLHttpRequest.prototype.abort))&&(e=!1),e},jn.prototype.instrumentOpen=function(){var i=XMLHttpRequest.prototype.open,o=this;XMLHttpRequest.prototype.open=function(e,t,n){var r=this;try{!o.isMonitoredInstance(r,!0)||r.ajaxData&&r.ajaxData.xhrMonitoringState.openDone||o.openHandler(r,e,t,n)}catch(a){o.diagLog().throwInternal(z.CRITICAL,ee,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(r),exception:ot.dump(a)})}return i.apply(r,arguments)}},jn.prototype.openHandler=function(e,t,n,r){var a=this,i=a._context&&a._context.telemetryTrace&&a._context.telemetryTrace.traceID||ot.generateW3CId(),o=ot.generateW3CId().substr(0,16),s=new Tn(i,o,a.diagLog());s.method=t,s.requestUrl=n,s.xhrMonitoringState.openDone=!0,s.requestHeaders={},e.ajaxData=s,a.attachToOnReadyStateChange(e)},jn.prototype.instrumentSend=function(){var r=XMLHttpRequest.prototype.send,a=this;XMLHttpRequest.prototype.send=function(e){var t=this;try{a.isMonitoredInstance(t)&&!t.ajaxData.xhrMonitoringState.sendDone&&a.sendHandler(t,e)}catch(n){a.diagLog().throwInternal(z.CRITICAL,ne,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(t),exception:ot.dump(n)})}return r.apply(t,arguments)}},jn.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=gt.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,undefined,undefined,e)).ajaxData.xhrMonitoringState.sendDone=!0},jn.prototype.instrumentAbort=function(){var n=XMLHttpRequest.prototype.abort,r=this;XMLHttpRequest.prototype.abort=function(){var e=this;try{r.isMonitoredInstance(e)&&!e.ajaxData.xhrMonitoringState.abortDone&&(e.ajaxData.aborted=1,e.ajaxData.xhrMonitoringState.abortDone=!0)}catch(t){r.diagLog().throwInternal(z.CRITICAL,Y,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),exception:ot.dump(t)})}return n.apply(e,arguments)}},jn.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var r=XMLHttpRequest.prototype.setRequestHeader,a=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{a.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(n){a.diagLog().throwInternal(z.CRITICAL,ge,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(this),exception:ot.dump(n)})}return r.apply(this,arguments)}}},jn.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=X.Attach(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(t){var e=ot.dump(t);e&&-1!==e.toLowerCase().indexOf("c00c023f")||r.diagLog().throwInternal(z.CRITICAL,te,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(n),exception:ot.dump(t)})}})},jn.prototype.onAjaxComplete=function(e){var t=this;if(e.ajaxData.responseFinishedTime=gt.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)t.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var n={id:"|"+e.ajaxData.traceID+"."+e.ajaxData.spanID,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},r=t.getAjaxCorrelationContext(e);if(r&&(n.correlationContext=r),t._config.enableRequestHeaderTracking&&0<F.objKeys(e.ajaxData.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders={},n.properties.requestHeaders=e.ajaxData.requestHeaders),t._config.enableResponseHeaderTracking){var a=e.getAllResponseHeaders();if(a){var i=a.trim().split(/[\r\n]+/),o={};F.arrForEach(i,function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");o[n]=r}),0<F.objKeys(o).length&&(n.properties=n.properties||{},n.properties.responseHeaders={},n.properties.responseHeaders=o)}}t._config.enableAjaxErrorStatusText&&400<=e.status&&(n.properties=n.properties||{},n.properties.responseText=e.statusText+" - "+e.responseText),t.trackDependencyDataInternal(n),e.ajaxData=null}},jn.prototype.getAjaxCorrelationContext=function(e){try{var t=e.getAllResponseHeaders();if(null!==t&&-1!==t.toLowerCase().indexOf(Ye.requestContextHeaderLowerCase)){var n=e.getResponseHeader(Ye.requestContextHeader);return lt.getCorrelationContext(n)}}catch(r){this.diagLog().throwInternal(z.WARNING,re,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:jn.getFailedAjaxDiagnosticsMessage(e),exception:ot.dump(r)})}},jn.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[vt]},jn.prototype.supportsFetch=function(){var e=!0,t=m();return(!t||Ln(t.Request)||Ln(t.Request.prototype)||Ln(t.fetch))&&(e=!1),e},jn.prototype.createFetchRecord=function(e,t){var n=this,r=n._context&&n._context.telemetryTrace&&n._context.telemetryTrace.traceID||ot.generateW3CId(),a=ot.generateW3CId().substr(0,16),i=new Tn(r,a,n.diagLog());return i.requestSentTime=gt.Now(),e instanceof Request?i.requestUrl=e?e.url:"":i.requestUrl=e,t&&t.method?i.method=t.method:e&&e instanceof Request?i.method=e.method:i.method="GET",t&&t.headers&&n._config.enableRequestHeaderTracking?i.requestHeaders=t.headers:i.requestHeaders={},i},jn.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{Ln(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(n){this.diagLog().throwInternal(z.CRITICAL,ee,"Failed to grab failed fetch diagnostics message",{exception:ot.dump(n)})}return t},jn.prototype.onFetchComplete=function(e,t){var n=this;if(t)try{if(t.responseFinishedTime=gt.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)n.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var r={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:200<=e.status&&e.status<400,responseCode:e.status,properties:{HttpMethod:t.method}},a=n.getFetchCorrelationContext(e);if(a&&(r.correlationContext=a),n._config.enableRequestHeaderTracking&&0<F.objKeys(t.requestHeaders).length&&(r.properties=r.properties||{},r.properties.requestHeaders=t.requestHeaders),n._config.enableResponseHeaderTracking){var i={};e.headers.forEach(function(e,t){i[t]=e}),0<F.objKeys(i).length&&(r.properties=r.properties||{},r.properties.responseHeaders=i)}n.trackDependencyDataInternal(r)}}catch(o){n.diagLog().throwInternal(z.WARNING,re,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:n.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(o)})}},jn.prototype.onFetchFailed=function(e,t,n){var r=this;if(t)try{if(t.responseFinishedTime=gt.Now(),t.CalculateMetrics(),t.ajaxTotalDuration<0)r.diagLog().throwInternal(z.WARNING,Z,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),requestSentTime:t.requestSentTime,responseFinishedTime:t.responseFinishedTime});else{var a={id:"|"+t.traceID+"."+t.spanID,target:t.getAbsoluteUrl(),name:t.getPathName(),type:"Fetch",duration:t.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:t.method}};r.trackDependencyDataInternal(a,{error:n.message})}}catch(i){r.diagLog().throwInternal(z.WARNING,re,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:r.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(i)})}},jn.prototype.getFetchCorrelationContext=function(e){try{var t=e.headers.get(Ye.requestContextHeader);return lt.getCorrelationContext(t)}catch(n){this.diagLog().throwInternal(z.WARNING,re,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(e),exception:ot.dump(n)})}},jn.identifier="AjaxDependencyPlugin",jn);function jn(){var e=wn.call(this)||this;e.identifier=jn.identifier,e.priority=120,e._config=jn.getEmptyConfig(),e._trackAjaxAttempts=0;var t=D();return e.currentWindowHost=t&&t.host&&t.host.toLowerCase(),e.initialized=!1,e._fetchInitialized=!1,e}e.AjaxPlugin=Rn,e.ajaxRecord=Tn,function(e,t,n){var r=Object.defineProperty;if(r)try{return r(e,t,n)}catch(a){}typeof n.value!==undefined&&(e[t]=n.value)}(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map
{
"name": "@microsoft/applicationinsights-dependencies-js",
"version": "2.4.0-beta",
"version": "2.4.0",
"description": "Microsoft Application Insights XHR dependencies plugin",

@@ -21,2 +21,3 @@ "main": "dist/applicationinsights-dependencies-js.js",

"devDependencies": {
"@microsoft/applicationinsights-rollup-es3" : "1.0.0",
"typescript": "2.5.3",

@@ -35,4 +36,4 @@ "grunt": "1.0.1",

"dependencies": {
"@microsoft/applicationinsights-core-js": "2.4.0-beta",
"@microsoft/applicationinsights-common": "2.4.0-beta",
"@microsoft/applicationinsights-core-js": "2.4.0",
"@microsoft/applicationinsights-common": "2.4.0",
"tslib": "^1.9.3"

@@ -39,0 +40,0 @@ },

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

IAppInsightsCore, BaseTelemetryPlugin, ITelemetryPluginChain, IConfiguration, IPlugin, ITelemetryItem, IProcessTelemetryContext,
getWindow
getLocation, getGlobal
} from '@microsoft/applicationinsights-core-js';

@@ -53,3 +53,4 @@ import { ajaxRecord } from './ajaxRecord';

enableRequestHeaderTracking: false,
enableResponseHeaderTracking: false
enableResponseHeaderTracking: false,
enableAjaxErrorStatusText: false
}

@@ -71,3 +72,4 @@ return config;

enableRequestHeaderTracking: undefined,
enableResponseHeaderTracking: undefined
enableResponseHeaderTracking: undefined,
enableAjaxErrorStatusText: undefined
}

@@ -93,6 +95,6 @@ }

protected _fetchInitialized: boolean; // fetch monitoring initialized
protected _config: ICorrelationConfig;
protected _config: ICorrelationConfig = AjaxMonitor.getEmptyConfig();
protected _trackAjaxAttempts: number = 0;
private currentWindowHost: string;
private _context: ITelemetryContext;
private _context?: ITelemetryContext;
private _isUsingW3CHeaders: boolean;

@@ -103,4 +105,4 @@ private _isUsingAIHeaders: boolean;

super();
let _window = getWindow();
this.currentWindowHost = _window && _window.location && _window.location.host && _window.location.host.toLowerCase();
let location = getLocation();
this.currentWindowHost = location && location.host && location.host.toLowerCase();
this.initialized = false;

@@ -136,3 +138,3 @@ this._fetchInitialized = false;

}
const appId: string = _self._config.appId || _self._context.appId();
const appId: string = _self._config.appId ||(_self._context && _self._context.appId());
if (appId) {

@@ -155,3 +157,3 @@ init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);

} else if (xhr) { // XHR
if (_self.currentWindowHost && CorrelationIdHelper.canIncludeCorrelationHeader(_self._config, xhr.ajaxData.getAbsoluteUrl(),
if (CorrelationIdHelper.canIncludeCorrelationHeader(_self._config, xhr.ajaxData.getAbsoluteUrl(),
_self.currentWindowHost)) {

@@ -165,3 +167,3 @@ if (_self._isUsingAIHeaders) {

}
const appId = _self._config.appId || _self._context.appId();
const appId = _self._config.appId || (_self._context && _self._context.appId());
if (appId) {

@@ -193,3 +195,2 @@ xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId);

const defaultConfig = AjaxMonitor.getDefaultConfig();
_self._config = AjaxMonitor.getEmptyConfig();
for (const field in defaultConfig) {

@@ -257,6 +258,8 @@ _self._config[field] = ctx.getConfig(AjaxMonitor.identifier, field, defaultConfig[field]);

}
let _window = getWindow();
const originalFetch: (input?: Request | string, init?: RequestInit) => Promise<Response> = _window.fetch;
// Getting the global instance tp support web workers (which don't have window)
let global = getGlobal();
const originalFetch: (input?: Request | string, init?: RequestInit) => Promise<Response> = global.fetch;
const fetchMonitorInstance: AjaxMonitor = _self;
_window.fetch = function fetch(input?: Request | string, init?: RequestInit): Promise<Response> {
global.fetch = function fetch(input?: Request | string, init?: RequestInit): Promise<Response> {
let fetchData: ajaxRecord;

@@ -550,3 +553,3 @@ if (fetchMonitorInstance.isFetchInstrumented(input) && fetchMonitorInstance.isMonitoredInstance(undefined, undefined, input, init)) {

if (_self._config.enableResponseHeaderTracking) {
if (_self._config.enableResponseHeaderTracking) {
const headers = xhr.getAllResponseHeaders();

@@ -571,3 +574,8 @@ if (headers) {

}
if (_self._config.enableAjaxErrorStatusText && xhr.status >= 400) {
dependency.properties = dependency.properties || {};
dependency.properties.responseText = xhr.statusText + " - " + xhr.responseText;
}
_self.trackDependencyDataInternal(dependency);

@@ -607,6 +615,6 @@

let result: boolean = true;
let _window = getWindow();
if (!_window || _isNullOrUndefined((_window as any).Request) ||
_isNullOrUndefined((_window as any).Request.prototype) ||
_isNullOrUndefined(_window.fetch)) {
let _global = getGlobal();
if (!_global || _isNullOrUndefined((_global as any).Request) ||
_isNullOrUndefined((_global as any).Request.prototype) ||
_isNullOrUndefined(_global.fetch)) {
result = false;

@@ -709,6 +717,6 @@ }

dependency.properties.requestHeaders = ajaxData.requestHeaders;
}
}
}
if (_self._config.enableResponseHeaderTracking) {
if (_self._config.enableResponseHeaderTracking) {
const responseHeaderMap = {};

@@ -715,0 +723,0 @@ response.headers.forEach((value, name) => {

@@ -25,3 +25,3 @@ import { ICorrelationConfig, IDependencyTelemetry, IConfig } from '@microsoft/applicationinsights-common';

private currentWindowHost;
private _context;
private _context?;
private _isUsingW3CHeaders;

@@ -28,0 +28,0 @@ private _isUsingAIHeaders;

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 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