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

@microsoft/applicationinsights-analytics-js

Package Overview
Dependencies
Maintainers
5
Versions
601
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.1.1 to 2.2.0

4

browser/applicationinsights-analytics-js.min.js
/*!
* Application Insights JavaScript SDK - Web Analytics, 2.1.1
* Application Insights JavaScript SDK - Web Analytics, 2.2.0
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i||(i={}))[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f||(f={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g=(s.isNullOrUndefined=function(e){return null==e},s.disableCookies=function(){s._canUseCookies=!1},s.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)})},s);function s(){}var u,c,l=/[xy]/g;(c=u||(u={}))[c.CRITICAL=1]="CRITICAL",c[c.WARNING=2]="WARNING";var p=1,d=2,h=3,m=4,v=5,w=6,y=8,S=10,_=11,I=25,T=29,N=30,E=31,k=32,x=35,D=36,P=37,b=38,A=39,C=45,M=49,R=52,U=56,L=57,V=61,O=62,z=63,G=64,q=66,j=68,B=69;H.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(H.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),H.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[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,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function H(){this.identifier="ChannelControllerPlugin",this.priority=500}var X=(W.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=W.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,W.MAX_NAME_LENGTH-3)+W.padNumber(a);i=o}return i},W.sanitizeKey=function(e,t){var n;return t&&(t=W.trim(t.toString())).length>W.MAX_NAME_LENGTH&&(n=t.substring(0,W.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,L,"name is too long. It has been truncated to "+W.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},W.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=W.MAX_STRING_LENGTH),t&&(n=n||W.MAX_STRING_LENGTH,(t=W.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,V,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},W.sanitizeUrl=function(e,t){return W.sanitizeInput(e,t,W.MAX_URL_LENGTH,q)},W.sanitizeMessage=function(e,t){var n;return t&&t.length>W.MAX_MESSAGE_LENGTH&&(n=t.substring(0,W.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,U,"message is too long, it has been truncated to "+W.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},W.sanitizeException=function(e,t){var n;return t&&t.length>W.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,W.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,R,"exception is too long, it has been truncated to "+W.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},W.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(u.WARNING,M,"custom property is not valid",{exception:e},!0)}i=W.sanitizeString(t,i,W.MAX_PROPERTY_LENGTH),n[r=W.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},W.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=W.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},W.sanitizeId=function(e,t){return t?W.sanitizeInput(e,t,W.MAX_ID_LENGTH,B).toString():t},W.sanitizeInput=function(e,t,n,r){var i;return t&&(t=W.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(u.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},W.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},W.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},W.MAX_NAME_LENGTH=150,W.MAX_ID_LENGTH=128,W.MAX_PROPERTY_LENGTH=8192,W.MAX_STRING_LENGTH=1024,W.MAX_URL_LENGTH=2048,W.MAX_MESSAGE_LENGTH=32768,W.MAX_EXCEPTION_LENGTH=32768,W);function W(){}var K=(F.disableStorage=function(){F._canUseLocalStorage=!1,F._canUseSessionStorage=!1},F._getLocalStorageObject=function(){return F.canUseLocalStorage()?F._getVerifiedStorageObject(i.LocalStorage):null},F._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.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},F.isInternalApplicationInsightsEndpoint=function(e){return-1!==F._internalEndpoints.indexOf(e.toLowerCase())},F.canUseLocalStorage=function(){return void 0===F._canUseLocalStorage&&(F._canUseLocalStorage=!!F._getVerifiedStorageObject(i.LocalStorage)),F._canUseLocalStorage},F.getStorage=function(t,e){var n=F._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,p,"Browser failed read of local storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return null},F.setStorage=function(t,e,n){var r=F._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,h,"Browser failed write to local storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.removeStorage=function(t,e){var n=F._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,v,"Browser failed removal of local storage item. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F._getSessionStorageObject=function(){return F.canUseSessionStorage()?F._getVerifiedStorageObject(i.SessionStorage):null},F.canUseSessionStorage=function(){return void 0===F._canUseSessionStorage&&(F._canUseSessionStorage=!!F._getVerifiedStorageObject(i.SessionStorage)),F._canUseSessionStorage},F.getSessionStorageKeys=function(){var e=[];if(F.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},F.getSessionStorage=function(t,e){var n=F._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,d,"Browser failed read of session storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return null},F.setSessionStorage=function(t,e,n){var r=F._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed write to session storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.removeSessionStorage=function(t,e){var n=F._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,w,"Browser failed removal of session storage item. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.disableCookies=function(){g.disableCookies()},F.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==F.document.cookie}catch(e){t.throwInternal(u.WARNING,j,"Cannot access document.cookie - "+F.getExceptionName(e),{exception:F.dump(e)})}}return g._canUseCookies},F.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),F.document.location&&"https:"===F.document.location.protocol&&(a=";secure"),F.canUseCookies(e)&&(F.document.cookie=t+"="+n+i+";path=/"+a)},F.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},F.getCookie=function(e,t){if(F.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=F.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=F.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},F.deleteCookie=function(e,t){F.canUseCookies(e)&&(F.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},F.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},F.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},F.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},F.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},F.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},F.toISOStringForIE8=function(e){if(F.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"}},F.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},F.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,i=""+Math.floor(e/36e5)%24,a=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<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},F.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},F.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},F.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},F.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},F.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},F.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},F.document="undefined"!=typeof document?document:{},F._canUseLocalStorage=void 0,F._canUseSessionStorage=void 0,F._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],F.NotSpecified="not_specified",F);function F(){}var J=(Q.parseUrl=function(e){return Q.htmlAnchorElement||(Q.htmlAnchorElement=Q.document.createElement?Q.document.createElement("a"):{host:Q.parseHost(e)}),Q.htmlAnchorElement.href=e,Q.htmlAnchorElement},Q.getAbsoluteUrl=function(e){var t,n=Q.parseUrl(e);return n&&(t=n.href),t},Q.getPathName=function(e){var t,n=Q.parseUrl(e);return n&&(t=n.pathname),t},Q.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},Q.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},Q.document="undefined"!=typeof document?document:{},Q);function Q(){}var Y=($.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=J.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=X.sanitizeString(e,n?n+" "+c:c)}else a=X.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},$);function $(){}var Z=(ee.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()},ee.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},ee);function ee(){}var te,ne=(t(re,te=function(){}),re);function re(){return te.call(this)||this}var ie;t(ae,ie=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ae(e,t,n){var r=ie.call(this)||this;return r.name=X.sanitizeString(e,n)||K.NotSpecified,r.data=t,r.time=K.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 oe(){}var se,ce=(t(le,se=oe),le);function le(){var e=se.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ue,pe=(t(ge,ue=ce),ge.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ge.dataType="EventData",ge);function ge(e,t,n,r){var i=ue.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=X.sanitizeString(e,t)||K.NotSpecified,i.properties=X.sanitizeProperties(e,n),i.measurements=X.sanitizeMeasurements(e,r),i}function fe(){}var de,he=(t(me,de=oe),me);function me(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function ve(){this.hasFullStack=!0,this.parsedStack=[]}var we,ye=(t(Se,we=he),Se.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ie.CreateFromInterface(t,e)});return new Se(t,o({},e,{exceptions:n}))},Se.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},Se.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Se.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Se.dataType="ExceptionData",Se);function Se(e,t,n,r,i,a){var o=we.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 Ie(e,t)],o.properties=X.sanitizeProperties(e,n),o.measurements=X.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(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),g.isNullOrUndefined(t.ver)||(o.ver=t.ver),g.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var _e,Ie=(t(Te,_e=ve),Te.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}},Te.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ee.CreateFromInterface(e)})||t.parsedStack;return new Te(e,o({},t,{parsedStack:n}))},Te.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Ee.regex.test(o)){var s=new Ee(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,p=c,g=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var f=g-p+1;t.splice(p,f);break}p=c,g=l,c++,l--}}return t},Te);function Te(e,t){var n=_e.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=X.sanitizeString(e,t.name)||K.NotSpecified,n.message=X.sanitizeMessage(e,t.message)||K.NotSpecified;var r=t.stack;n.parsedStack=Te.parseStack(r),n.stack=X.sanitizeException(e,r),n.hasFullStack=K.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 Ne,Ee=(t(ke,Ne=fe),ke.CreateFromInterface=function(e){return new ke(e,null)},ke.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},ke.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,ke.baseSize=58,ke);function ke(e,t){var n=Ne.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=K.trim(r),n.fileName="",n.line=0;var i=r.match(ke.regex);i&&5<=i.length&&(n.method=K.trim(i[2])||n.method,n.fileName=K.trim(i[4]),n.line=parseInt(i[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+=ke.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var xe,De,Pe,be=(t(Ae,xe=oe),Ae);function Ae(){var e=xe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Pe=De||(De={}))[Pe.Measurement=0]="Measurement",Pe[Pe.Aggregation=1]="Aggregation";var Ce,Me=(t(Re,Ce=function(){this.kind=De.Measurement}),Re);function Re(){var e=null!==Ce&&Ce.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 Ue,Le=(t(Ve,Ue=be),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Ve.dataType="MetricData",Ve);function Ve(e,t,n,r,i,a,o){var s=Ue.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=X.sanitizeString(e,t)||K.NotSpecified,c.value=n,s.metrics=[c],s.properties=X.sanitizeProperties(e,o),s}var Oe,ze=(t(Ge,Oe=ce),Ge);function Ge(){var e=Oe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe,je=(t(Be,qe=ze),Be.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Be.dataType="PageviewData",Be);function Be(e,t,n,r,i,a,o){var s=qe.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=X.sanitizeId(e,o),s.url=X.sanitizeUrl(e,n),s.name=X.sanitizeString(e,t)||K.NotSpecified,isNaN(r)||(s.duration=K.msToTimeSpan(r)),s.properties=X.sanitizeProperties(e,i),s.measurements=X.sanitizeMeasurements(e,a),s}var He,Xe=(t(We,He=oe),We);function We(){var e=He.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Ke,Fe=(t(Je,Ke=Xe),Je.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Je.dataType="RemoteDependencyData",Je);function Je(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var p=Ke.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=K.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=X.sanitizeString(e,c);var g=Y.ParseDependencyPath(e,n,s,r);return p.data=X.sanitizeUrl(e,r)||g.data,p.target=X.sanitizeString(e,g.target),p.name=X.sanitizeString(e,g.name),p.properties=X.sanitizeProperties(e,l),p.measurements=X.sanitizeMeasurements(e,u),p}var Qe,Ye=(t($e,Qe=oe),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e}var Ze,et=(t(tt,Ze=Ye),tt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",tt.dataType="MessageData",tt);function tt(e,t,n,r){var i=Ze.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||K.NotSpecified,i.message=X.sanitizeMessage(e,t),i.properties=X.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var nt,rt=(t(it,nt=ze),it);function it(){var e=nt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var at,ot=(t(st,at=rt),st.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",st.dataType="PageviewPerformanceData",st);function st(e,t,n,r,i,a,o){var s=at.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=X.sanitizeUrl(e,n),s.name=X.sanitizeString(e,t)||K.NotSpecified,s.properties=X.sanitizeProperties(e,i),s.measurements=X.sanitizeMeasurements(e,a),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 ct,lt,ut;t(pt,ct=ne);function pt(e,t){var n=ct.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(ut=lt||(lt={}))[ut.Verbose=0]="Verbose",ut[ut.Information=1]="Information",ut[ut.Warning=2]="Warning",ut[ut.Error=3]="Error",ut[ut.Critical=4]="Critical";var gt=(ft.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},ft);function ft(){}var dt=(ht.create=function(e,t,n,r,i,a){if(n=X.sanitizeString(r,n)||K.NotSpecified,g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||g.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!g.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},ht);function ht(){}var mt=(vt.prototype.trackPageView=function(t,n){var r=this,i=t.name;!g.isNullOrUndefined(i)&&"string"==typeof i||(t.name=window.document&&window.document.title||"");var a=t.uri;if(!g.isNullOrUndefined(a)&&"string"==typeof a||(t.uri=window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(u.WARNING,I,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var o=!1,s=void 0,c=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=Z.GetDuration(c,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=void 0);var e=void 0;g.isNullOrUndefined(n)||g.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),o=!0),n||(n={});var l=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(l);var e={name:i,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||o?(o||(n.duration=e.durationMs,r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<Z.GetDuration(c,+new Date)&&(clearInterval(l),o||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(u.CRITICAL,b,"trackPageView failed on page load calculation: "+K.getExceptionName(e),{exception:K.dump(e)})}},100)},vt);function vt(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var wt=(yt.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(e){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+K.dump(e))}},yt.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(e){return this._logger.warnToConsole("Call to restart failed: "+K.dump(e)),null}},yt.prototype.startPageVisitTimer=function(e,t){try{if(K.canUseSessionStorage()){if(null!=K.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new St(e,t),r=JSON.stringify(n);K.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+K.dump(e))}},yt.prototype.stopPageVisitTimer=function(){try{if(K.canUseSessionStorage()){var e=Date.now(),t=K.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,K.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+K.dump(e)),null}},yt);function yt(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var St=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},_t=(It.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=Z.GetDuration(t.navigationStart,t.loadEventEnd),r=Z.GetDuration(t.navigationStart,t.connectEnd),i=Z.GetDuration(t.requestStart,t.responseStart),a=Z.GetDuration(t.responseStart,t.responseEnd),o=Z.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,S,"error calculating page view performance.",{total:n,network:r,request:i,response:a,dom:o}):this.shouldCollectDuration(n,r,i,a,o)?n<Math.floor(r)+Math.floor(i)+Math.floor(a)+Math.floor(o)?this._logger.throwInternal(u.WARNING,y,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=K.msToTimeSpan(n),e.networkConnect=K.msToTimeSpan(r),e.sentRequest=K.msToTimeSpan(i),e.receivedResponse=K.msToTimeSpan(a),e.domProcessing=K.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,C,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},It.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},It.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},It.prototype.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},It.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=navigator.userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},It);function It(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Tt="duration",Nt=(Et.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=K.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=K.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=K.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=K.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=K.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=K.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=K.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},Et.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i)try{if(!1===i.apply(null,[e])){t=!0;break}}catch(e){this._logger.throwInternal(u.CRITICAL,G,"One of telemetry initializers failed, telemetry item will not be sent: "+K.getExceptionName(e),{exception:K.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},Et.prototype.setNextPlugin=function(e){this._nextPlugin=e},Et.prototype.trackEvent=function(e,t){try{var n=dt.create(e,pe.dataType,pe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,A,"trackTrace failed, trace will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,T,"startTrackEvent failed, event will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,N,"stopTrackEvent failed, event will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackTrace=function(e,t){try{var n=dt.create(e,et.dataType,et.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,A,"trackTrace failed, trace will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackMetric=function(e,t){try{var n=dt.create(e,Le.dataType,Le.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,D,"trackMetric failed, metric will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,o({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackPageView failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=void 0===e.refUri?document.referrer:e.refUri);var r=dt.create(e,je.dataType,je.envelopeType,this._logger,t,n);this.core.track(r),this._trackAjaxAttempts=0},Et.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=dt.create(e,ot.dataType,ot.envelopeType,this._logger,t,n);this.core.track(r)},Et.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackPageViewPerformance failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"startTrackPage failed, page view may not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.stopTrackPage=function(e,t,n,r){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,k,"stopTrackPage failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.sendExceptionInternal=function(e,t,n){var r=new ye(this._logger,e.exception||new Error(K.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=dt.create(r,ye.dataType,ye.envelopeType,this._logger,t,n);this.core.track(i)},Et.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,x,"trackException failed, exception will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(K.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!K.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({exception:t.error,severityLevel:lt.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,_,"_onError threw exception while logging error, error will not be collected: "+K.getExceptionName(e),{exception:K.dump(e),errorString:r})}},Et.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Et.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(g.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var r=Et.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=gt.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&K.disableCookies(),this.config.isStorageUseDisabled&&K.disableStorage();var a={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new _t(this.core),this._pageViewManager=new mt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new wt(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new kt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Tt]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new kt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Tt]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var u=window.onerror;window.onerror=function(e,t,n,r,i){var a=u&&u(e,t,n,r,i);return!0!==a&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window){var p=this;n.forEach(function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(new Event(p.config.namePrefix+"pushState")),window.dispatchEvent(new Event(p.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(new Event(p.config.namePrefix+"replaceState")),window.dispatchEvent(new Event(p.config.namePrefix+"locationchange")),e}),window.addEventListener(p.config.namePrefix+"popstate",function(){window.dispatchEvent(new Event(p.config.namePrefix+"locationchange"))}),window.addEventListener(p.config.namePrefix+"locationchange",function(){p._properties&&p._properties.context&&p._properties.context.telemetryTrace&&(p._properties.context.telemetryTrace.traceID=K.newId(),p._properties.context.telemetryTrace.name=window.location.pathname),setTimeout(function(){p.trackPageView({refUri:null,properties:{duration:0}})},p.autoRoutePVDelay)})}this._isInitialized=!0}},Et.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},Et.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===Fe.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},Et.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Et.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:void 0},n=dt.create(t,ye.dataType,ye.envelopeType,this._logger,{url:e});this.core.track(n)},Et.Version="2.1.1",Et);function Et(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}var kt=(xt.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,O,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},xt.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,z,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=Z.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},xt);function xt(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=Nt,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,o,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f=f||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var g=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(d,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var u,p,d=/[xy]/g;(p=u=u||{})[p.CRITICAL=1]="CRITICAL",p[p.WARNING=2]="WARNING";var h=1,m=2,v=3,w=4,y=5,S=6,_=8,I=10,T=11,N=25,E=29,D=30,k=31,x=32,P=35,b=36,A=37,C=38,M=39,R=45,U=49,L=52,V=56,O=57,z=61,G=62,q=63,j=64,B=66,W=68,H=69;X.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(X.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),X.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.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,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[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,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function X(){this.identifier="ChannelControllerPlugin",this.priority=500}var K=(F.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=F.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,F.MAX_NAME_LENGTH-3)+F.padNumber(a);i=o}return i},F.sanitizeKey=function(e,t){var n;return t&&(t=F.trim(t.toString())).length>F.MAX_NAME_LENGTH&&(n=t.substring(0,F.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,O,"name is too long. It has been truncated to "+F.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},F.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=F.MAX_STRING_LENGTH),t&&(n=n||F.MAX_STRING_LENGTH,(t=F.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,z,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},F.sanitizeUrl=function(e,t){return F.sanitizeInput(e,t,F.MAX_URL_LENGTH,B)},F.sanitizeMessage=function(e,t){var n;return t&&t.length>F.MAX_MESSAGE_LENGTH&&(n=t.substring(0,F.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,V,"message is too long, it has been truncated to "+F.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},F.sanitizeException=function(e,t){var n;return t&&t.length>F.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,F.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,L,"exception is too long, it has been truncated to "+F.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},F.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(u.WARNING,U,"custom property is not valid",{exception:e},!0)}i=F.sanitizeString(t,i,F.MAX_PROPERTY_LENGTH),n[r=F.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},F.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=F.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},F.sanitizeId=function(e,t){return t?F.sanitizeInput(e,t,F.MAX_ID_LENGTH,H).toString():t},F.sanitizeInput=function(e,t,n,r){var i;return t&&(t=F.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(u.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},F.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},F.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},F.MAX_NAME_LENGTH=150,F.MAX_ID_LENGTH=128,F.MAX_PROPERTY_LENGTH=8192,F.MAX_STRING_LENGTH=1024,F.MAX_URL_LENGTH=2048,F.MAX_MESSAGE_LENGTH=32768,F.MAX_EXCEPTION_LENGTH=32768,F);function F(){}var J=(Q.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Q.disableStorage=function(){Q._canUseLocalStorage=!1,Q._canUseSessionStorage=!1},Q._getLocalStorageObject=function(){return Q.canUseLocalStorage()?Q._getVerifiedStorageObject(i.LocalStorage):null},Q._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.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},Q.isInternalApplicationInsightsEndpoint=function(e){return-1!==Q._internalEndpoints.indexOf(e.toLowerCase())},Q.canUseLocalStorage=function(){return void 0===Q._canUseLocalStorage&&(Q._canUseLocalStorage=!!Q._getVerifiedStorageObject(i.LocalStorage)),Q._canUseLocalStorage},Q.getStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,h,"Browser failed read of local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setStorage=function(t,e,n){var r=Q._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,v,"Browser failed write to local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,y,"Browser failed removal of local storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q._getSessionStorageObject=function(){return Q.canUseSessionStorage()?Q._getVerifiedStorageObject(i.SessionStorage):null},Q.canUseSessionStorage=function(){return void 0===Q._canUseSessionStorage&&(Q._canUseSessionStorage=!!Q._getVerifiedStorageObject(i.SessionStorage)),Q._canUseSessionStorage},Q.getSessionStorageKeys=function(){var e=[];if(Q.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},Q.getSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed read of session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setSessionStorage=function(t,e,n){var r=Q._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,w,"Browser failed write to session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,S,"Browser failed removal of session storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.disableCookies=function(){g.disableCookies()},Q.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==Q.document.cookie}catch(e){t.throwInternal(u.WARNING,W,"Cannot access document.cookie - "+Q.getExceptionName(e),{exception:Q.dump(e)})}}return g._canUseCookies},Q.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),Q.document.location&&"https:"===Q.document.location.protocol&&(a=";secure"),Q.canUseCookies(e)&&(Q.document.cookie=t+"="+n+i+";path=/"+a)},Q.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},Q.getCookie=function(e,t){if(Q.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=Q.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=Q.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},Q.deleteCookie=function(e,t){Q.canUseCookies(e)&&(Q.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Q.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},Q.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Q.random32=function(){return 4294967296*Math.random()|0},Q.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=Q.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 i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},Q.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},Q.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},Q.toISOStringForIE8=function(e){if(Q.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"}},Q.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},Q.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,i=""+Math.floor(e/36e5)%24,a=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<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},Q.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},Q.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},Q.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},Q.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},Q.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},Q.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},Q.document="undefined"!=typeof document?document:{},Q._canUseLocalStorage=void 0,Q._canUseSessionStorage=void 0,Q._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Q.NotSpecified="not_specified",Q);function Q(){}var Y=($.parseUrl=function(e){return $.htmlAnchorElement||($.htmlAnchorElement=$.document.createElement?$.document.createElement("a"):{host:$.parseHost(e)}),$.htmlAnchorElement.href=e,$.htmlAnchorElement},$.getAbsoluteUrl=function(e){var t,n=$.parseUrl(e);return n&&(t=n.href),t},$.getPathName=function(e){var t,n=$.parseUrl(e);return n&&(t=n.pathname),t},$.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},$.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},$.document="undefined"!=typeof document?document:{},$);function $(){}var Z=(ee.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=Y.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=K.sanitizeString(e,n?n+" "+c:c)}else a=K.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ee);function ee(){}var te=(ne.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()},ne.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},ne);function ne(){}var re,ie=(t(ae,re=function(){}),ae);function ae(){return re.call(this)||this}var oe;t(se,oe=function(){this.ver=1,this.sampleRate=100,this.tags={}});function se(e,t,n){var r=oe.call(this)||this;return r.name=K.sanitizeString(e,n)||J.NotSpecified,r.data=t,r.time=J.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 ce(){}var le,ue=(t(pe,le=ce),pe);function pe(){var e=le.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ge,fe=(t(de,ge=ue),de.envelopeType="Microsoft.ApplicationInsights.{0}.Event",de.dataType="EventData",de);function de(e,t,n,r){var i=ge.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=K.sanitizeString(e,t)||J.NotSpecified,i.properties=K.sanitizeProperties(e,n),i.measurements=K.sanitizeMeasurements(e,r),i}function he(){}var me,ve=(t(we,me=ce),we);function we(){var e=me.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function ye(){this.hasFullStack=!0,this.parsedStack=[]}var Se,_e=(t(Ie,Se=ve),Ie.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ne.CreateFromInterface(t,e)});return new Ie(t,c({},e,{exceptions:n}))},Ie.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},Ie.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Ie.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Ie.dataType="ExceptionData",Ie);function Ie(e,t,n,r,i,a){var o=Se.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 Ne(e,t)],o.properties=K.sanitizeProperties(e,n),o.measurements=K.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(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),g.isNullOrUndefined(t.ver)||(o.ver=t.ver),g.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Te,Ne=(t(Ee,Te=ye),Ee.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}},Ee.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return ke.CreateFromInterface(e)})||t.parsedStack;return new Ee(e,c({},t,{parsedStack:n}))},Ee.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(ke.regex.test(o)){var s=new ke(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,p=c,g=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var f=g-p+1;t.splice(p,f);break}p=c,g=l,c++,l--}}return t},Ee);function Ee(e,t){var n=Te.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)||J.NotSpecified,n.message=K.sanitizeMessage(e,t.message)||J.NotSpecified;var r=t.stack;n.parsedStack=Ee.parseStack(r),n.stack=K.sanitizeException(e,r),n.hasFullStack=J.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 De,ke=(t(xe,De=he),xe.CreateFromInterface=function(e){return new xe(e,null)},xe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},xe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,xe.baseSize=58,xe);function xe(e,t){var n=De.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=J.trim(r),n.fileName="",n.line=0;var i=r.match(xe.regex);i&&5<=i.length&&(n.method=J.trim(i[2])||n.method,n.fileName=J.trim(i[4]),n.line=parseInt(i[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+=xe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Pe,be,Ae,Ce=(t(Me,Pe=ce),Me);function Me(){var e=Pe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=be=be||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var Re,Ue=(t(Le,Re=function(){this.kind=be.Measurement}),Le);function Le(){var e=null!==Re&&Re.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 Ve,Oe=(t(ze,Ve=Ce),ze.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",ze.dataType="MetricData",ze);function ze(e,t,n,r,i,a,o){var s=Ve.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Ue;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=K.sanitizeString(e,t)||J.NotSpecified,c.value=n,s.metrics=[c],s.properties=K.sanitizeProperties(e,o),s}var Ge,qe=(t(je,Ge=ue),je);function je(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Be,We=(t(He,Be=qe),He.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",He.dataType="PageviewData",He);function He(e,t,n,r,i,a,o){var s=Be.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)||J.NotSpecified,isNaN(r)||(s.duration=J.msToTimeSpan(r)),s.properties=K.sanitizeProperties(e,i),s.measurements=K.sanitizeMeasurements(e,a),s}var Xe,Ke=(t(Fe,Xe=ce),Fe);function Fe(){var e=Xe.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Je,Qe=(t(Ye,Je=Ke),Ye.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ye.dataType="RemoteDependencyData",Ye);function Ye(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var p=Je.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=J.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=K.sanitizeString(e,c);var g=Z.ParseDependencyPath(e,n,s,r);return p.data=K.sanitizeUrl(e,r)||g.data,p.target=K.sanitizeString(e,g.target),p.name=K.sanitizeString(e,g.name),p.properties=K.sanitizeProperties(e,l),p.measurements=K.sanitizeMeasurements(e,u),p}var $e,Ze=(t(et,$e=ce),et);function et(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e}var tt,nt=(t(rt,tt=Ze),rt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",rt.dataType="MessageData",rt);function rt(e,t,n,r){var i=tt.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||J.NotSpecified,i.message=K.sanitizeMessage(e,t),i.properties=K.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var it,at=(t(ot,it=qe),ot);function ot(){var e=it.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var st,ct=(t(lt,st=at),lt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",lt.dataType="PageviewPerformanceData",lt);function lt(e,t,n,r,i,a,o){var s=st.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)||J.NotSpecified,s.properties=K.sanitizeProperties(e,i),s.measurements=K.sanitizeMeasurements(e,a),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 ut,pt,gt;t(ft,ut=ie);function ft(e,t){var n=ut.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(gt=pt=pt||{})[gt.Verbose=0]="Verbose",gt[gt.Information=1]="Information",gt[gt.Warning=2]="Warning",gt[gt.Error=3]="Error",gt[gt.Critical=4]="Critical";var dt=(ht.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},ht);function ht(){}var mt=(vt.create=function(e,t,n,r,i,a){if(n=K.sanitizeString(r,n)||J.NotSpecified,g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||g.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!g.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},vt);function vt(){}var wt=(yt.prototype.trackPageView=function(t,n){var r=this,i=t.name;!g.isNullOrUndefined(i)&&"string"==typeof i||(t.name=window.document&&window.document.title||"");var a=t.uri;if(!g.isNullOrUndefined(a)&&"string"==typeof a||(t.uri=window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(u.WARNING,N,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var o=!1,s=void 0,c=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=te.GetDuration(c,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=void 0);var e=void 0;g.isNullOrUndefined(n)||g.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&((n=n||{}).duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),o=!0),n=n||{};var l=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(l);var e={name:i,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||o?(o||(n.duration=e.durationMs,r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<te.GetDuration(c,+new Date)&&(clearInterval(l),o||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(u.CRITICAL,C,"trackPageView failed on page load calculation: "+J.getExceptionName(e),{exception:J.dump(e)})}},100)},yt);function yt(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var St=(_t.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(e){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+J.dump(e))}},_t.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(e){return this._logger.warnToConsole("Call to restart failed: "+J.dump(e)),null}},_t.prototype.startPageVisitTimer=function(e,t){try{if(J.canUseSessionStorage()){if(null!=J.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new It(e,t),r=JSON.stringify(n);J.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+J.dump(e))}},_t.prototype.stopPageVisitTimer=function(){try{if(J.canUseSessionStorage()){var e=Date.now(),t=J.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,J.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+J.dump(e)),null}},_t);function _t(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var It=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Tt=(Nt.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=te.GetDuration(t.navigationStart,t.loadEventEnd),r=te.GetDuration(t.navigationStart,t.connectEnd),i=te.GetDuration(t.requestStart,t.responseStart),a=te.GetDuration(t.responseStart,t.responseEnd),o=te.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,I,"error calculating page view performance.",{total:n,network:r,request:i,response:a,dom:o}):this.shouldCollectDuration(n,r,i,a,o)?n<Math.floor(r)+Math.floor(i)+Math.floor(a)+Math.floor(o)?this._logger.throwInternal(u.WARNING,_,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=J.msToTimeSpan(n),e.networkConnect=J.msToTimeSpan(r),e.sentRequest=J.msToTimeSpan(i),e.receivedResponse=J.msToTimeSpan(a),e.domProcessing=J.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,R,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},Nt.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Nt.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},Nt.prototype.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},Nt.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=navigator.userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Nt);function Nt(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Et="duration",Dt=(kt.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=J.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=J.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=J.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=J.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=J.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=J.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=J.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},kt.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i)try{if(!1===i.apply(null,[e])){t=!0;break}}catch(e){this._logger.throwInternal(u.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+J.getExceptionName(e),{exception:J.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},kt.prototype.setNextPlugin=function(e){this._nextPlugin=e},kt.prototype.trackEvent=function(e,t){try{var n=mt.create(e,fe.dataType,fe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,M,"trackTrace failed, trace will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"startTrackEvent failed, event will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,D,"stopTrackEvent failed, event will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackTrace=function(e,t){try{var n=mt.create(e,nt.dataType,nt.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,M,"trackTrace failed, trace will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackMetric=function(e,t){try{var n=mt.create(e,Oe.dataType,Oe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,b,"trackMetric failed, metric will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,A,"trackPageView failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=void 0===e.refUri?document.referrer:e.refUri);var r=mt.create(e,We.dataType,We.envelopeType,this._logger,t,n);this.core.track(r),this._trackAjaxAttempts=0},kt.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=mt.create(e,ct.dataType,ct.envelopeType,this._logger,t,n);this.core.track(r)},kt.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,A,"trackPageViewPerformance failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,k,"startTrackPage failed, page view may not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.stopTrackPage=function(e,t,n,r){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,x,"stopTrackPage failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.sendExceptionInternal=function(e,t,n){var r=new _e(this._logger,e.exception||new Error(J.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=mt.create(r,_e.dataType,_e.envelopeType,this._logger,t,n);this.core.track(i)},kt.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackException failed, exception will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(J.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!J.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({exception:t.error,severityLevel:pt.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,T,"_onError threw exception while logging error, error will not be collected: "+J.getExceptionName(e),{exception:J.dump(e),errorString:r})}},kt.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},kt.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(g.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var r=kt.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=dt.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&J.disableCookies(),this.config.isStorageUseDisabled&&J.disableStorage();var a={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new Tt(this.core),this._pageViewManager=new wt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new St(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new xt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){(r=r||{})[Et]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new xt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Et]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var u=window.onerror;window.onerror=function(e,t,n,r,i){var a=u&&u(e,t,n,r,i);return!0!==a&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window&&"undefined"!=typeof Event){var p=this;n.forEach(function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"pushState")),window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"replaceState")),window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange")),e}),window.addEventListener(p.config.namePrefix+"popstate",function(){window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange"))}),window.addEventListener(p.config.namePrefix+"locationchange",function(){p._properties&&p._properties.context&&p._properties.context.telemetryTrace&&(p._properties.context.telemetryTrace.traceID=J.generateW3CId(),p._properties.context.telemetryTrace.name=window.location.pathname),o._currUri&&(o._prevUri=o._currUri),o._currUri=window.location.href,setTimeout(function(e){p.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),p.autoRoutePVDelay)})}this._isInitialized=!0}},kt.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},kt.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===Qe.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},kt.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},kt.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:void 0},n=mt.create(t,_e.dataType,_e.envelopeType,this._logger,{url:e});this.core.track(n)},kt.Version="2.2.0",kt);function kt(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this._urlArr=[],this._prevUri=window.location.href,this.initialize=this._initialize.bind(this)}var xt=(Pt.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,G,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},Pt.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,q,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=te.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},Pt);function Pt(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=Dt,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map

@@ -24,2 +24,5 @@ /**

this._trackAjaxAttempts = 0;
// array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.
this._urlArr = [];
this._prevUri = window.location.href;
this.initialize = this._initialize.bind(this);

@@ -410,3 +413,4 @@ }

&& typeof history === "object" && typeof history.pushState === "function" && typeof history.replaceState === "function"
&& typeof window === "object") {
&& typeof window === "object"
&& typeof Event !== "undefined") {
var _self_1 = this;

@@ -421,4 +425,4 @@ // Find the properties plugin

var ret = f.apply(this, arguments);
window.dispatchEvent(new Event(_self_1.config.namePrefix + "pushState"));
window.dispatchEvent(new Event(_self_1.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "pushState"));
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange"));
return ret;

@@ -428,18 +432,25 @@ }; })(history.pushState);

var ret = f.apply(this, arguments);
window.dispatchEvent(new Event(_self_1.config.namePrefix + "replaceState"));
window.dispatchEvent(new Event(_self_1.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "replaceState"));
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange"));
return ret;
}; })(history.replaceState);
window.addEventListener(_self_1.config.namePrefix + "popstate", function () {
window.dispatchEvent(new Event(_self_1.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self_1.config.namePrefix + "locationchange"));
});
window.addEventListener(_self_1.config.namePrefix + "locationchange", function () {
if (_self_1._properties && _self_1._properties.context && _self_1._properties.context.telemetryTrace) {
_self_1._properties.context.telemetryTrace.traceID = Util.newId();
_self_1._properties.context.telemetryTrace.traceID = Util.generateW3CId();
_self_1._properties.context.telemetryTrace.name = window.location.pathname;
}
setTimeout(function () {
if (_this._currUri) {
_this._prevUri = _this._currUri;
_this._currUri = window.location.href;
}
else {
_this._currUri = window.location.href;
}
setTimeout((function (uri) {
// todo: override start time so that it is not affected by autoRoutePVDelay
_self_1.trackPageView({ refUri: null, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0
}, _self_1.autoRoutePVDelay);
_self_1.trackPageView({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0
}).bind(_this, _this._prevUri), _self_1.autoRoutePVDelay);
});

@@ -497,3 +508,3 @@ }

};
ApplicationInsights.Version = "2.1.1"; // Not currently used anywhere
ApplicationInsights.Version = "2.2.0"; // Not currently used anywhere
return ApplicationInsights;

@@ -500,0 +511,0 @@ }());

/*!
* Application Insights JavaScript SDK - Web Analytics, 2.1.1
* Application Insights JavaScript SDK - Web Analytics, 2.2.0
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,o=function(){return(o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i||(i={}))[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f||(f={}))[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden";var g=(s.isNullOrUndefined=function(e){return null==e},s.disableCookies=function(){s._canUseCookies=!1},s.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)})},s);function s(){}var u,c,l=/[xy]/g;(c=u||(u={}))[c.CRITICAL=1]="CRITICAL",c[c.WARNING=2]="WARNING";var p=1,d=2,h=3,m=4,v=5,w=6,y=8,S=10,_=11,I=25,T=29,N=30,E=31,k=32,x=35,D=36,P=37,b=38,A=39,C=45,M=49,R=52,U=56,L=57,V=61,O=62,z=63,G=64,q=66,j=68,B=69;H.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(H.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),H.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[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,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function H(){this.identifier="ChannelControllerPlugin",this.priority=500}var X=(W.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=W.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,W.MAX_NAME_LENGTH-3)+W.padNumber(a);i=o}return i},W.sanitizeKey=function(e,t){var n;return t&&(t=W.trim(t.toString())).length>W.MAX_NAME_LENGTH&&(n=t.substring(0,W.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,L,"name is too long. It has been truncated to "+W.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},W.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=W.MAX_STRING_LENGTH),t&&(n=n||W.MAX_STRING_LENGTH,(t=W.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,V,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},W.sanitizeUrl=function(e,t){return W.sanitizeInput(e,t,W.MAX_URL_LENGTH,q)},W.sanitizeMessage=function(e,t){var n;return t&&t.length>W.MAX_MESSAGE_LENGTH&&(n=t.substring(0,W.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,U,"message is too long, it has been truncated to "+W.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},W.sanitizeException=function(e,t){var n;return t&&t.length>W.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,W.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,R,"exception is too long, it has been truncated to "+W.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},W.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(u.WARNING,M,"custom property is not valid",{exception:e},!0)}i=W.sanitizeString(t,i,W.MAX_PROPERTY_LENGTH),n[r=W.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},W.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=W.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},W.sanitizeId=function(e,t){return t?W.sanitizeInput(e,t,W.MAX_ID_LENGTH,B).toString():t},W.sanitizeInput=function(e,t,n,r){var i;return t&&(t=W.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(u.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},W.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},W.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},W.MAX_NAME_LENGTH=150,W.MAX_ID_LENGTH=128,W.MAX_PROPERTY_LENGTH=8192,W.MAX_STRING_LENGTH=1024,W.MAX_URL_LENGTH=2048,W.MAX_MESSAGE_LENGTH=32768,W.MAX_EXCEPTION_LENGTH=32768,W);function W(){}var K=(F.disableStorage=function(){F._canUseLocalStorage=!1,F._canUseSessionStorage=!1},F._getLocalStorageObject=function(){return F.canUseLocalStorage()?F._getVerifiedStorageObject(i.LocalStorage):null},F._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.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},F.isInternalApplicationInsightsEndpoint=function(e){return-1!==F._internalEndpoints.indexOf(e.toLowerCase())},F.canUseLocalStorage=function(){return void 0===F._canUseLocalStorage&&(F._canUseLocalStorage=!!F._getVerifiedStorageObject(i.LocalStorage)),F._canUseLocalStorage},F.getStorage=function(t,e){var n=F._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,p,"Browser failed read of local storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return null},F.setStorage=function(t,e,n){var r=F._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,h,"Browser failed write to local storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.removeStorage=function(t,e){var n=F._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){F._canUseLocalStorage=!1,t.throwInternal(u.WARNING,v,"Browser failed removal of local storage item. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F._getSessionStorageObject=function(){return F.canUseSessionStorage()?F._getVerifiedStorageObject(i.SessionStorage):null},F.canUseSessionStorage=function(){return void 0===F._canUseSessionStorage&&(F._canUseSessionStorage=!!F._getVerifiedStorageObject(i.SessionStorage)),F._canUseSessionStorage},F.getSessionStorageKeys=function(){var e=[];if(F.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},F.getSessionStorage=function(t,e){var n=F._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,d,"Browser failed read of session storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return null},F.setSessionStorage=function(t,e,n){var r=F._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed write to session storage. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.removeSessionStorage=function(t,e){var n=F._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){F._canUseSessionStorage=!1,t.throwInternal(u.WARNING,w,"Browser failed removal of session storage item. "+F.getExceptionName(e),{exception:F.dump(e)})}return!1},F.disableCookies=function(){g.disableCookies()},F.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==F.document.cookie}catch(e){t.throwInternal(u.WARNING,j,"Cannot access document.cookie - "+F.getExceptionName(e),{exception:F.dump(e)})}}return g._canUseCookies},F.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),F.document.location&&"https:"===F.document.location.protocol&&(a=";secure"),F.canUseCookies(e)&&(F.document.cookie=t+"="+n+i+";path=/"+a)},F.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},F.getCookie=function(e,t){if(F.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=F.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=F.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},F.deleteCookie=function(e,t){F.canUseCookies(e)&&(F.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},F.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},F.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},F.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},F.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},F.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},F.toISOStringForIE8=function(e){if(F.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"}},F.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},F.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,i=""+Math.floor(e/36e5)%24,a=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<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},F.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},F.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},F.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},F.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},F.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},F.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},F.document="undefined"!=typeof document?document:{},F._canUseLocalStorage=void 0,F._canUseSessionStorage=void 0,F._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],F.NotSpecified="not_specified",F);function F(){}var J=(Q.parseUrl=function(e){return Q.htmlAnchorElement||(Q.htmlAnchorElement=Q.document.createElement?Q.document.createElement("a"):{host:Q.parseHost(e)}),Q.htmlAnchorElement.href=e,Q.htmlAnchorElement},Q.getAbsoluteUrl=function(e){var t,n=Q.parseUrl(e);return n&&(t=n.href),t},Q.getPathName=function(e){var t,n=Q.parseUrl(e);return n&&(t=n.pathname),t},Q.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},Q.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},Q.document="undefined"!=typeof document?document:{},Q);function Q(){}var Y=($.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=J.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=X.sanitizeString(e,n?n+" "+c:c)}else a=X.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},$);function $(){}var Z=(ee.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()},ee.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},ee);function ee(){}var te,ne=(t(re,te=function(){}),re);function re(){return te.call(this)||this}var ie;t(ae,ie=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ae(e,t,n){var r=ie.call(this)||this;return r.name=X.sanitizeString(e,n)||K.NotSpecified,r.data=t,r.time=K.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 oe(){}var se,ce=(t(le,se=oe),le);function le(){var e=se.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ue,pe=(t(ge,ue=ce),ge.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ge.dataType="EventData",ge);function ge(e,t,n,r){var i=ue.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=X.sanitizeString(e,t)||K.NotSpecified,i.properties=X.sanitizeProperties(e,n),i.measurements=X.sanitizeMeasurements(e,r),i}function fe(){}var de,he=(t(me,de=oe),me);function me(){var e=de.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function ve(){this.hasFullStack=!0,this.parsedStack=[]}var we,ye=(t(Se,we=he),Se.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ie.CreateFromInterface(t,e)});return new Se(t,o({},e,{exceptions:n}))},Se.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},Se.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Se.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Se.dataType="ExceptionData",Se);function Se(e,t,n,r,i,a){var o=we.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 Ie(e,t)],o.properties=X.sanitizeProperties(e,n),o.measurements=X.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(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),g.isNullOrUndefined(t.ver)||(o.ver=t.ver),g.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var _e,Ie=(t(Te,_e=ve),Te.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}},Te.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ee.CreateFromInterface(e)})||t.parsedStack;return new Te(e,o({},t,{parsedStack:n}))},Te.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(Ee.regex.test(o)){var s=new Ee(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,p=c,g=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var f=g-p+1;t.splice(p,f);break}p=c,g=l,c++,l--}}return t},Te);function Te(e,t){var n=_e.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=X.sanitizeString(e,t.name)||K.NotSpecified,n.message=X.sanitizeMessage(e,t.message)||K.NotSpecified;var r=t.stack;n.parsedStack=Te.parseStack(r),n.stack=X.sanitizeException(e,r),n.hasFullStack=K.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 Ne,Ee=(t(ke,Ne=fe),ke.CreateFromInterface=function(e){return new ke(e,null)},ke.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},ke.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,ke.baseSize=58,ke);function ke(e,t){var n=Ne.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=K.trim(r),n.fileName="",n.line=0;var i=r.match(ke.regex);i&&5<=i.length&&(n.method=K.trim(i[2])||n.method,n.fileName=K.trim(i[4]),n.line=parseInt(i[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+=ke.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var xe,De,Pe,be=(t(Ae,xe=oe),Ae);function Ae(){var e=xe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Pe=De||(De={}))[Pe.Measurement=0]="Measurement",Pe[Pe.Aggregation=1]="Aggregation";var Ce,Me=(t(Re,Ce=function(){this.kind=De.Measurement}),Re);function Re(){var e=null!==Ce&&Ce.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 Ue,Le=(t(Ve,Ue=be),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Ve.dataType="MetricData",Ve);function Ve(e,t,n,r,i,a,o){var s=Ue.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=X.sanitizeString(e,t)||K.NotSpecified,c.value=n,s.metrics=[c],s.properties=X.sanitizeProperties(e,o),s}var Oe,ze=(t(Ge,Oe=ce),Ge);function Ge(){var e=Oe.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe,je=(t(Be,qe=ze),Be.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Be.dataType="PageviewData",Be);function Be(e,t,n,r,i,a,o){var s=qe.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=X.sanitizeId(e,o),s.url=X.sanitizeUrl(e,n),s.name=X.sanitizeString(e,t)||K.NotSpecified,isNaN(r)||(s.duration=K.msToTimeSpan(r)),s.properties=X.sanitizeProperties(e,i),s.measurements=X.sanitizeMeasurements(e,a),s}var He,Xe=(t(We,He=oe),We);function We(){var e=He.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Ke,Fe=(t(Je,Ke=Xe),Je.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Je.dataType="RemoteDependencyData",Je);function Je(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var p=Ke.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=K.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=X.sanitizeString(e,c);var g=Y.ParseDependencyPath(e,n,s,r);return p.data=X.sanitizeUrl(e,r)||g.data,p.target=X.sanitizeString(e,g.target),p.name=X.sanitizeString(e,g.name),p.properties=X.sanitizeProperties(e,l),p.measurements=X.sanitizeMeasurements(e,u),p}var Qe,Ye=(t($e,Qe=oe),$e);function $e(){var e=Qe.call(this)||this;return e.ver=2,e.properties={},e}var Ze,et=(t(tt,Ze=Ye),tt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",tt.dataType="MessageData",tt);function tt(e,t,n,r){var i=Ze.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||K.NotSpecified,i.message=X.sanitizeMessage(e,t),i.properties=X.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var nt,rt=(t(it,nt=ze),it);function it(){var e=nt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var at,ot=(t(st,at=rt),st.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",st.dataType="PageviewPerformanceData",st);function st(e,t,n,r,i,a,o){var s=at.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=X.sanitizeUrl(e,n),s.name=X.sanitizeString(e,t)||K.NotSpecified,s.properties=X.sanitizeProperties(e,i),s.measurements=X.sanitizeMeasurements(e,a),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 ct,lt,ut;t(pt,ct=ne);function pt(e,t){var n=ct.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(ut=lt||(lt={}))[ut.Verbose=0]="Verbose",ut[ut.Information=1]="Information",ut[ut.Warning=2]="Warning",ut[ut.Error=3]="Error",ut[ut.Critical=4]="Critical";var gt=(ft.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},ft);function ft(){}var dt=(ht.create=function(e,t,n,r,i,a){if(n=X.sanitizeString(r,n)||K.NotSpecified,g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||g.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!g.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},ht);function ht(){}var mt=(vt.prototype.trackPageView=function(t,n){var r=this,i=t.name;!g.isNullOrUndefined(i)&&"string"==typeof i||(t.name=window.document&&window.document.title||"");var a=t.uri;if(!g.isNullOrUndefined(a)&&"string"==typeof a||(t.uri=window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(u.WARNING,I,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var o=!1,s=void 0,c=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=Z.GetDuration(c,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=void 0);var e=void 0;g.isNullOrUndefined(n)||g.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&(n||(n={}),n.duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),o=!0),n||(n={});var l=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(l);var e={name:i,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||o?(o||(n.duration=e.durationMs,r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<Z.GetDuration(c,+new Date)&&(clearInterval(l),o||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(u.CRITICAL,b,"trackPageView failed on page load calculation: "+K.getExceptionName(e),{exception:K.dump(e)})}},100)},vt);function vt(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var wt=(yt.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(e){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+K.dump(e))}},yt.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(e){return this._logger.warnToConsole("Call to restart failed: "+K.dump(e)),null}},yt.prototype.startPageVisitTimer=function(e,t){try{if(K.canUseSessionStorage()){if(null!=K.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new St(e,t),r=JSON.stringify(n);K.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+K.dump(e))}},yt.prototype.stopPageVisitTimer=function(){try{if(K.canUseSessionStorage()){var e=Date.now(),t=K.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,K.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+K.dump(e)),null}},yt);function yt(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var St=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},_t=(It.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=Z.GetDuration(t.navigationStart,t.loadEventEnd),r=Z.GetDuration(t.navigationStart,t.connectEnd),i=Z.GetDuration(t.requestStart,t.responseStart),a=Z.GetDuration(t.responseStart,t.responseEnd),o=Z.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,S,"error calculating page view performance.",{total:n,network:r,request:i,response:a,dom:o}):this.shouldCollectDuration(n,r,i,a,o)?n<Math.floor(r)+Math.floor(i)+Math.floor(a)+Math.floor(o)?this._logger.throwInternal(u.WARNING,y,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=K.msToTimeSpan(n),e.networkConnect=K.msToTimeSpan(r),e.sentRequest=K.msToTimeSpan(i),e.receivedResponse=K.msToTimeSpan(a),e.domProcessing=K.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,C,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},It.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},It.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},It.prototype.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},It.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=navigator.userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},It);function It(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Tt="duration",Nt=(Et.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=K.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=K.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=K.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=K.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=K.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=K.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=K.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},Et.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i)try{if(!1===i.apply(null,[e])){t=!0;break}}catch(e){this._logger.throwInternal(u.CRITICAL,G,"One of telemetry initializers failed, telemetry item will not be sent: "+K.getExceptionName(e),{exception:K.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},Et.prototype.setNextPlugin=function(e){this._nextPlugin=e},Et.prototype.trackEvent=function(e,t){try{var n=dt.create(e,pe.dataType,pe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,A,"trackTrace failed, trace will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,T,"startTrackEvent failed, event will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,N,"stopTrackEvent failed, event will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackTrace=function(e,t){try{var n=dt.create(e,et.dataType,et.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,A,"trackTrace failed, trace will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackMetric=function(e,t){try{var n=dt.create(e,Le.dataType,Le.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,D,"trackMetric failed, metric will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,o({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackPageView failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=void 0===e.refUri?document.referrer:e.refUri);var r=dt.create(e,je.dataType,je.envelopeType,this._logger,t,n);this.core.track(r),this._trackAjaxAttempts=0},Et.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=dt.create(e,ot.dataType,ot.envelopeType,this._logger,t,n);this.core.track(r)},Et.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackPageViewPerformance failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"startTrackPage failed, page view may not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.stopTrackPage=function(e,t,n,r){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,k,"stopTrackPage failed, page view will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype.sendExceptionInternal=function(e,t,n){var r=new ye(this._logger,e.exception||new Error(K.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=dt.create(r,ye.dataType,ye.envelopeType,this._logger,t,n);this.core.track(i)},Et.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,x,"trackException failed, exception will not be collected: "+K.getExceptionName(e),{exception:K.dump(e)})}},Et.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(K.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!K.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({exception:t.error,severityLevel:lt.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,_,"_onError threw exception while logging error, error will not be collected: "+K.getExceptionName(e),{exception:K.dump(e),errorString:r})}},Et.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Et.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(g.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var r=Et.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=gt.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&K.disableCookies(),this.config.isStorageUseDisabled&&K.disableStorage();var a={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new _t(this.core),this._pageViewManager=new mt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new wt(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new kt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Tt]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new kt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Tt]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var u=window.onerror;window.onerror=function(e,t,n,r,i){var a=u&&u(e,t,n,r,i);return!0!==a&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window){var p=this;n.forEach(function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(new Event(p.config.namePrefix+"pushState")),window.dispatchEvent(new Event(p.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(new Event(p.config.namePrefix+"replaceState")),window.dispatchEvent(new Event(p.config.namePrefix+"locationchange")),e}),window.addEventListener(p.config.namePrefix+"popstate",function(){window.dispatchEvent(new Event(p.config.namePrefix+"locationchange"))}),window.addEventListener(p.config.namePrefix+"locationchange",function(){p._properties&&p._properties.context&&p._properties.context.telemetryTrace&&(p._properties.context.telemetryTrace.traceID=K.newId(),p._properties.context.telemetryTrace.name=window.location.pathname),setTimeout(function(){p.trackPageView({refUri:null,properties:{duration:0}})},p.autoRoutePVDelay)})}this._isInitialized=!0}},Et.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},Et.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===Fe.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},Et.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},Et.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:void 0},n=dt.create(t,ye.dataType,ye.envelopeType,this._logger,{url:e});this.core.track(n)},Et.Version="2.1.1",Et);function Et(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}var kt=(xt.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,O,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},xt.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,z,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=Z.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},xt);function xt(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=Nt,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,f,a,o,s,c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=f=f||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var g=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(d,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var u,p,d=/[xy]/g;(p=u=u||{})[p.CRITICAL=1]="CRITICAL",p[p.WARNING=2]="WARNING";var h=1,m=2,v=3,w=4,y=5,S=6,_=8,I=10,T=11,N=25,E=29,D=30,k=31,x=32,P=35,b=36,A=37,C=38,M=39,R=45,U=49,L=52,V=56,O=57,z=61,G=62,q=63,j=64,B=66,W=68,H=69;X.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(X.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),X.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&g.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,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[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,i)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function X(){this.identifier="ChannelControllerPlugin",this.priority=500}var K=(F.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=F.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,F.MAX_NAME_LENGTH-3)+F.padNumber(a);i=o}return i},F.sanitizeKey=function(e,t){var n;return t&&(t=F.trim(t.toString())).length>F.MAX_NAME_LENGTH&&(n=t.substring(0,F.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,O,"name is too long. It has been truncated to "+F.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},F.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=F.MAX_STRING_LENGTH),t&&(n=n||F.MAX_STRING_LENGTH,(t=F.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,z,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},F.sanitizeUrl=function(e,t){return F.sanitizeInput(e,t,F.MAX_URL_LENGTH,B)},F.sanitizeMessage=function(e,t){var n;return t&&t.length>F.MAX_MESSAGE_LENGTH&&(n=t.substring(0,F.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,V,"message is too long, it has been truncated to "+F.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},F.sanitizeException=function(e,t){var n;return t&&t.length>F.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,F.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,L,"exception is too long, it has been truncated to "+F.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},F.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var i=e[r];if("object"==typeof i&&"undefined"!=typeof JSON)try{i=JSON.stringify(i)}catch(e){t.throwInternal(u.WARNING,U,"custom property is not valid",{exception:e},!0)}i=F.sanitizeString(t,i,F.MAX_PROPERTY_LENGTH),n[r=F.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},F.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=F.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},F.sanitizeId=function(e,t){return t?F.sanitizeInput(e,t,F.MAX_ID_LENGTH,H).toString():t},F.sanitizeInput=function(e,t,n,r){var i;return t&&(t=F.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(u.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},F.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},F.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},F.MAX_NAME_LENGTH=150,F.MAX_ID_LENGTH=128,F.MAX_PROPERTY_LENGTH=8192,F.MAX_STRING_LENGTH=1024,F.MAX_URL_LENGTH=2048,F.MAX_MESSAGE_LENGTH=32768,F.MAX_EXCEPTION_LENGTH=32768,F);function F(){}var J=(Q.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},Q.disableStorage=function(){Q._canUseLocalStorage=!1,Q._canUseSessionStorage=!1},Q._getLocalStorageObject=function(){return Q.canUseLocalStorage()?Q._getVerifiedStorageObject(i.LocalStorage):null},Q._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===i.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},Q.isInternalApplicationInsightsEndpoint=function(e){return-1!==Q._internalEndpoints.indexOf(e.toLowerCase())},Q.canUseLocalStorage=function(){return void 0===Q._canUseLocalStorage&&(Q._canUseLocalStorage=!!Q._getVerifiedStorageObject(i.LocalStorage)),Q._canUseLocalStorage},Q.getStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,h,"Browser failed read of local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setStorage=function(t,e,n){var r=Q._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,v,"Browser failed write to local storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeStorage=function(t,e){var n=Q._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseLocalStorage=!1,t.throwInternal(u.WARNING,y,"Browser failed removal of local storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q._getSessionStorageObject=function(){return Q.canUseSessionStorage()?Q._getVerifiedStorageObject(i.SessionStorage):null},Q.canUseSessionStorage=function(){return void 0===Q._canUseSessionStorage&&(Q._canUseSessionStorage=!!Q._getVerifiedStorageObject(i.SessionStorage)),Q._canUseSessionStorage},Q.getSessionStorageKeys=function(){var e=[];if(Q.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},Q.getSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed read of session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return null},Q.setSessionStorage=function(t,e,n){var r=Q._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,w,"Browser failed write to session storage. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.removeSessionStorage=function(t,e){var n=Q._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){Q._canUseSessionStorage=!1,t.throwInternal(u.WARNING,S,"Browser failed removal of session storage item. "+Q.getExceptionName(e),{exception:Q.dump(e)})}return!1},Q.disableCookies=function(){g.disableCookies()},Q.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==Q.document.cookie}catch(e){t.throwInternal(u.WARNING,W,"Cannot access document.cookie - "+Q.getExceptionName(e),{exception:Q.dump(e)})}}return g._canUseCookies},Q.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),Q.document.location&&"https:"===Q.document.location.protocol&&(a=";secure"),Q.canUseCookies(e)&&(Q.document.cookie=t+"="+n+i+";path=/"+a)},Q.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},Q.getCookie=function(e,t){if(Q.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=Q.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=Q.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},Q.deleteCookie=function(e,t){Q.canUseCookies(e)&&(Q.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},Q.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},Q.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},Q.random32=function(){return 4294967296*Math.random()|0},Q.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=Q.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 i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},Q.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},Q.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},Q.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},Q.toISOStringForIE8=function(e){if(Q.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"}},Q.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},Q.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,i=""+Math.floor(e/36e5)%24,a=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<a?a+".":"")+(i=i.length<2?"0"+i:i)+":"+r+":"+n+"."+t},Q.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},Q.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},Q.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},Q.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},Q.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},Q.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},Q.document="undefined"!=typeof document?document:{},Q._canUseLocalStorage=void 0,Q._canUseSessionStorage=void 0,Q._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],Q.NotSpecified="not_specified",Q);function Q(){}var Y=($.parseUrl=function(e){return $.htmlAnchorElement||($.htmlAnchorElement=$.document.createElement?$.document.createElement("a"):{host:$.parseHost(e)}),$.htmlAnchorElement.href=e,$.htmlAnchorElement},$.getAbsoluteUrl=function(e){var t,n=$.parseUrl(e);return n&&(t=n.href),t},$.getPathName=function(e){var t,n=$.parseUrl(e);return n&&(t=n.pathname),t},$.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},$.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},$.document="undefined"!=typeof document?document:{},$);function $(){}var Z=(ee.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=Y.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,a=K.sanitizeString(e,n?n+" "+c:c)}else a=K.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},ee);function ee(){}var te=(ne.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()},ne.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},ne);function ne(){}var re,ie=(t(ae,re=function(){}),ae);function ae(){return re.call(this)||this}var oe;t(se,oe=function(){this.ver=1,this.sampleRate=100,this.tags={}});function se(e,t,n){var r=oe.call(this)||this;return r.name=K.sanitizeString(e,n)||J.NotSpecified,r.data=t,r.time=J.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 ce(){}var le,ue=(t(pe,le=ce),pe);function pe(){var e=le.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var ge,fe=(t(de,ge=ue),de.envelopeType="Microsoft.ApplicationInsights.{0}.Event",de.dataType="EventData",de);function de(e,t,n,r){var i=ge.call(this)||this;return i.aiDataContract={ver:f.Required,name:f.Required,properties:f.Default,measurements:f.Default},i.name=K.sanitizeString(e,t)||J.NotSpecified,i.properties=K.sanitizeProperties(e,n),i.measurements=K.sanitizeMeasurements(e,r),i}function he(){}var me,ve=(t(we,me=ce),we);function we(){var e=me.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function ye(){this.hasFullStack=!0,this.parsedStack=[]}var Se,_e=(t(Ie,Se=ve),Ie.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return Ne.CreateFromInterface(t,e)});return new Ie(t,c({},e,{exceptions:n}))},Ie.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,c=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:c}},Ie.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Ie.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Ie.dataType="ExceptionData",Ie);function Ie(e,t,n,r,i,a){var o=Se.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 Ne(e,t)],o.properties=K.sanitizeProperties(e,n),o.measurements=K.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(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),g.isNullOrUndefined(t.ver)||(o.ver=t.ver),g.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Te,Ne=(t(Ee,Te=ye),Ee.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}},Ee.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return ke.CreateFromInterface(e)})||t.parsedStack;return new Ee(e,c({},t,{parsedStack:n}))},Ee.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,i=0,a=0;a<=n.length;a++){var o=n[a];if(ke.regex.test(o)){var s=new ke(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,p=c,g=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var f=g-p+1;t.splice(p,f);break}p=c,g=l,c++,l--}}return t},Ee);function Ee(e,t){var n=Te.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)||J.NotSpecified,n.message=K.sanitizeMessage(e,t.message)||J.NotSpecified;var r=t.stack;n.parsedStack=Ee.parseStack(r),n.stack=K.sanitizeException(e,r),n.hasFullStack=J.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 De,ke=(t(xe,De=he),xe.CreateFromInterface=function(e){return new xe(e,null)},xe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},xe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,xe.baseSize=58,xe);function xe(e,t){var n=De.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=J.trim(r),n.fileName="",n.line=0;var i=r.match(xe.regex);i&&5<=i.length&&(n.method=J.trim(i[2])||n.method,n.fileName=J.trim(i[4]),n.line=parseInt(i[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+=xe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Pe,be,Ae,Ce=(t(Me,Pe=ce),Me);function Me(){var e=Pe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ae=be=be||{})[Ae.Measurement=0]="Measurement",Ae[Ae.Aggregation=1]="Aggregation";var Re,Ue=(t(Le,Re=function(){this.kind=be.Measurement}),Le);function Le(){var e=null!==Re&&Re.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 Ve,Oe=(t(ze,Ve=Ce),ze.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",ze.dataType="MetricData",ze);function ze(e,t,n,r,i,a,o){var s=Ve.call(this)||this;s.aiDataContract={ver:f.Required,metrics:f.Required,properties:f.Default};var c=new Ue;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=K.sanitizeString(e,t)||J.NotSpecified,c.value=n,s.metrics=[c],s.properties=K.sanitizeProperties(e,o),s}var Ge,qe=(t(je,Ge=ue),je);function je(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Be,We=(t(He,Be=qe),He.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",He.dataType="PageviewData",He);function He(e,t,n,r,i,a,o){var s=Be.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)||J.NotSpecified,isNaN(r)||(s.duration=J.msToTimeSpan(r)),s.properties=K.sanitizeProperties(e,i),s.measurements=K.sanitizeMeasurements(e,a),s}var Xe,Ke=(t(Fe,Xe=ce),Fe);function Fe(){var e=Xe.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Je,Qe=(t(Ye,Je=Ke),Ye.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Ye.dataType="RemoteDependencyData",Ye);function Ye(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var p=Je.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=J.msToTimeSpan(i),p.success=a,p.resultCode=o+"",p.type=K.sanitizeString(e,c);var g=Z.ParseDependencyPath(e,n,s,r);return p.data=K.sanitizeUrl(e,r)||g.data,p.target=K.sanitizeString(e,g.target),p.name=K.sanitizeString(e,g.name),p.properties=K.sanitizeProperties(e,l),p.measurements=K.sanitizeMeasurements(e,u),p}var $e,Ze=(t(et,$e=ce),et);function et(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e}var tt,nt=(t(rt,tt=Ze),rt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",rt.dataType="MessageData",rt);function rt(e,t,n,r){var i=tt.call(this)||this;return i.aiDataContract={ver:f.Required,message:f.Required,severityLevel:f.Default,properties:f.Default},t=t||J.NotSpecified,i.message=K.sanitizeMessage(e,t),i.properties=K.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var it,at=(t(ot,it=qe),ot);function ot(){var e=it.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var st,ct=(t(lt,st=at),lt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",lt.dataType="PageviewPerformanceData",lt);function lt(e,t,n,r,i,a,o){var s=st.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)||J.NotSpecified,s.properties=K.sanitizeProperties(e,i),s.measurements=K.sanitizeMeasurements(e,a),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 ut,pt,gt;t(ft,ut=ie);function ft(e,t){var n=ut.call(this)||this;return n.aiDataContract={baseType:f.Required,baseData:f.Required},n.baseType=e,n.baseData=t,n}(gt=pt=pt||{})[gt.Verbose=0]="Verbose",gt[gt.Information=1]="Information",gt[gt.Warning=2]="Warning",gt[gt.Error=3]="Error",gt[gt.Critical=4]="Critical";var dt=(ht.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!g.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],g.isNullOrUndefined(i)?r:i},ht);function ht(){}var mt=(vt.create=function(e,t,n,r,i,a){if(n=K.sanitizeString(r,n)||J.NotSpecified,g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||g.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!g.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},vt);function vt(){}var wt=(yt.prototype.trackPageView=function(t,n){var r=this,i=t.name;!g.isNullOrUndefined(i)&&"string"==typeof i||(t.name=window.document&&window.document.title||"");var a=t.uri;if(!g.isNullOrUndefined(a)&&"string"==typeof a||(t.uri=window.location&&window.location.href||""),!this._pageViewPerformanceManager.isPerformanceTimingSupported())return this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),void this._logger.throwInternal(u.WARNING,N,"trackPageView: navigation timing API used for calculation of page duration is not supported in this browser. This page view will be collected without duration and timing info.");var o=!1,s=void 0,c=this._pageViewPerformanceManager.getPerformanceTiming().navigationStart;s=te.GetDuration(c,+new Date),this._pageViewPerformanceManager.shouldCollectDuration(s)||(s=void 0);var e=void 0;g.isNullOrUndefined(n)||g.isNullOrUndefined(n.duration)||(e=n.duration),!this.overridePageViewDuration&&isNaN(e)||(isNaN(e)&&((n=n||{}).duration=s),this.appInsights.sendPageViewInternal(t,n),this._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}),o=!0),n=n||{};var l=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(l);var e={name:i,uri:a};r._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),e.isValid||o?(o||(n.duration=e.durationMs,r.appInsights.sendPageViewInternal(t,n)),r.pageViewPerformanceSent||(r.appInsights.sendPageViewPerformanceInternal(e,n),r.pageViewPerformanceSent=!0),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})):(n.duration=s,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})}))}else 6e4<te.GetDuration(c,+new Date)&&(clearInterval(l),o||(n.duration=6e4,r.appInsights.sendPageViewInternal(t,n),r._channel().forEach(function(e){e.forEach(function(e){return e.flush(!0)})})))}catch(e){r._logger.throwInternal(u.CRITICAL,C,"trackPageView failed on page load calculation: "+J.getExceptionName(e),{exception:J.dump(e)})}},100)},yt);function yt(e,t,n,r){this.pageViewPerformanceSent=!1,this.overridePageViewDuration=!1,this.overridePageViewDuration=t,this.appInsights=e,this._pageViewPerformanceManager=r,n&&(this._channel=function(){return n.getTransmissionControls()},this._logger=n.logger)}var St=(_t.prototype.trackPreviousPageVisit=function(e,t){try{var n=this.restartPageVisitTimer(e,t);n&&this.pageVisitTimeTrackingHandler(n.pageName,n.pageUrl,n.pageVisitTime)}catch(e){this._logger.warnToConsole("Auto track page visit time failed, metric will not be collected: "+J.dump(e))}},_t.prototype.restartPageVisitTimer=function(e,t){try{var n=this.stopPageVisitTimer();return this.startPageVisitTimer(e,t),n}catch(e){return this._logger.warnToConsole("Call to restart failed: "+J.dump(e)),null}},_t.prototype.startPageVisitTimer=function(e,t){try{if(J.canUseSessionStorage()){if(null!=J.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new It(e,t),r=JSON.stringify(n);J.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+J.dump(e))}},_t.prototype.stopPageVisitTimer=function(){try{if(J.canUseSessionStorage()){var e=Date.now(),t=J.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,J.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+J.dump(e)),null}},_t);function _t(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}var It=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Tt=(Nt.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=te.GetDuration(t.navigationStart,t.loadEventEnd),r=te.GetDuration(t.navigationStart,t.connectEnd),i=te.GetDuration(t.requestStart,t.responseStart),a=te.GetDuration(t.responseStart,t.responseEnd),o=te.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,I,"error calculating page view performance.",{total:n,network:r,request:i,response:a,dom:o}):this.shouldCollectDuration(n,r,i,a,o)?n<Math.floor(r)+Math.floor(i)+Math.floor(a)+Math.floor(o)?this._logger.throwInternal(u.WARNING,_,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=J.msToTimeSpan(n),e.networkConnect=J.msToTimeSpan(r),e.sentRequest=J.msToTimeSpan(i),e.receivedResponse=J.msToTimeSpan(a),e.domProcessing=J.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,R,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},Nt.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},Nt.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},Nt.prototype.isPerformanceTimingDataReady=function(){var e=window.performance.timing;return 0<e.domainLookupStart&&0<e.navigationStart&&0<e.responseStart&&0<e.requestStart&&0<e.loadEventEnd&&0<e.responseEnd&&0<e.connectEnd&&0<e.domLoading},Nt.prototype.shouldCollectDuration=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=["googlebot","adsbot-google","apis-google","mediapartners-google"],r=navigator.userAgent,i=!1;if(r)for(var a=0;a<n.length;a++)i=i||-1!==r.toLowerCase().indexOf(n[a]);if(i)return!1;for(var o=0;o<e.length;o++)if(e[o]>=this.MAX_DURATION_ALLOWED)return!1;return!0},Nt);function Nt(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}var Et="duration",Dt=(kt.getDefaultConfig=function(e){return(e=e||{}).sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=J.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=J.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=J.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=J.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=J.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=J.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e.enableAutoRouteTracking=J.stringToBoolOrDefault(e.enableAutoRouteTracking),e.namePrefix=e.namePrefix||"",e},kt.prototype.processTelemetry=function(e){for(var t=!1,n=this._telemetryInitializers.length,r=0;r<n;++r){var i=this._telemetryInitializers[r];if(i)try{if(!1===i.apply(null,[e])){t=!0;break}}catch(e){this._logger.throwInternal(u.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+J.getExceptionName(e),{exception:J.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},kt.prototype.setNextPlugin=function(e){this._nextPlugin=e},kt.prototype.trackEvent=function(e,t){try{var n=mt.create(e,fe.dataType,fe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,M,"trackTrace failed, trace will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"startTrackEvent failed, event will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,D,"stopTrackEvent failed, event will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackTrace=function(e,t){try{var n=mt.create(e,nt.dataType,nt.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,M,"trackTrace failed, trace will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackMetric=function(e,t){try{var n=mt.create(e,Oe.dataType,Oe.envelopeType,this._logger,t);this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,b,"trackMetric failed, metric will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,c({},n.properties,n.measurements,t)),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,A,"trackPageView failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=void 0===e.refUri?document.referrer:e.refUri);var r=mt.create(e,We.dataType,We.envelopeType,this._logger,t,n);this.core.track(r),this._trackAjaxAttempts=0},kt.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=mt.create(e,ct.dataType,ct.envelopeType,this._logger,t,n);this.core.track(r)},kt.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,A,"trackPageViewPerformance failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,k,"startTrackPage failed, page view may not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.stopTrackPage=function(e,t,n,r){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),"string"!=typeof t&&(t=window.location&&window.location.href||""),this._pageTracking.stop(e,t,n,r),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,x,"stopTrackPage failed, page view will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype.sendExceptionInternal=function(e,t,n){var r=new _e(this._logger,e.exception||new Error(J.NotSpecified),e.properties,e.measurements,e.severityLevel,e.id).toInterface(),i=mt.create(r,_e.dataType,_e.envelopeType,this._logger,t,n);this.core.track(i)},kt.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,P,"trackException failed, exception will not be collected: "+J.getExceptionName(e),{exception:J.dump(e)})}},kt.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(J.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!J.isError(t.error)){var n="window.onerror@"+e.url+":"+t.lineNumber+":"+(t.columnNumber||0);t.error=new Error(t.message),t.error.stack=n}this.trackException({exception:t.error,severityLevel:pt.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,T,"_onError threw exception while logging error, error will not be collected: "+J.getExceptionName(e),{exception:J.dump(e),errorString:r})}},kt.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},kt.prototype._initialize=function(e,t,n){var o=this;if(!this._isInitialized){if(g.isNullOrUndefined(t))throw Error("Error initializing");this.core=t,this._logger=t.logger,this._globalconfig={instrumentationKey:e.instrumentationKey,endpointUrl:e.endpointUrl||"https://dc.services.visualstudio.com/v2/track"},this.config=e.extensionConfig&&e.extensionConfig[this.identifier]?e.extensionConfig[this.identifier]:{};var r=kt.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=dt.getConfig(e,i,this.identifier,r[i]);if(this._globalconfig)for(var i in r)void 0===this._globalconfig[i]&&(this._globalconfig[i]=r[i])}this.config.isCookieUseDisabled&&J.disableCookies(),this.config.isStorageUseDisabled&&J.disableStorage();var a={instrumentationKey:function(){return e.instrumentationKey},accountId:function(){return o.config.accountId||e.accountId},sessionRenewalMs:function(){return o.config.sessionRenewalMs||e.sessionRenewalMs},sessionExpirationMs:function(){return o.config.sessionExpirationMs||e.sessionExpirationMs},sampleRate:function(){return o.config.samplingPercentage||e.samplingPercentage},cookieDomain:function(){return o.config.cookieDomain||e.cookieDomain},sdkExtension:function(){return o.config.sdkExtension||e.sdkExtension},isBrowserLinkTrackingEnabled:function(){return o.config.isBrowserLinkTrackingEnabled||e.isBrowserLinkTrackingEnabled},appId:function(){return o.config.appId||e.appId}};this._pageViewPerformanceManager=new Tt(this.core),this._pageViewManager=new wt(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new St(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new xt(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){(r=r||{})[Et]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new xt(this._logger,"trackPageView"),this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Et]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)};var s,c,l=this;if(!1===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var u=window.onerror;window.onerror=function(e,t,n,r,i){var a=u&&u(e,t,n,r,i);return!0!==a&&l._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}if(!0===this.config.enableAutoRouteTracking&&"object"==typeof history&&"function"==typeof history.pushState&&"function"==typeof history.replaceState&&"object"==typeof window&&"undefined"!=typeof Event){var p=this;n.forEach(function(e){"AppInsightsPropertiesPlugin"===e.identifier&&(o._properties=e)}),history.pushState=(c=history.pushState,function(){var e=c.apply(this,arguments);return window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"pushState")),window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange")),e}),history.replaceState=(s=history.replaceState,function(){var e=s.apply(this,arguments);return window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"replaceState")),window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange")),e}),window.addEventListener(p.config.namePrefix+"popstate",function(){window.dispatchEvent(J.createDomEvent(p.config.namePrefix+"locationchange"))}),window.addEventListener(p.config.namePrefix+"locationchange",function(){p._properties&&p._properties.context&&p._properties.context.telemetryTrace&&(p._properties.context.telemetryTrace.traceID=J.generateW3CId(),p._properties.context.telemetryTrace.name=window.location.pathname),o._currUri&&(o._prevUri=o._currUri),o._currUri=window.location.href,setTimeout(function(e){p.trackPageView({refUri:e,properties:{duration:0}})}.bind(o,o._prevUri),p.autoRoutePVDelay)})}this._isInitialized=!0}},kt.prototype.trackPageVisitTime=function(e,t,n){var r={PageName:e,PageUrl:t};this.trackMetric({name:"PageVisitTime",average:n,max:n,min:n,sampleCount:1},r)},kt.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===Qe.dataType){var t=e.baseData;if(t)for(var n=0;n<r.length;n++)if(t.target&&0<=t.target.indexOf(r[n]))return!1}return!0})}},kt.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},kt.prototype._sendCORSException=function(e){var t={message:"Script error: The browser's same-origin policy prevents us from getting the details of this exception. Consider using the 'crossorigin' attribute.",url:e,lineNumber:0,columnNumber:0,error:void 0},n=mt.create(t,_e.dataType,_e.envelopeType,this._logger,{url:e});this.core.track(n)},kt.Version="2.2.0",kt);function kt(){this.identifier="ApplicationInsightsAnalytics",this.priority=180,this.autoRoutePVDelay=500,this._isInitialized=!1,this._trackAjaxAttempts=0,this._urlArr=[],this._prevUri=window.location.href,this.initialize=this._initialize.bind(this)}var xt=(Pt.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,G,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},Pt.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,q,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=te.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},Pt);function Pt(e,t){this._name=t,this._events={},this._logger=e}e.ApplicationInsights=Dt,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map
{
"name": "@microsoft/applicationinsights-analytics-js",
"version": "2.1.1",
"version": "2.2.0",
"description": "Microsoft Application Insights Javascript SDK apis",

@@ -20,3 +20,3 @@ "main": "dist/applicationinsights-analytics-js.js",

"devDependencies": {
"@microsoft/applicationinsights-properties-js": "2.1.1",
"@microsoft/applicationinsights-properties-js": "2.2.0",
"typescript": "2.5.3",

@@ -33,4 +33,4 @@ "rollup-plugin-node-resolve": "^3.4.0",

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

@@ -37,0 +37,0 @@ },

@@ -34,3 +34,3 @@ /**

export class ApplicationInsights implements IAppInsights, ITelemetryPlugin, IAppInsightsInternal {
public static Version = "2.1.1"; // Not currently used anywhere
public static Version = "2.2.0"; // Not currently used anywhere
public initialize: (config: IConfiguration, core: IAppInsightsCore, extensions: IPlugin[]) => void;

@@ -62,2 +62,7 @@ public identifier: string = "ApplicationInsightsAnalytics"; // do not change name or priority

// array with max length of 2 that store current url and previous url for SPA page route change trackPageview use.
private _urlArr: string[] = [];
private _prevUri: string = window.location.href;
private _currUri: string;
constructor() {

@@ -92,2 +97,3 @@ this.initialize = this._initialize.bind(this);

public processTelemetry(env: ITelemetryItem) {

@@ -582,3 +588,4 @@ var doNotSendItem = false;

&& typeof history === "object" && typeof history.pushState === "function" && typeof history.replaceState === "function"
&& typeof window === "object") {
&& typeof window === "object"
&& typeof Event !== "undefined") {
const _self = this;

@@ -594,4 +601,4 @@ // Find the properties plugin

var ret = f.apply(this, arguments);
window.dispatchEvent(new Event(_self.config.namePrefix + "pushState"));
window.dispatchEvent(new Event(_self.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "pushState"));
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange"));
return ret;

@@ -602,4 +609,4 @@ })(history.pushState);

var ret = f.apply(this, arguments);
window.dispatchEvent(new Event(_self.config.namePrefix + "replaceState"));
window.dispatchEvent(new Event(_self.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "replaceState"));
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange"));
return ret;

@@ -609,3 +616,3 @@ })(history.replaceState);

window.addEventListener(_self.config.namePrefix + "popstate",()=>{
window.dispatchEvent(new Event(_self.config.namePrefix + "locationchange"));
window.dispatchEvent(Util.createDomEvent(_self.config.namePrefix + "locationchange"));
});

@@ -615,9 +622,15 @@

if (_self._properties && _self._properties.context && _self._properties.context.telemetryTrace) {
_self._properties.context.telemetryTrace.traceID = Util.newId();
_self._properties.context.telemetryTrace.traceID = Util.generateW3CId();
_self._properties.context.telemetryTrace.name = window.location.pathname;
}
setTimeout(() => {
if (this._currUri) {
this._prevUri = this._currUri;
this._currUri = window.location.href;
} else {
this._currUri = window.location.href;
}
setTimeout(((uri: string) => {
// todo: override start time so that it is not affected by autoRoutePVDelay
_self.trackPageView({ refUri: null, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0
}, _self.autoRoutePVDelay);
_self.trackPageView({ refUri: uri, properties: { duration: 0 } }); // SPA route change loading durations are undefined, so send 0
}).bind(this, this._prevUri), _self.autoRoutePVDelay);
});

@@ -624,0 +637,0 @@ }

@@ -33,2 +33,5 @@ /**

private _trackAjaxAttempts;
private _urlArr;
private _prevUri;
private _currUri;
constructor();

@@ -35,0 +38,0 @@ static getDefaultConfig(config?: IConfig): IConfig;

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc