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
595
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.2.0 to 2.2.1

4

browser/applicationinsights-dependencies-js.min.js
/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.2.0
* Application Insights JavaScript SDK - Dependencies Plugin, 2.2.1
* 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 a,t,h,n,s,r;(t=a=a||{})[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h=h||{})[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden",(r=s=s||{})[r.AI=0]="AI",r[r.AI_AND_W3C=1]="AI_AND_W3C",r[r.W3C=2]="W3C";var c=(i.isNullOrUndefined=function(e){return null==e},i.disableCookies=function(){i._canUseCookies=!1},i.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},i);function i(){}var o,u,l=/[xy]/g;(u=o=o||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,p=2,f=3,g=4,m=5,v=6,x=13,y=14,I=15,D=16,S=17,C=18,_=49,A=52,N=55,b=56,w=57,T=61,M=66,H=68,R=69,q=71;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error("Channel has invalid priority"+o);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];500<s.priority&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=500}var E=(U.requestContextHeader="Request-Context",U.requestContextTargetKey="appId",U.requestContextAppIdFormat="appId=cid-v1:",U.requestIdHeader="Request-Id",U.traceParentHeader="traceparent",U.sdkContextHeader="Sdk-Context",U.sdkContextHeaderAppIdRequest="appId",U.requestContextHeaderLowerCase="request-context",U);function U(){}var k=(L.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=L.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,L.MAX_NAME_LENGTH-3)+L.padNumber(i);a=o}return a},L.sanitizeKey=function(e,t){var n;return t&&(t=L.trim(t.toString())).length>L.MAX_NAME_LENGTH&&(n=t.substring(0,L.MAX_NAME_LENGTH),e.throwInternal(o.WARNING,w,"name is too long. It has been truncated to "+L.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},L.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=L.MAX_STRING_LENGTH),t&&(n=n||L.MAX_STRING_LENGTH,(t=L.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(o.WARNING,T,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},L.sanitizeUrl=function(e,t){return L.sanitizeInput(e,t,L.MAX_URL_LENGTH,M)},L.sanitizeMessage=function(e,t){var n;return t&&t.length>L.MAX_MESSAGE_LENGTH&&(n=t.substring(0,L.MAX_MESSAGE_LENGTH),e.throwInternal(o.WARNING,b,"message is too long, it has been truncated to "+L.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},L.sanitizeException=function(e,t){var n;return t&&t.length>L.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,L.MAX_EXCEPTION_LENGTH),e.throwInternal(o.WARNING,A,"exception is too long, it has been truncated to "+L.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},L.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(o.WARNING,_,"custom property is not valid",{exception:e},!0)}a=L.sanitizeString(t,a,L.MAX_PROPERTY_LENGTH),n[r=L.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},L.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=L.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},L.sanitizeId=function(e,t){return t?L.sanitizeInput(e,t,L.MAX_ID_LENGTH,R).toString():t},L.sanitizeInput=function(e,t,n,r){var a;return t&&(t=L.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(o.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},L.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},L.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},L.MAX_NAME_LENGTH=150,L.MAX_ID_LENGTH=128,L.MAX_PROPERTY_LENGTH=8192,L.MAX_STRING_LENGTH=1024,L.MAX_URL_LENGTH=2048,L.MAX_MESSAGE_LENGTH=32768,L.MAX_EXCEPTION_LENGTH=32768,L);function L(){}var F=(O.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},O.disableStorage=function(){O._canUseLocalStorage=!1,O._canUseSessionStorage=!1},O._getLocalStorageObject=function(){return O.canUseLocalStorage()?O._getVerifiedStorageObject(a.LocalStorage):null},O._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},O.isInternalApplicationInsightsEndpoint=function(e){return-1!==O._internalEndpoints.indexOf(e.toLowerCase())},O.canUseLocalStorage=function(){return void 0===O._canUseLocalStorage&&(O._canUseLocalStorage=!!O._getVerifiedStorageObject(a.LocalStorage)),O._canUseLocalStorage},O.getStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,d,"Browser failed read of local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setStorage=function(t,e,n){var r=O._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,f,"Browser failed write to local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,m,"Browser failed removal of local storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O._getSessionStorageObject=function(){return O.canUseSessionStorage()?O._getVerifiedStorageObject(a.SessionStorage):null},O.canUseSessionStorage=function(){return void 0===O._canUseSessionStorage&&(O._canUseSessionStorage=!!O._getVerifiedStorageObject(a.SessionStorage)),O._canUseSessionStorage},O.getSessionStorageKeys=function(){var e=[];if(O.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},O.getSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,p,"Browser failed read of session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setSessionStorage=function(t,e,n){var r=O._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,g,"Browser failed write to session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,v,"Browser failed removal of session storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.disableCookies=function(){c.disableCookies()},O.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==O.document.cookie}catch(e){t.throwInternal(o.WARNING,H,"Cannot access document.cookie - "+O.getExceptionName(e),{exception:O.dump(e)})}}return c._canUseCookies},O.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),O.document.location&&"https:"===O.document.location.protocol&&(i=";secure"),O.canUseCookies(e)&&(O.document.cookie=t+"="+n+a+";path=/"+i)},O.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},O.getCookie=function(e,t){if(O.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=O.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=O.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},O.deleteCookie=function(e,t){O.canUseCookies(e)&&(O.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},O.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},O.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},O.random32=function(){return 4294967296*Math.random()|0},O.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=O.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)},O.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},O.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},O.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},O.toISOStringForIE8=function(e){if(O.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},O.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},O.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},O.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},O.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},O.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},O.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},O.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},O.document="undefined"!=typeof document?document:{},O._canUseLocalStorage=void 0,O._canUseSessionStorage=void 0,O._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],O.NotSpecified="not_specified",O);function O(){}var z=(P.parseUrl=function(e){return P.htmlAnchorElement||(P.htmlAnchorElement=P.document.createElement?P.document.createElement("a"):{host:P.parseHost(e)}),P.htmlAnchorElement.href=e,P.htmlAnchorElement},P.getAbsoluteUrl=function(e){var t,n=P.parseUrl(e);return n&&(t=n.href),t},P.getPathName=function(e){var t,n=P.parseUrl(e);return n&&(t=n.pathname),t},P.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},P.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},P.document="undefined"!=typeof document?document:{},P);function P(){}var G=(W.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=z.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(i.forEach(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},W.getCorrelationContext=function(e){if(e){var t=W.getCorrelationContextValue(e,E.requestContextTargetKey);if(t&&t!==W.correlationIdPrefix)return t}},W.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]}},W.correlationIdPrefix="cid-v1:",W);function W(){}var X=(V.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=z.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=k.sanitizeString(e,n?n+" "+c:c)}else i=k.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},V);function V(){}var B=(K.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},K.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},K);function K(){}var Q="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",J=function(e,t){return(J=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 $(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,Z=function(){return(Z=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)},ee=($(te,Y=function(){}),te);function te(){return Y.call(this)||this}var ne;$(re,ne=function(){this.ver=1,this.sampleRate=100,this.tags={}});function re(e,t,n){var r=ne.call(this)||this;return r.name=k.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function ae(){}var ie,oe=($(se,ie=ae),se);function se(){var e=ie.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ce;$(ue,ce=oe),ue.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ue.dataType="EventData";function ue(e,t,n,r){var a=ce.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=k.sanitizeString(e,t)||F.NotSpecified,a.properties=k.sanitizeProperties(e,n),a.measurements=k.sanitizeMeasurements(e,r),a}function le(){}var de,pe=($(he,de=ae),he);function he(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function fe(){this.hasFullStack=!0,this.parsedStack=[]}var ge;$(me,ge=pe),me.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return xe.CreateFromInterface(t,e)});return new me(t,Z({},e,{exceptions:n}))},me.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},me.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},me.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",me.dataType="ExceptionData";function me(e,t,n,r,a,i){var o=ge.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new xe(e,t)],o.properties=k.sanitizeProperties(e,n),o.measurements=k.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),c.isNullOrUndefined(t.ver)||(o.ver=t.ver),c.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var ve,xe=($(ye,ve=fe),ye.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(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||void 0}},ye.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new ye(e,Z({},t,{parsedStack:n}))},ye.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=u,c++,u--}}return t},ye);function ye(e,t){var n=ve.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=k.sanitizeString(e,t.name)||F.NotSpecified,n.message=k.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=ye.parseStack(r),n.stack=k.sanitizeException(e,r),n.hasFullStack=F.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 Ie,De=($(Se,Ie=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=Ie.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.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+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ce,_e,Ae,Ne=($(be,Ce=ae),be);function be(){var e=Ce.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=_e=_e||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var we,Te=($(Me,we=function(){this.kind=_e.Measurement}),Me);function Me(){var e=null!==we&&we.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var He;$(Re,He=Ne),Re.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Re.dataType="MetricData";function Re(e,t,n,r,a,i,o){var s=He.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Te;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=k.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=k.sanitizeProperties(e,o),s}var qe,je=($(Ee,qe=oe),Ee);function Ee(){var e=qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ue;$(ke,Ue=je),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",ke.dataType="PageviewData";function ke(e,t,n,r,a,i,o){var s=Ue.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=k.sanitizeId(e,o),s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=k.sanitizeProperties(e,a),s.measurements=k.sanitizeMeasurements(e,i),s}var Le,Fe=($(Oe,Le=ae),Oe);function Oe(){var e=Le.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ze,Pe=($(Ge,ze=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,u,l){void 0===c&&(c="Ajax");var d=ze.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=k.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=k.sanitizeUrl(e,r)||p.data,d.target=k.sanitizeString(e,p.target),d.name=k.sanitizeString(e,p.name),d.properties=k.sanitizeProperties(e,u),d.measurements=k.sanitizeMeasurements(e,l),d}var We,Xe=($(Ve,We=ae),Ve);function Ve(){var e=We.call(this)||this;return e.ver=2,e.properties={},e}var Be;$(Ke,Be=Xe),Ke.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ke.dataType="MessageData";function Ke(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=k.sanitizeMessage(e,t),a.properties=k.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Qe,Je=($($e,Qe=je),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;$(Ze,Ye=Je),Ze.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Ze.dataType="PageviewPerformanceData";function Ze(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,s.properties=k.sanitizeProperties(e,a),s.measurements=k.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 et,tt,nt;$(rt,et=ee);function rt(e,t){var n=et.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(nt=tt=tt||{})[nt.Verbose=0]="Verbose",nt[nt.Information=1]="Information",nt[nt.Warning=2]="Warning",nt[nt.Error=3]="Error",nt[nt.Critical=4]="Critical";var at=(it.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},it);function it(){}var ot=(st.create=function(e,t,n,r,a,i){if(n=k.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},st);function st(){}var ct=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ut=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?z.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?k.sanitizeUrl(this._logger,z.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 ct,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var dt=(pt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},pt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},pt);function pt(){}var ht=(ft.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},ft.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},ft.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},ft.DEFAULT_TRACE_FLAG="00",ft.DEFAULT_VERSION="00",ft);function ft(e,t){this.traceFlag=ft.DEFAULT_TRACE_FLAG,this.version=ft.DEFAULT_VERSION,e&&ft.isValidTraceId(e)?this.traceId=e:this.traceId=F.generateW3CId(),t&&ft.isValidSpanId(t)?this.spanId=t:this.spanId=F.generateW3CId().substr(0,16)}var gt=(mt.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[Q]||!!r&&!0===r[Q]):void 0!==e&&(o=this.initialized,a=!0===e[Q],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},mt.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},mt.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},mt.prototype.openHandler=function(e,t,n,r){var a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),i=F.generateW3CId().substr(0,16),o=new ut(a,i,this._core.logger);o.method=t,o.requestUrl=n,o.xhrMonitoringState.openDone=!0,o.requestHeaders={},e.ajaxData=o,this.attachToOnReadyStateChange(e)},mt.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},mt.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(o.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},mt.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},mt.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(o.CRITICAL,x,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},mt.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var n=XMLHttpRequest.prototype.setRequestHeader,r=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{r.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(e){r._core.logger.throwInternal(o.CRITICAL,q,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return n.apply(this,arguments)}}},mt.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=dt.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(o.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},mt.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={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},n=this.getAjaxCorrelationContext(e);if(n&&(t.correlationContext=n),this._config.enableRequestHeaderTracking&&0<Object.keys(e.ajaxData.requestHeaders).length&&(t.properties=t.properties||{},t.properties.requestHeaders={},t.properties.requestHeaders=e.ajaxData.requestHeaders),this._config.enableResponseHeaderTracking){var r=e.getAllResponseHeaders();if(r){var a=r.trim().split(/[\r\n]+/),i={};a.forEach(function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");i[n]=r}),0<Object.keys(i).length&&(t.properties=t.properties||{},t.properties.responseHeaders={},t.properties.responseHeaders=i)}}this.trackDependencyDataInternal(t),e.ajaxData=null}},mt.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(E.requestContextHeaderLowerCase)){var n=t.getResponseHeader(E.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ot.create(e,Pe.dataType,Pe.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(o.CRITICAL,N,"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);++this._trackAjaxAttempts},mt.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},mt.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},mt.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},mt.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},mt.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[Q]},mt.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},mt.prototype.createFetchRecord=function(e,t){var n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),r=F.generateW3CId().substr(0,16),a=new ut(n,r,this._core.logger);return a.requestSentTime=B.Now(),e instanceof Request?a.requestUrl=e?e.url:"":a.requestUrl=e,t&&t.method?a.method=t.method:e&&e instanceof Request?a.method=e.method:a.method="GET",t&&t.headers&&this._config.enableRequestHeaderTracking?a.requestHeaders=t.headers:a.requestHeaders={},a},mt.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),this._isUsingAIHeaders){var a="|"+e.traceID+"."+e.spanID;n.headers.set(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestIdHeader]=a)}var i=this._config.appId||this._context.appId();if(i&&(n.headers.set(E.requestContextHeader,E.requestContextAppIdFormat+i),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+i)),this._isUsingW3CHeaders){var o=new ht(e.traceID,e.spanID);n.headers.set(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.traceParentHeader]=o.toString())}return n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){this._isUsingAIHeaders&&(a="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestIdHeader]=a));var s=this._config.appId||this._context.appId();s&&(r.setRequestHeader(E.requestContextHeader,E.requestContextAppIdFormat+s),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+s)),this._isUsingW3CHeaders&&(o=new ht(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.traceParentHeader]=o.toString()))}return r}},mt.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(o.CRITICAL,I,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},mt.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);if(r&&(n.correlationContext=r),this._config.enableRequestHeaderTracking&&0<Object.keys(e.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders=e.requestHeaders),this._config.enableResponseHeaderTracking){var a={};t.headers.forEach(function(e,t){a[t]=e}),0<Object.keys(a).length&&(n.properties=n.properties||{},n.properties.responseHeaders=a)}this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(E.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.instrumentSetRequestHeader(),this.initialized=!0)},mt.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:s.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},mt.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,distributedTracingMode:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0,correlationHeaderDomains:void 0,enableRequestHeaderTracking:void 0,enableResponseHeaderTracking:void 0}},mt.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=mt.getDefaultConfig();for(var a in this._config=mt.getEmptyConfig(),r)this._config[a]=at.getConfig(e,a,mt.identifier,r[a]);if(this._isUsingAIHeaders=this._config.distributedTracingMode===s.AI||this._config.distributedTracingMode===s.AI_AND_W3C,this._isUsingW3CHeaders=this._config.distributedTracingMode===s.AI_AND_W3C||this._config.distributedTracingMode===s.W3C,!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},mt.identifier="AjaxDependencyPlugin",mt);function mt(){this._trackAjaxAttempts=0,this.identifier=mt.identifier,this.priority=120,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=gt,e.ajaxRecord=ut,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 a,t,f,n,s,r;(t=a=a||{})[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=f=f||{})[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden",(r=s=s||{})[r.AI=0]="AI",r[r.AI_AND_W3C=1]="AI_AND_W3C",r[r.W3C=2]="W3C";var c=(i.isNullOrUndefined=function(e){return null==e},i.disableCookies=function(){i._canUseCookies=!1},i.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},i);function i(){}var o,u,l=/[xy]/g;(u=o=o||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,p=2,h=3,g=4,m=5,v=6,x=13,y=14,I=15,D=16,S=17,C=18,_=49,A=52,N=55,b=56,w=57,T=61,M=66,H=68,R=69,q=71;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error("Channel has invalid priority"+o);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,a)}),this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=500}var E=(U.requestContextHeader="Request-Context",U.requestContextTargetKey="appId",U.requestContextAppIdFormat="appId=cid-v1:",U.requestIdHeader="Request-Id",U.traceParentHeader="traceparent",U.sdkContextHeader="Sdk-Context",U.sdkContextHeaderAppIdRequest="appId",U.requestContextHeaderLowerCase="request-context",U);function U(){}var k=(L.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=L.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,L.MAX_NAME_LENGTH-3)+L.padNumber(i);a=o}return a},L.sanitizeKey=function(e,t){var n;return t&&(t=L.trim(t.toString())).length>L.MAX_NAME_LENGTH&&(n=t.substring(0,L.MAX_NAME_LENGTH),e.throwInternal(o.WARNING,w,"name is too long. It has been truncated to "+L.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},L.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=L.MAX_STRING_LENGTH),t&&(n=n||L.MAX_STRING_LENGTH,(t=L.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(o.WARNING,T,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},L.sanitizeUrl=function(e,t){return L.sanitizeInput(e,t,L.MAX_URL_LENGTH,M)},L.sanitizeMessage=function(e,t){var n;return t&&t.length>L.MAX_MESSAGE_LENGTH&&(n=t.substring(0,L.MAX_MESSAGE_LENGTH),e.throwInternal(o.WARNING,b,"message is too long, it has been truncated to "+L.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},L.sanitizeException=function(e,t){var n;return t&&t.length>L.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,L.MAX_EXCEPTION_LENGTH),e.throwInternal(o.WARNING,A,"exception is too long, it has been truncated to "+L.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},L.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(o.WARNING,_,"custom property is not valid",{exception:e},!0)}a=L.sanitizeString(t,a,L.MAX_PROPERTY_LENGTH),n[r=L.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},L.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=L.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},L.sanitizeId=function(e,t){return t?L.sanitizeInput(e,t,L.MAX_ID_LENGTH,R).toString():t},L.sanitizeInput=function(e,t,n,r){var a;return t&&(t=L.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(o.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},L.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},L.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},L.MAX_NAME_LENGTH=150,L.MAX_ID_LENGTH=128,L.MAX_PROPERTY_LENGTH=8192,L.MAX_STRING_LENGTH=1024,L.MAX_URL_LENGTH=2048,L.MAX_MESSAGE_LENGTH=32768,L.MAX_EXCEPTION_LENGTH=32768,L);function L(){}var F=(O.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},O.disableStorage=function(){O._canUseLocalStorage=!1,O._canUseSessionStorage=!1},O._getLocalStorageObject=function(){return O.canUseLocalStorage()?O._getVerifiedStorageObject(a.LocalStorage):null},O._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},O.isInternalApplicationInsightsEndpoint=function(e){return-1!==O._internalEndpoints.indexOf(e.toLowerCase())},O.canUseLocalStorage=function(){return void 0===O._canUseLocalStorage&&(O._canUseLocalStorage=!!O._getVerifiedStorageObject(a.LocalStorage)),O._canUseLocalStorage},O.getStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,d,"Browser failed read of local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setStorage=function(t,e,n){var r=O._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,h,"Browser failed write to local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,m,"Browser failed removal of local storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O._getSessionStorageObject=function(){return O.canUseSessionStorage()?O._getVerifiedStorageObject(a.SessionStorage):null},O.canUseSessionStorage=function(){return void 0===O._canUseSessionStorage&&(O._canUseSessionStorage=!!O._getVerifiedStorageObject(a.SessionStorage)),O._canUseSessionStorage},O.getSessionStorageKeys=function(){var e=[];if(O.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},O.getSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,p,"Browser failed read of session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setSessionStorage=function(t,e,n){var r=O._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,g,"Browser failed write to session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,v,"Browser failed removal of session storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.disableCookies=function(){c.disableCookies()},O.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==O.document.cookie}catch(e){t.throwInternal(o.WARNING,H,"Cannot access document.cookie - "+O.getExceptionName(e),{exception:O.dump(e)})}}return c._canUseCookies},O.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),O.document.location&&"https:"===O.document.location.protocol&&(i=";secure"),O.canUseCookies(e)&&(O.document.cookie=t+"="+n+a+";path=/"+i)},O.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},O.getCookie=function(e,t){if(O.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=O.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=O.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},O.deleteCookie=function(e,t){O.canUseCookies(e)&&(O.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},O.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},O.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},O.random32=function(){return 4294967296*Math.random()|0},O.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=O.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)},O.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},O.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},O.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},O.toISOStringForIE8=function(e){if(O.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},O.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},O.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},O.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},O.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},O.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},O.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},O.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},O.document="undefined"!=typeof document?document:{},O._canUseLocalStorage=void 0,O._canUseSessionStorage=void 0,O._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],O.NotSpecified="not_specified",O);function O(){}var z=(P.parseUrl=function(e){return P.htmlAnchorElement||(P.htmlAnchorElement=P.document.createElement?P.document.createElement("a"):{host:P.parseHost(e)}),P.htmlAnchorElement.href=e,P.htmlAnchorElement},P.getAbsoluteUrl=function(e){var t,n=P.parseUrl(e);return n&&(t=n.href),t},P.getPathName=function(e){var t,n=P.parseUrl(e);return n&&(t=n.pathname),t},P.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},P.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},P.document="undefined"!=typeof document?document:{},P);function P(){}var G=(W.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=z.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(i.forEach(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},W.getCorrelationContext=function(e){if(e){var t=W.getCorrelationContextValue(e,E.requestContextTargetKey);if(t&&t!==W.correlationIdPrefix)return t}},W.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]}},W.correlationIdPrefix="cid-v1:",W);function W(){}var X=(V.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=z.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=k.sanitizeString(e,n?n+" "+c:c)}else i=k.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},V);function V(){}var B=(K.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},K.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},K);function K(){}var Q="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",J=function(e,t){return(J=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 $(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,Z=function(){return(Z=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)},ee=($(te,Y=function(){}),te);function te(){return Y.call(this)||this}var ne;$(re,ne=function(){this.ver=1,this.sampleRate=100,this.tags={}});function re(e,t,n){var r=ne.call(this)||this;return r.name=k.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==r.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.Required},r}function ae(){}var ie,oe=($(se,ie=ae),se);function se(){var e=ie.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ce;$(ue,ce=oe),ue.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ue.dataType="EventData";function ue(e,t,n,r){var a=ce.call(this)||this;return a.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},a.name=k.sanitizeString(e,t)||F.NotSpecified,a.properties=k.sanitizeProperties(e,n),a.measurements=k.sanitizeMeasurements(e,r),a}function le(){}var de,pe=($(he,de=ae),he);function he(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function fe(){this.hasFullStack=!0,this.parsedStack=[]}var ge;$(me,ge=pe),me.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return xe.CreateFromInterface(t,e)});return new me(t,Z({},e,{exceptions:n}))},me.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},me.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},me.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",me.dataType="ExceptionData";function me(e,t,n,r,a,i){var o=ge.call(this)||this;return o.aiDataContract={ver:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.Default},t instanceof Error?(o.exceptions=[new xe(e,t)],o.properties=k.sanitizeProperties(e,n),o.measurements=k.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),c.isNullOrUndefined(t.ver)||(o.ver=t.ver),c.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var ve,xe=($(ye,ve=fe),ye.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(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||void 0}},ye.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new ye(e,Z({},t,{parsedStack:n}))},ye.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=u,c++,u--}}return t},ye);function ye(e,t){var n=ve.call(this)||this;if(n.aiDataContract={id:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.Array},t instanceof Error){n.typeName=k.sanitizeString(e,t.name)||F.NotSpecified,n.message=k.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=ye.parseStack(r),n.stack=k.sanitizeException(e,r),n.hasFullStack=F.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 Ie,De=($(Se,Ie=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=Ie.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.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+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ce,_e,Ae,Ne=($(be,Ce=ae),be);function be(){var e=Ce.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=_e=_e||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var we,Te=($(Me,we=function(){this.kind=_e.Measurement}),Me);function Me(){var e=null!==we&&we.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}var He;$(Re,He=Ne),Re.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Re.dataType="MetricData";function Re(e,t,n,r,a,i,o){var s=He.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Te;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=k.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=k.sanitizeProperties(e,o),s}var qe,je=($(Ee,qe=oe),Ee);function Ee(){var e=qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ue;$(ke,Ue=je),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",ke.dataType="PageviewData";function ke(e,t,n,r,a,i,o){var s=Ue.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.Default},s.id=k.sanitizeId(e,o),s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=k.sanitizeProperties(e,a),s.measurements=k.sanitizeMeasurements(e,i),s}var Le,Fe=($(Oe,Le=ae),Oe);function Oe(){var e=Le.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ze,Pe=($(Ge,ze=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,u,l,d){void 0===c&&(c="Ajax");var p=ze.call(this)||this;p.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.Default},p.id=t,p.duration=F.msToTimeSpan(a),p.success=i,p.resultCode=o+"",p.type=k.sanitizeString(e,c);var h=X.ParseDependencyPath(e,n,s,r);return p.data=k.sanitizeUrl(e,r)||h.data,p.target=k.sanitizeString(e,h.target),u&&(p.target=p.target+"| "+u),p.name=k.sanitizeString(e,h.name),p.properties=k.sanitizeProperties(e,l),p.measurements=k.sanitizeMeasurements(e,d),p}var We,Xe=($(Ve,We=ae),Ve);function Ve(){var e=We.call(this)||this;return e.ver=2,e.properties={},e}var Be;$(Ke,Be=Xe),Ke.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ke.dataType="MessageData";function Ke(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||F.NotSpecified,a.message=k.sanitizeMessage(e,t),a.properties=k.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Qe,Je=($($e,Qe=je),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;$(Ze,Ye=Je),Ze.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Ze.dataType="PageviewPerformanceData";function Ze(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,s.properties=k.sanitizeProperties(e,a),s.measurements=k.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 et,tt,nt;$(rt,et=ee);function rt(e,t){var n=et.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(nt=tt=tt||{})[nt.Verbose=0]="Verbose",nt[nt.Information=1]="Information",nt[nt.Warning=2]="Warning",nt[nt.Error=3]="Error",nt[nt.Critical=4]="Critical";var at=(it.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},it);function it(){}var ot=(st.create=function(e,t,n,r,a,i){if(n=k.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},st);function st(){}var ct=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ut=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?z.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?k.sanitizeUrl(this._logger,z.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 ct,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var dt=(pt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},pt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},pt);function pt(){}var ht=(ft.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},ft.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},ft.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},ft.DEFAULT_TRACE_FLAG="00",ft.DEFAULT_VERSION="00",ft);function ft(e,t){this.traceFlag=ft.DEFAULT_TRACE_FLAG,this.version=ft.DEFAULT_VERSION,e&&ft.isValidTraceId(e)?this.traceId=e:this.traceId=F.generateW3CId(),t&&ft.isValidSpanId(t)?this.spanId=t:this.spanId=F.generateW3CId().substr(0,16)}var gt=(mt.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[Q]||!!r&&!0===r[Q]):void 0!==e&&(o=this.initialized,a=!0===e[Q],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},mt.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},mt.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},mt.prototype.openHandler=function(e,t,n,r){var a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),i=F.generateW3CId().substr(0,16),o=new ut(a,i,this._core.logger);o.method=t,o.requestUrl=n,o.xhrMonitoringState.openDone=!0,o.requestHeaders={},e.ajaxData=o,this.attachToOnReadyStateChange(e)},mt.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},mt.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(o.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},mt.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},mt.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(o.CRITICAL,x,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},mt.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var n=XMLHttpRequest.prototype.setRequestHeader,r=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{r.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(e){r._core.logger.throwInternal(o.CRITICAL,q,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return n.apply(this,arguments)}}},mt.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=dt.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(o.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},mt.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={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},n=this.getAjaxCorrelationContext(e);if(n&&(t.correlationContext=n),this._config.enableRequestHeaderTracking&&0<Object.keys(e.ajaxData.requestHeaders).length&&(t.properties=t.properties||{},t.properties.requestHeaders={},t.properties.requestHeaders=e.ajaxData.requestHeaders),this._config.enableResponseHeaderTracking){var r=e.getAllResponseHeaders();if(r){var a=r.trim().split(/[\r\n]+/),i={};a.forEach(function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");i[n]=r}),0<Object.keys(i).length&&(t.properties=t.properties||{},t.properties.responseHeaders={},t.properties.responseHeaders=i)}}this.trackDependencyDataInternal(t),e.ajaxData=null}},mt.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(E.requestContextHeaderLowerCase)){var n=t.getResponseHeader(E.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ot.create(e,Pe.dataType,Pe.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(o.CRITICAL,N,"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);++this._trackAjaxAttempts},mt.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},mt.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},mt.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},mt.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},mt.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[Q]},mt.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},mt.prototype.createFetchRecord=function(e,t){var n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),r=F.generateW3CId().substr(0,16),a=new ut(n,r,this._core.logger);return a.requestSentTime=B.Now(),e instanceof Request?a.requestUrl=e?e.url:"":a.requestUrl=e,t&&t.method?a.method=t.method:e&&e instanceof Request?a.method=e.method:a.method="GET",t&&t.headers&&this._config.enableRequestHeaderTracking?a.requestHeaders=t.headers:a.requestHeaders={},a},mt.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),this._isUsingAIHeaders){var a="|"+e.traceID+"."+e.spanID;n.headers.set(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestIdHeader]=a)}var i=this._config.appId||this._context.appId();if(i&&(n.headers.set(E.requestContextHeader,E.requestContextAppIdFormat+i),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+i)),this._isUsingW3CHeaders){var o=new ht(e.traceID,e.spanID);n.headers.set(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.traceParentHeader]=o.toString())}return n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){this._isUsingAIHeaders&&(a="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestIdHeader]=a));var s=this._config.appId||this._context.appId();s&&(r.setRequestHeader(E.requestContextHeader,E.requestContextAppIdFormat+s),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+s)),this._isUsingW3CHeaders&&(o=new ht(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.traceParentHeader]=o.toString()))}return r}},mt.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(o.CRITICAL,I,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},mt.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);if(r&&(n.correlationContext=r),this._config.enableRequestHeaderTracking&&0<Object.keys(e.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders=e.requestHeaders),this._config.enableResponseHeaderTracking){var a={};t.headers.forEach(function(e,t){a[t]=e}),0<Object.keys(a).length&&(n.properties=n.properties||{},n.properties.responseHeaders=a)}this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(E.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.instrumentSetRequestHeader(),this.initialized=!0)},mt.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:s.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},mt.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,distributedTracingMode:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0,correlationHeaderDomains:void 0,enableRequestHeaderTracking:void 0,enableResponseHeaderTracking:void 0}},mt.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=mt.getDefaultConfig();for(var a in this._config=mt.getEmptyConfig(),r)this._config[a]=at.getConfig(e,a,mt.identifier,r[a]);if(this._isUsingAIHeaders=this._config.distributedTracingMode===s.AI||this._config.distributedTracingMode===s.AI_AND_W3C,this._isUsingW3CHeaders=this._config.distributedTracingMode===s.AI_AND_W3C||this._config.distributedTracingMode===s.W3C,!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},mt.identifier="AjaxDependencyPlugin",mt);function mt(){this._trackAjaxAttempts=0,this.identifier=mt.identifier,this.priority=120,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=gt,e.ajaxRecord=ut,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map
/*!
* Application Insights JavaScript SDK - Dependencies Plugin, 2.2.0
* Application Insights JavaScript SDK - Dependencies Plugin, 2.2.1
* 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 a,t,h,n,s,r;(t=a=a||{})[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h=h||{})[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden",(r=s=s||{})[r.AI=0]="AI",r[r.AI_AND_W3C=1]="AI_AND_W3C",r[r.W3C=2]="W3C";var c=(i.isNullOrUndefined=function(e){return null==e},i.disableCookies=function(){i._canUseCookies=!1},i.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},i);function i(){}var o,u,l=/[xy]/g;(u=o=o||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,p=2,f=3,g=4,m=5,v=6,x=13,y=14,I=15,D=16,S=17,C=18,_=49,A=52,N=55,b=56,w=57,T=61,M=66,H=68,R=69,q=71;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error("Channel has invalid priority"+o);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];500<s.priority&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=500}var E=(U.requestContextHeader="Request-Context",U.requestContextTargetKey="appId",U.requestContextAppIdFormat="appId=cid-v1:",U.requestIdHeader="Request-Id",U.traceParentHeader="traceparent",U.sdkContextHeader="Sdk-Context",U.sdkContextHeaderAppIdRequest="appId",U.requestContextHeaderLowerCase="request-context",U);function U(){}var k=(L.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=L.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,L.MAX_NAME_LENGTH-3)+L.padNumber(i);a=o}return a},L.sanitizeKey=function(e,t){var n;return t&&(t=L.trim(t.toString())).length>L.MAX_NAME_LENGTH&&(n=t.substring(0,L.MAX_NAME_LENGTH),e.throwInternal(o.WARNING,w,"name is too long. It has been truncated to "+L.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},L.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=L.MAX_STRING_LENGTH),t&&(n=n||L.MAX_STRING_LENGTH,(t=L.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(o.WARNING,T,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},L.sanitizeUrl=function(e,t){return L.sanitizeInput(e,t,L.MAX_URL_LENGTH,M)},L.sanitizeMessage=function(e,t){var n;return t&&t.length>L.MAX_MESSAGE_LENGTH&&(n=t.substring(0,L.MAX_MESSAGE_LENGTH),e.throwInternal(o.WARNING,b,"message is too long, it has been truncated to "+L.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},L.sanitizeException=function(e,t){var n;return t&&t.length>L.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,L.MAX_EXCEPTION_LENGTH),e.throwInternal(o.WARNING,A,"exception is too long, it has been truncated to "+L.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},L.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(o.WARNING,_,"custom property is not valid",{exception:e},!0)}a=L.sanitizeString(t,a,L.MAX_PROPERTY_LENGTH),n[r=L.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},L.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=L.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},L.sanitizeId=function(e,t){return t?L.sanitizeInput(e,t,L.MAX_ID_LENGTH,R).toString():t},L.sanitizeInput=function(e,t,n,r){var a;return t&&(t=L.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(o.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},L.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},L.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},L.MAX_NAME_LENGTH=150,L.MAX_ID_LENGTH=128,L.MAX_PROPERTY_LENGTH=8192,L.MAX_STRING_LENGTH=1024,L.MAX_URL_LENGTH=2048,L.MAX_MESSAGE_LENGTH=32768,L.MAX_EXCEPTION_LENGTH=32768,L);function L(){}var F=(O.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},O.disableStorage=function(){O._canUseLocalStorage=!1,O._canUseSessionStorage=!1},O._getLocalStorageObject=function(){return O.canUseLocalStorage()?O._getVerifiedStorageObject(a.LocalStorage):null},O._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},O.isInternalApplicationInsightsEndpoint=function(e){return-1!==O._internalEndpoints.indexOf(e.toLowerCase())},O.canUseLocalStorage=function(){return void 0===O._canUseLocalStorage&&(O._canUseLocalStorage=!!O._getVerifiedStorageObject(a.LocalStorage)),O._canUseLocalStorage},O.getStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,d,"Browser failed read of local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setStorage=function(t,e,n){var r=O._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,f,"Browser failed write to local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,m,"Browser failed removal of local storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O._getSessionStorageObject=function(){return O.canUseSessionStorage()?O._getVerifiedStorageObject(a.SessionStorage):null},O.canUseSessionStorage=function(){return void 0===O._canUseSessionStorage&&(O._canUseSessionStorage=!!O._getVerifiedStorageObject(a.SessionStorage)),O._canUseSessionStorage},O.getSessionStorageKeys=function(){var e=[];if(O.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},O.getSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,p,"Browser failed read of session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setSessionStorage=function(t,e,n){var r=O._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,g,"Browser failed write to session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,v,"Browser failed removal of session storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.disableCookies=function(){c.disableCookies()},O.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==O.document.cookie}catch(e){t.throwInternal(o.WARNING,H,"Cannot access document.cookie - "+O.getExceptionName(e),{exception:O.dump(e)})}}return c._canUseCookies},O.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),O.document.location&&"https:"===O.document.location.protocol&&(i=";secure"),O.canUseCookies(e)&&(O.document.cookie=t+"="+n+a+";path=/"+i)},O.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},O.getCookie=function(e,t){if(O.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=O.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=O.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},O.deleteCookie=function(e,t){O.canUseCookies(e)&&(O.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},O.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},O.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},O.random32=function(){return 4294967296*Math.random()|0},O.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=O.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)},O.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},O.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},O.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},O.toISOStringForIE8=function(e){if(O.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},O.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},O.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},O.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},O.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},O.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},O.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},O.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},O.document="undefined"!=typeof document?document:{},O._canUseLocalStorage=void 0,O._canUseSessionStorage=void 0,O._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],O.NotSpecified="not_specified",O);function O(){}var z=(P.parseUrl=function(e){return P.htmlAnchorElement||(P.htmlAnchorElement=P.document.createElement?P.document.createElement("a"):{host:P.parseHost(e)}),P.htmlAnchorElement.href=e,P.htmlAnchorElement},P.getAbsoluteUrl=function(e){var t,n=P.parseUrl(e);return n&&(t=n.href),t},P.getPathName=function(e){var t,n=P.parseUrl(e);return n&&(t=n.pathname),t},P.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},P.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},P.document="undefined"!=typeof document?document:{},P);function P(){}var G=(W.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=z.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(i.forEach(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},W.getCorrelationContext=function(e){if(e){var t=W.getCorrelationContextValue(e,E.requestContextTargetKey);if(t&&t!==W.correlationIdPrefix)return t}},W.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]}},W.correlationIdPrefix="cid-v1:",W);function W(){}var X=(V.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=z.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=k.sanitizeString(e,n?n+" "+c:c)}else i=k.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},V);function V(){}var B=(K.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},K.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},K);function K(){}var Q="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",J=function(e,t){return(J=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 $(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,Z=function(){return(Z=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)},ee=($(te,Y=function(){}),te);function te(){return Y.call(this)||this}var ne;$(re,ne=function(){this.ver=1,this.sampleRate=100,this.tags={}});function re(e,t,n){var r=ne.call(this)||this;return r.name=k.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function ae(){}var ie,oe=($(se,ie=ae),se);function se(){var e=ie.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ce;$(ue,ce=oe),ue.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ue.dataType="EventData";function ue(e,t,n,r){var a=ce.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=k.sanitizeString(e,t)||F.NotSpecified,a.properties=k.sanitizeProperties(e,n),a.measurements=k.sanitizeMeasurements(e,r),a}function le(){}var de,pe=($(he,de=ae),he);function he(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function fe(){this.hasFullStack=!0,this.parsedStack=[]}var ge;$(me,ge=pe),me.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return xe.CreateFromInterface(t,e)});return new me(t,Z({},e,{exceptions:n}))},me.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},me.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},me.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",me.dataType="ExceptionData";function me(e,t,n,r,a,i){var o=ge.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new xe(e,t)],o.properties=k.sanitizeProperties(e,n),o.measurements=k.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),c.isNullOrUndefined(t.ver)||(o.ver=t.ver),c.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var ve,xe=($(ye,ve=fe),ye.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(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||void 0}},ye.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new ye(e,Z({},t,{parsedStack:n}))},ye.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=u,c++,u--}}return t},ye);function ye(e,t){var n=ve.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=k.sanitizeString(e,t.name)||F.NotSpecified,n.message=k.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=ye.parseStack(r),n.stack=k.sanitizeException(e,r),n.hasFullStack=F.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 Ie,De=($(Se,Ie=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=Ie.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.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+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ce,_e,Ae,Ne=($(be,Ce=ae),be);function be(){var e=Ce.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=_e=_e||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var we,Te=($(Me,we=function(){this.kind=_e.Measurement}),Me);function Me(){var e=null!==we&&we.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var He;$(Re,He=Ne),Re.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Re.dataType="MetricData";function Re(e,t,n,r,a,i,o){var s=He.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Te;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=k.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=k.sanitizeProperties(e,o),s}var qe,je=($(Ee,qe=oe),Ee);function Ee(){var e=qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ue;$(ke,Ue=je),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",ke.dataType="PageviewData";function ke(e,t,n,r,a,i,o){var s=Ue.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=k.sanitizeId(e,o),s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=k.sanitizeProperties(e,a),s.measurements=k.sanitizeMeasurements(e,i),s}var Le,Fe=($(Oe,Le=ae),Oe);function Oe(){var e=Le.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ze,Pe=($(Ge,ze=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,u,l){void 0===c&&(c="Ajax");var d=ze.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=k.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=k.sanitizeUrl(e,r)||p.data,d.target=k.sanitizeString(e,p.target),d.name=k.sanitizeString(e,p.name),d.properties=k.sanitizeProperties(e,u),d.measurements=k.sanitizeMeasurements(e,l),d}var We,Xe=($(Ve,We=ae),Ve);function Ve(){var e=We.call(this)||this;return e.ver=2,e.properties={},e}var Be;$(Ke,Be=Xe),Ke.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ke.dataType="MessageData";function Ke(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=k.sanitizeMessage(e,t),a.properties=k.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Qe,Je=($($e,Qe=je),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;$(Ze,Ye=Je),Ze.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Ze.dataType="PageviewPerformanceData";function Ze(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,s.properties=k.sanitizeProperties(e,a),s.measurements=k.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 et,tt,nt;$(rt,et=ee);function rt(e,t){var n=et.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(nt=tt=tt||{})[nt.Verbose=0]="Verbose",nt[nt.Information=1]="Information",nt[nt.Warning=2]="Warning",nt[nt.Error=3]="Error",nt[nt.Critical=4]="Critical";var at=(it.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},it);function it(){}var ot=(st.create=function(e,t,n,r,a,i){if(n=k.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},st);function st(){}var ct=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ut=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?z.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?k.sanitizeUrl(this._logger,z.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 ct,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var dt=(pt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},pt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},pt);function pt(){}var ht=(ft.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},ft.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},ft.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},ft.DEFAULT_TRACE_FLAG="00",ft.DEFAULT_VERSION="00",ft);function ft(e,t){this.traceFlag=ft.DEFAULT_TRACE_FLAG,this.version=ft.DEFAULT_VERSION,e&&ft.isValidTraceId(e)?this.traceId=e:this.traceId=F.generateW3CId(),t&&ft.isValidSpanId(t)?this.spanId=t:this.spanId=F.generateW3CId().substr(0,16)}var gt=(mt.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[Q]||!!r&&!0===r[Q]):void 0!==e&&(o=this.initialized,a=!0===e[Q],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},mt.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},mt.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},mt.prototype.openHandler=function(e,t,n,r){var a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),i=F.generateW3CId().substr(0,16),o=new ut(a,i,this._core.logger);o.method=t,o.requestUrl=n,o.xhrMonitoringState.openDone=!0,o.requestHeaders={},e.ajaxData=o,this.attachToOnReadyStateChange(e)},mt.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},mt.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(o.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},mt.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},mt.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(o.CRITICAL,x,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},mt.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var n=XMLHttpRequest.prototype.setRequestHeader,r=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{r.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(e){r._core.logger.throwInternal(o.CRITICAL,q,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return n.apply(this,arguments)}}},mt.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=dt.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(o.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},mt.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={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},n=this.getAjaxCorrelationContext(e);if(n&&(t.correlationContext=n),this._config.enableRequestHeaderTracking&&0<Object.keys(e.ajaxData.requestHeaders).length&&(t.properties=t.properties||{},t.properties.requestHeaders={},t.properties.requestHeaders=e.ajaxData.requestHeaders),this._config.enableResponseHeaderTracking){var r=e.getAllResponseHeaders();if(r){var a=r.trim().split(/[\r\n]+/),i={};a.forEach(function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");i[n]=r}),0<Object.keys(i).length&&(t.properties=t.properties||{},t.properties.responseHeaders={},t.properties.responseHeaders=i)}}this.trackDependencyDataInternal(t),e.ajaxData=null}},mt.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(E.requestContextHeaderLowerCase)){var n=t.getResponseHeader(E.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ot.create(e,Pe.dataType,Pe.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(o.CRITICAL,N,"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);++this._trackAjaxAttempts},mt.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},mt.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},mt.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},mt.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},mt.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[Q]},mt.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},mt.prototype.createFetchRecord=function(e,t){var n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),r=F.generateW3CId().substr(0,16),a=new ut(n,r,this._core.logger);return a.requestSentTime=B.Now(),e instanceof Request?a.requestUrl=e?e.url:"":a.requestUrl=e,t&&t.method?a.method=t.method:e&&e instanceof Request?a.method=e.method:a.method="GET",t&&t.headers&&this._config.enableRequestHeaderTracking?a.requestHeaders=t.headers:a.requestHeaders={},a},mt.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),this._isUsingAIHeaders){var a="|"+e.traceID+"."+e.spanID;n.headers.set(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestIdHeader]=a)}var i=this._config.appId||this._context.appId();if(i&&(n.headers.set(E.requestContextHeader,E.requestContextAppIdFormat+i),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+i)),this._isUsingW3CHeaders){var o=new ht(e.traceID,e.spanID);n.headers.set(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.traceParentHeader]=o.toString())}return n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){this._isUsingAIHeaders&&(a="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestIdHeader]=a));var s=this._config.appId||this._context.appId();s&&(r.setRequestHeader(E.requestContextHeader,E.requestContextAppIdFormat+s),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+s)),this._isUsingW3CHeaders&&(o=new ht(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.traceParentHeader]=o.toString()))}return r}},mt.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(o.CRITICAL,I,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},mt.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);if(r&&(n.correlationContext=r),this._config.enableRequestHeaderTracking&&0<Object.keys(e.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders=e.requestHeaders),this._config.enableResponseHeaderTracking){var a={};t.headers.forEach(function(e,t){a[t]=e}),0<Object.keys(a).length&&(n.properties=n.properties||{},n.properties.responseHeaders=a)}this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(E.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.instrumentSetRequestHeader(),this.initialized=!0)},mt.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:s.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},mt.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,distributedTracingMode:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0,correlationHeaderDomains:void 0,enableRequestHeaderTracking:void 0,enableResponseHeaderTracking:void 0}},mt.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=mt.getDefaultConfig();for(var a in this._config=mt.getEmptyConfig(),r)this._config[a]=at.getConfig(e,a,mt.identifier,r[a]);if(this._isUsingAIHeaders=this._config.distributedTracingMode===s.AI||this._config.distributedTracingMode===s.AI_AND_W3C,this._isUsingW3CHeaders=this._config.distributedTracingMode===s.AI_AND_W3C||this._config.distributedTracingMode===s.W3C,!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},mt.identifier="AjaxDependencyPlugin",mt);function mt(){this._trackAjaxAttempts=0,this.identifier=mt.identifier,this.priority=120,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=gt,e.ajaxRecord=ut,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 a,t,f,n,s,r;(t=a=a||{})[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=f=f||{})[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden",(r=s=s||{})[r.AI=0]="AI",r[r.AI_AND_W3C=1]="AI_AND_W3C",r[r.W3C=2]="W3C";var c=(i.isNullOrUndefined=function(e){return null==e},i.disableCookies=function(){i._canUseCookies=!1},i.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(l,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},i);function i(){}var o,u,l=/[xy]/g;(u=o=o||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,p=2,h=3,g=4,m=5,v=6,x=13,y=14,I=15,D=16,S=17,C=18,_=49,A=52,N=55,b=56,w=57,T=61,M=66,H=68,R=69,q=71;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error("Channel has invalid priority"+o);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,a)}),this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=500}var E=(U.requestContextHeader="Request-Context",U.requestContextTargetKey="appId",U.requestContextAppIdFormat="appId=cid-v1:",U.requestIdHeader="Request-Id",U.traceParentHeader="traceparent",U.sdkContextHeader="Sdk-Context",U.sdkContextHeaderAppIdRequest="appId",U.requestContextHeaderLowerCase="request-context",U);function U(){}var k=(L.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=L.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,L.MAX_NAME_LENGTH-3)+L.padNumber(i);a=o}return a},L.sanitizeKey=function(e,t){var n;return t&&(t=L.trim(t.toString())).length>L.MAX_NAME_LENGTH&&(n=t.substring(0,L.MAX_NAME_LENGTH),e.throwInternal(o.WARNING,w,"name is too long. It has been truncated to "+L.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},L.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=L.MAX_STRING_LENGTH),t&&(n=n||L.MAX_STRING_LENGTH,(t=L.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(o.WARNING,T,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},L.sanitizeUrl=function(e,t){return L.sanitizeInput(e,t,L.MAX_URL_LENGTH,M)},L.sanitizeMessage=function(e,t){var n;return t&&t.length>L.MAX_MESSAGE_LENGTH&&(n=t.substring(0,L.MAX_MESSAGE_LENGTH),e.throwInternal(o.WARNING,b,"message is too long, it has been truncated to "+L.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},L.sanitizeException=function(e,t){var n;return t&&t.length>L.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,L.MAX_EXCEPTION_LENGTH),e.throwInternal(o.WARNING,A,"exception is too long, it has been truncated to "+L.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},L.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(o.WARNING,_,"custom property is not valid",{exception:e},!0)}a=L.sanitizeString(t,a,L.MAX_PROPERTY_LENGTH),n[r=L.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},L.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=L.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},L.sanitizeId=function(e,t){return t?L.sanitizeInput(e,t,L.MAX_ID_LENGTH,R).toString():t},L.sanitizeInput=function(e,t,n,r){var a;return t&&(t=L.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(o.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},L.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},L.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},L.MAX_NAME_LENGTH=150,L.MAX_ID_LENGTH=128,L.MAX_PROPERTY_LENGTH=8192,L.MAX_STRING_LENGTH=1024,L.MAX_URL_LENGTH=2048,L.MAX_MESSAGE_LENGTH=32768,L.MAX_EXCEPTION_LENGTH=32768,L);function L(){}var F=(O.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},O.disableStorage=function(){O._canUseLocalStorage=!1,O._canUseSessionStorage=!1},O._getLocalStorageObject=function(){return O.canUseLocalStorage()?O._getVerifiedStorageObject(a.LocalStorage):null},O._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},O.isInternalApplicationInsightsEndpoint=function(e){return-1!==O._internalEndpoints.indexOf(e.toLowerCase())},O.canUseLocalStorage=function(){return void 0===O._canUseLocalStorage&&(O._canUseLocalStorage=!!O._getVerifiedStorageObject(a.LocalStorage)),O._canUseLocalStorage},O.getStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,d,"Browser failed read of local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setStorage=function(t,e,n){var r=O._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,h,"Browser failed write to local storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeStorage=function(t,e){var n=O._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseLocalStorage=!1,t.throwInternal(o.WARNING,m,"Browser failed removal of local storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O._getSessionStorageObject=function(){return O.canUseSessionStorage()?O._getVerifiedStorageObject(a.SessionStorage):null},O.canUseSessionStorage=function(){return void 0===O._canUseSessionStorage&&(O._canUseSessionStorage=!!O._getVerifiedStorageObject(a.SessionStorage)),O._canUseSessionStorage},O.getSessionStorageKeys=function(){var e=[];if(O.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},O.getSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,p,"Browser failed read of session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return null},O.setSessionStorage=function(t,e,n){var r=O._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,g,"Browser failed write to session storage. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.removeSessionStorage=function(t,e){var n=O._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){O._canUseSessionStorage=!1,t.throwInternal(o.WARNING,v,"Browser failed removal of session storage item. "+O.getExceptionName(e),{exception:O.dump(e)})}return!1},O.disableCookies=function(){c.disableCookies()},O.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==O.document.cookie}catch(e){t.throwInternal(o.WARNING,H,"Cannot access document.cookie - "+O.getExceptionName(e),{exception:O.dump(e)})}}return c._canUseCookies},O.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),O.document.location&&"https:"===O.document.location.protocol&&(i=";secure"),O.canUseCookies(e)&&(O.document.cookie=t+"="+n+a+";path=/"+i)},O.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},O.getCookie=function(e,t){if(O.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=O.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=O.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},O.deleteCookie=function(e,t){O.canUseCookies(e)&&(O.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},O.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},O.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},O.random32=function(){return 4294967296*Math.random()|0},O.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=O.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)},O.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},O.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},O.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},O.toISOStringForIE8=function(e){if(O.isDate(e)){if(Date.prototype.toISOString)return e.toISOString();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.getIEVersion=function(e){void 0===e&&(e=null);var t=e?e.toLowerCase():navigator.userAgent.toLowerCase();return-1!=t.indexOf("msie")?parseInt(t.split("msie")[1]):null},O.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},O.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},O.dump=function(e){var t=Object.prototype.toString.call(e),n=JSON.stringify(e);return"[object Error]"===t&&(n="{ stack: '"+e.stack+"', message: '"+e.message+"', name: '"+e.name+"'"),t+n},O.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},O.addEventHandler=function(e,t){if("undefined"==typeof window||!window||"string"!=typeof e||"function"!=typeof t)return!1;var n="on"+e;if(window.addEventListener)window.addEventListener(e,t,!1);else{if(!window.attachEvent)return!1;window.attachEvent(n,t)}return!0},O.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},O.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},O.document="undefined"!=typeof document?document:{},O._canUseLocalStorage=void 0,O._canUseSessionStorage=void 0,O._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],O.NotSpecified="not_specified",O);function O(){}var z=(P.parseUrl=function(e){return P.htmlAnchorElement||(P.htmlAnchorElement=P.document.createElement?P.document.createElement("a"):{host:P.parseHost(e)}),P.htmlAnchorElement.href=e,P.htmlAnchorElement},P.getAbsoluteUrl=function(e){var t,n=P.parseUrl(e);return n&&(t=n.href),t},P.getPathName=function(e){var t,n=P.parseUrl(e);return n&&(t=n.pathname),t},P.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},P.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},P.document="undefined"!=typeof document?document:{},P);function P(){}var G=(W.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=z.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a,i=e&&e.correlationHeaderDomains;if(i&&(i.forEach(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},W.getCorrelationContext=function(e){if(e){var t=W.getCorrelationContextValue(e,E.requestContextTargetKey);if(t&&t!==W.correlationIdPrefix)return t}},W.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]}},W.correlationIdPrefix="cid-v1:",W);function W(){}var X=(V.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=z.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=k.sanitizeString(e,n?n+" "+c:c)}else i=k.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},V);function V(){}var B=(K.Now="undefined"==typeof window?function(){return(new Date).getTime()}:window.performance&&window.performance.now&&window.performance.timing?function(){return window.performance.now()+window.performance.timing.navigationStart}:function(){return(new Date).getTime()},K.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},K);function K(){}var Q="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",J=function(e,t){return(J=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 $(e,t){function n(){this.constructor=e}J(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,Z=function(){return(Z=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)},ee=($(te,Y=function(){}),te);function te(){return Y.call(this)||this}var ne;$(re,ne=function(){this.ver=1,this.sampleRate=100,this.tags={}});function re(e,t,n){var r=ne.call(this)||this;return r.name=k.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:f.Required,iKey:f.Required,name:f.Required,sampleRate:function(){return 100==r.sampleRate?f.Hidden:f.Required},tags:f.Required,data:f.Required},r}function ae(){}var ie,oe=($(se,ie=ae),se);function se(){var e=ie.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ce;$(ue,ce=oe),ue.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ue.dataType="EventData";function ue(e,t,n,r){var a=ce.call(this)||this;return a.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},a.name=k.sanitizeString(e,t)||F.NotSpecified,a.properties=k.sanitizeProperties(e,n),a.measurements=k.sanitizeMeasurements(e,r),a}function le(){}var de,pe=($(he,de=ae),he);function he(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function fe(){this.hasFullStack=!0,this.parsedStack=[]}var ge;$(me,ge=pe),me.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return xe.CreateFromInterface(t,e)});return new me(t,Z({},e,{exceptions:n}))},me.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel,i=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:i,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},me.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},me.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",me.dataType="ExceptionData";function me(e,t,n,r,a,i){var o=ge.call(this)||this;return o.aiDataContract={ver:f.Required,exceptions:f.Required,severityLevel:f.Default,properties:f.Default,measurements:f.Default},t instanceof Error?(o.exceptions=[new xe(e,t)],o.properties=k.sanitizeProperties(e,n),o.measurements=k.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),c.isNullOrUndefined(t.ver)||(o.ver=t.ver),c.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var ve,xe=($(ye,ve=fe),ye.prototype.toInterface=function(){var e=this.parsedStack instanceof Array&&this.parsedStack.map(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||void 0}},ye.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new ye(e,Z({},t,{parsedStack:n}))},ye.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,u=t.length-1,l=0,d=c,p=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=u,c++,u--}}return t},ye);function ye(e,t){var n=ve.call(this)||this;if(n.aiDataContract={id:f.Default,outerId:f.Default,typeName:f.Required,message:f.Required,hasFullStack:f.Default,stack:f.Default,parsedStack:f.Array},t instanceof Error){n.typeName=k.sanitizeString(e,t.name)||F.NotSpecified,n.message=k.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=ye.parseStack(r),n.stack=k.sanitizeException(e,r),n.hasFullStack=F.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 Ie,De=($(Se,Ie=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=Ie.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:f.Required,method:f.Required,assembly:f.Default,fileName:f.Default,line:f.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.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+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ce,_e,Ae,Ne=($(be,Ce=ae),be);function be(){var e=Ce.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=_e=_e||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var we,Te=($(Me,we=function(){this.kind=_e.Measurement}),Me);function Me(){var e=null!==we&&we.apply(this,arguments)||this;return e.aiDataContract={name:f.Required,kind:f.Default,value:f.Required,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default},e}var He;$(Re,He=Ne),Re.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Re.dataType="MetricData";function Re(e,t,n,r,a,i,o){var s=He.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Te;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=k.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=k.sanitizeProperties(e,o),s}var qe,je=($(Ee,qe=oe),Ee);function Ee(){var e=qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ue;$(ke,Ue=je),ke.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",ke.dataType="PageviewData";function ke(e,t,n,r,a,i,o){var s=Ue.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,properties:f.Default,measurements:f.Default,id:f.Default},s.id=k.sanitizeId(e,o),s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=k.sanitizeProperties(e,a),s.measurements=k.sanitizeMeasurements(e,i),s}var Le,Fe=($(Oe,Le=ae),Oe);function Oe(){var e=Le.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var ze,Pe=($(Ge,ze=Fe),Ge.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ge.dataType="RemoteDependencyData",Ge);function Ge(e,t,n,r,a,i,o,s,c,u,l,d){void 0===c&&(c="Ajax");var p=ze.call(this)||this;p.aiDataContract={id:f.Required,ver:f.Required,name:f.Default,resultCode:f.Default,duration:f.Default,success:f.Default,data:f.Default,target:f.Default,type:f.Default,properties:f.Default,measurements:f.Default,kind:f.Default,value:f.Default,count:f.Default,min:f.Default,max:f.Default,stdDev:f.Default,dependencyKind:f.Default,dependencySource:f.Default,commandName:f.Default,dependencyTypeName:f.Default},p.id=t,p.duration=F.msToTimeSpan(a),p.success=i,p.resultCode=o+"",p.type=k.sanitizeString(e,c);var h=X.ParseDependencyPath(e,n,s,r);return p.data=k.sanitizeUrl(e,r)||h.data,p.target=k.sanitizeString(e,h.target),u&&(p.target=p.target+"| "+u),p.name=k.sanitizeString(e,h.name),p.properties=k.sanitizeProperties(e,l),p.measurements=k.sanitizeMeasurements(e,d),p}var We,Xe=($(Ve,We=ae),Ve);function Ve(){var e=We.call(this)||this;return e.ver=2,e.properties={},e}var Be;$(Ke,Be=Xe),Ke.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ke.dataType="MessageData";function Ke(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||F.NotSpecified,a.message=k.sanitizeMessage(e,t),a.properties=k.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Qe,Je=($($e,Qe=je),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;$(Ze,Ye=Je),Ze.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",Ze.dataType="PageviewPerformanceData";function Ze(e,t,n,r,a,i,o){var s=Ye.call(this)||this;return s.aiDataContract={ver:f.Required,name:f.Default,url:f.Default,duration:f.Default,perfTotal:f.Default,networkConnect:f.Default,sentRequest:f.Default,receivedResponse:f.Default,domProcessing:f.Default,properties:f.Default,measurements:f.Default},s.url=k.sanitizeUrl(e,n),s.name=k.sanitizeString(e,t)||F.NotSpecified,s.properties=k.sanitizeProperties(e,a),s.measurements=k.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 et,tt,nt;$(rt,et=ee);function rt(e,t){var n=et.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(nt=tt=tt||{})[nt.Verbose=0]="Verbose",nt[nt.Information=1]="Information",nt[nt.Warning=2]="Warning",nt[nt.Error=3]="Error",nt[nt.Critical=4]="Critical";var at=(it.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},it);function it(){}var ot=(st.create=function(e,t,n,r,a,i){if(n=k.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},st);function st(){}var ct=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ut=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?z.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?k.sanitizeUrl(this._logger,z.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(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 ct,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.traceID=e,this.spanID=t,this._logger=n}var dt=(pt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},pt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},pt);function pt(){}var ht=(ft.isValidTraceId=function(e){return e.match(/^[0-9a-f]{32}$/)&&"00000000000000000000000000000000"!==e},ft.isValidSpanId=function(e){return e.match(/^[0-9a-f]{16}$/)&&"0000000000000000"!==e},ft.prototype.toString=function(){return this.version+"-"+this.traceId+"-"+this.spanId+"-"+this.traceFlag},ft.DEFAULT_TRACE_FLAG="00",ft.DEFAULT_VERSION="00",ft);function ft(e,t){this.traceFlag=ft.DEFAULT_TRACE_FLAG,this.version=ft.DEFAULT_VERSION,e&&ft.isValidTraceId(e)?this.traceId=e:this.traceId=F.generateW3CId(),t&&ft.isValidSpanId(t)?this.spanId=t:this.spanId=F.generateW3CId().substr(0,16)}var gt=(mt.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[Q]||!!r&&!0===r[Q]):void 0!==e&&(o=this.initialized,a=!0===e[Q],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},mt.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},mt.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},mt.prototype.openHandler=function(e,t,n,r){var a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),i=F.generateW3CId().substr(0,16),o=new ut(a,i,this._core.logger);o.method=t,o.requestUrl=n,o.xhrMonitoringState.openDone=!0,o.requestHeaders={},e.ajaxData=o,this.attachToOnReadyStateChange(e)},mt.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},mt.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(o.CRITICAL,S,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},mt.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},mt.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(o.CRITICAL,x,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},mt.prototype.instrumentSetRequestHeader=function(){if(this._config.enableRequestHeaderTracking){var n=XMLHttpRequest.prototype.setRequestHeader,r=this;XMLHttpRequest.prototype.setRequestHeader=function(e,t){try{r.isMonitoredInstance(this)&&(this.ajaxData.requestHeaders[e]=t)}catch(e){r._core.logger.throwInternal(o.CRITICAL,q,"Failed to monitor XMLHttpRequest.setRequestHeader, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return n.apply(this,arguments)}}},mt.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=dt.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(o.CRITICAL,D,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},mt.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={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},n=this.getAjaxCorrelationContext(e);if(n&&(t.correlationContext=n),this._config.enableRequestHeaderTracking&&0<Object.keys(e.ajaxData.requestHeaders).length&&(t.properties=t.properties||{},t.properties.requestHeaders={},t.properties.requestHeaders=e.ajaxData.requestHeaders),this._config.enableResponseHeaderTracking){var r=e.getAllResponseHeaders();if(r){var a=r.trim().split(/[\r\n]+/),i={};a.forEach(function(e){var t=e.split(": "),n=t.shift(),r=t.join(": ");i[n]=r}),0<Object.keys(i).length&&(t.properties=t.properties||{},t.properties.responseHeaders={},t.properties.responseHeaders=i)}}this.trackDependencyDataInternal(t),e.ajaxData=null}},mt.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(E.requestContextHeaderLowerCase)){var n=t.getResponseHeader(E.requestContextHeader);return G.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:mt.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ot.create(e,Pe.dataType,Pe.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(o.CRITICAL,N,"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);++this._trackAjaxAttempts},mt.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},mt.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},mt.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},mt.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(o.CRITICAL,I,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},mt.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[Q]},mt.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},mt.prototype.createFetchRecord=function(e,t){var n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID||F.generateW3CId(),r=F.generateW3CId().substr(0,16),a=new ut(n,r,this._core.logger);return a.requestSentTime=B.Now(),e instanceof Request?a.requestUrl=e?e.url:"":a.requestUrl=e,t&&t.method?a.method=t.method:e&&e instanceof Request?a.method=e.method:a.method="GET",t&&t.headers&&this._config.enableRequestHeaderTracking?a.requestHeaders=t.headers:a.requestHeaders={},a},mt.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(G.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){if((n=n||{}).headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),this._isUsingAIHeaders){var a="|"+e.traceID+"."+e.spanID;n.headers.set(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestIdHeader]=a)}var i=this._config.appId||this._context.appId();if(i&&(n.headers.set(E.requestContextHeader,E.requestContextAppIdFormat+i),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+i)),this._isUsingW3CHeaders){var o=new ht(e.traceID,e.spanID);n.headers.set(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(e.requestHeaders[E.traceParentHeader]=o.toString())}return n}return n}if(r){if(this.currentWindowHost&&G.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){this._isUsingAIHeaders&&(a="|"+r.ajaxData.traceID+"."+r.ajaxData.spanID,r.setRequestHeader(E.requestIdHeader,a),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestIdHeader]=a));var s=this._config.appId||this._context.appId();s&&(r.setRequestHeader(E.requestContextHeader,E.requestContextAppIdFormat+s),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.requestContextHeader]=E.requestContextAppIdFormat+s)),this._isUsingW3CHeaders&&(o=new ht(r.ajaxData.traceID,r.ajaxData.spanID),r.setRequestHeader(E.traceParentHeader,o.toString()),this._config.enableRequestHeaderTracking&&(r.ajaxData.requestHeaders[E.traceParentHeader]=o.toString()))}return r}},mt.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(o.CRITICAL,I,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},mt.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);if(r&&(n.correlationContext=r),this._config.enableRequestHeaderTracking&&0<Object.keys(e.requestHeaders).length&&(n.properties=n.properties||{},n.properties.requestHeaders=e.requestHeaders),this._config.enableResponseHeaderTracking){var a={};t.headers.forEach(function(e,t){a[t]=e}),0<Object.keys(a).length&&(n.properties=n.properties||{},n.properties.responseHeaders=a)}this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(o.WARNING,y,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:"|"+e.traceID+"."+e.spanID,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(E.requestContextHeader);return G.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(o.WARNING,C,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},mt.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.instrumentSetRequestHeader(),this.initialized=!0)},mt.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,distributedTracingMode:s.AI,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],correlationHeaderDomains:void 0,appId:void 0,enableCorsCorrelation:!1,enableRequestHeaderTracking:!1,enableResponseHeaderTracking:!1}},mt.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,distributedTracingMode:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0,correlationHeaderDomains:void 0,enableRequestHeaderTracking:void 0,enableResponseHeaderTracking:void 0}},mt.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=mt.getDefaultConfig();for(var a in this._config=mt.getEmptyConfig(),r)this._config[a]=at.getConfig(e,a,mt.identifier,r[a]);if(this._isUsingAIHeaders=this._config.distributedTracingMode===s.AI||this._config.distributedTracingMode===s.AI_AND_W3C,this._isUsingW3CHeaders=this._config.distributedTracingMode===s.AI_AND_W3C||this._config.distributedTracingMode===s.W3C,!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},mt.identifier="AjaxDependencyPlugin",mt);function mt(){this._trackAjaxAttempts=0,this.identifier=mt.identifier,this.priority=120,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=gt,e.ajaxRecord=ut,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map
{
"name": "@microsoft/applicationinsights-dependencies-js",
"version": "2.2.0",
"version": "2.2.1",
"description": "Microsoft Application Insights XHR dependencies plugin",

@@ -31,4 +31,4 @@ "main": "dist/applicationinsights-dependencies-js.js",

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

@@ -35,0 +35,0 @@ },

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