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.0.0-rc3 to 2.0.0-rc4

4

browser/applicationinsights-analytics-js.min.js
/*!
* Application Insights JavaScript SDK - Web Analytics, 2.0.0-rc3
* Application Insights JavaScript SDK - Web Analytics, 2.0.0-rc4
* 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 i,t,d,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=d||(d={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var l,r,g=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=l||(l={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,c=2,u=3,f=4,p=5,h=6,s=8,m=10,v=11,y=25,w=29,_=30,S=31,T=32,I=35,N=36,E=37,D=38,x=39,k=45,P=49,b=52,A=56,C=57,M=61,R=62,U=63,V=64,L=66,z=68,O=69,G=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=G}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var a=this;if(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<G&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(q+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];s.priority>G&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),q="Channel has invalid priority",B=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(l.WARNING,C,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(l.WARNING,M,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,L)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(l.WARNING,A,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(l.WARNING,b,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.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(l.WARNING,P,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,O).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(l.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),j=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._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},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,o,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,p,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,h,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(l.WARNING,z,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.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"}},s.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},s.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},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.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},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),H=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),K=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.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=B.sanitizeString(e,n?n+" "+c:c)}else a=B.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),X=function(){function e(){}return e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},e}(),W=function(e,t){return(W=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 F(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var J,Q,Y=function(e){function t(){return e.call(this)||this}return F(t,e),t}(function(){}),$=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=B.sanitizeString(e,n)||j.NotSpecified,r.data=t,r.time=j.toISOStringForIE8(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100==r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}F(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),Z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}($),ee=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=B.sanitizeString(e,t)||j.NotSpecified,i.properties=B.sanitizeProperties(e,n),i.measurements=B.sanitizeMeasurements(e,r),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Z),te=function(){},ne=function(){this.hasFullStack=!0,this.parsedStack=[]},re=function(o){function e(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},a.properties=B.sanitizeProperties(e,n),a.measurements=B.sanitizeMeasurements(e,r),a.exceptions=[new ie(e,t)],i&&(a.severityLevel=i),a}return F(e,o),e.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return F(e,t),e}($)),ie=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},n.typeName=B.sanitizeString(e,t.name)||j.NotSpecified,n.message=B.sanitizeMessage(e,t.message)||j.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=B.sanitizeException(e,r),n.hasFullStack=j.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return F(e,i),e.prototype.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(ae.regex.test(o)){var s=new ae(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,g=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=u,c++,u--}}return t},e}(ne),ae=function(i){function a(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},n.level=t,n.method="<no_method>",n.assembly=j.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=j.trim(r[2])||n.method,n.fileName=j.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return F(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(te),oe=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return F(e,t),e}($);(Q=J||(J={}))[Q.Measurement=0]="Measurement",Q[Q.Aggregation=1]="Aggregation";var se,ce,ue=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}return F(e,t),e}(function(){this.kind=J.Measurement}),le=function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.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=B.sanitizeString(e,t)||j.NotSpecified,c.value=n,s.metrics=[c],s.properties=B.sanitizeProperties(e,o),s}return F(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(oe),ge=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(Z),fe=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=B.sanitizeId(e,o),s.url=B.sanitizeUrl(e,n),s.name=B.sanitizeString(e,t)||j.NotSpecified,isNaN(r)||(s.duration=j.msToTimeSpan(r)),s.properties=B.sanitizeProperties(e,i),s.measurements=B.sanitizeMeasurements(e,a),s}return F(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ge),pe=function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var g=p.call(this)||this;g.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},g.id=t,g.duration=j.msToTimeSpan(i),g.success=a,g.resultCode=o+"",g.type=B.sanitizeString(e,c);var f=K.ParseDependencyPath(e,n,s,r);return g.data=B.sanitizeUrl(e,r)||f.data,g.target=f.target,g.name=f.name,g.properties=B.sanitizeProperties(e,u),g.measurements=B.sanitizeMeasurements(e,l),g}return F(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return F(e,t),e}($)),de=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||j.NotSpecified,i.message=B.sanitizeMessage(e,t),i.properties=B.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return F(e,t),e}($)),he=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},o.url=B.sanitizeUrl(e,n),o.name=B.sanitizeString(e,t)||j.NotSpecified,o.properties=B.sanitizeProperties(e,i),o.measurements=B.sanitizeMeasurements(e,a),o}return F(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(ge));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}F(e,r)}(Y);(ce=se||(se={}))[ce.Verbose=0]="Verbose",ce[ce.Information=1]="Information",ce[ce.Warning=2]="Warning",ce[ce.Error=3]="Error",ce[ce.Critical=4]="Critical";var me=function(){function e(){}return e.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},e}(),ve=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=B.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},e}(),ye=function(){function e(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)}return e.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(l.WARNING,y,"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=X.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 u=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);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<X.GetDuration(c,+new Date)&&(clearInterval(u),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(l.CRITICAL,D,"trackPageView failed on page load calculation: "+j.getExceptionName(e),{exception:j.dump(e)})}},100)},e}(),we=function(){function e(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}return e.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))}},e.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}},e.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 _e(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))}},e.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}},e}(),_e=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Se=function(){function e(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return e.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=X.GetDuration(t.navigationStart,t.loadEventEnd),r=X.GetDuration(t.navigationStart,t.connectEnd),i=X.GetDuration(t.requestStart,t.responseStart),a=X.GetDuration(t.responseStart,t.responseEnd),o=X.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(l.WARNING,m,"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(l.WARNING,s,"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(l.WARNING,k,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},e.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},e.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},e.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},e.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},e}(),Te="duration",Ie=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(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},u.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(l.CRITICAL,V,"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)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=ve.create(e,ee.dataType,ee.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.WARNING,x,"trackTrace failed, trace will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(l.CRITICAL,w,"startTrackEvent failed, event will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(l.CRITICAL,_,"stopTrackEvent failed, event will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=ve.create(e,de.dataType,de.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.WARNING,x,"trackTrace failed, trace will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=ve.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.CRITICAL,N,"trackMetric failed, metric will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(l.CRITICAL,E,"trackPageView failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri||document.referrer);var r=ve.create(e,fe.dataType,fe.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=ve.create(e,he.dataType,he.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},u.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(l.CRITICAL,E,"trackPageViewPerformance failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(l.CRITICAL,S,"startTrackPage failed, page view may not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.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(l.CRITICAL,T,"stopTrackPage failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.sendExceptionInternal=function(e,t,n){var r=ve.create(e,re.dataType,re.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},u.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(l.CRITICAL,I,"trackException failed, exception will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.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({error:t.error,severityLevel:se.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(l.CRITICAL,v,"_onError threw exception while logging error, error will not be collected: "+j.getExceptionName(e),{exception:j.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=me.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}};if(this._pageViewPerformanceManager=new Se(this.core),this._pageViewManager=new ye(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new we(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new Ne(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Te]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Ne(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Te]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var a=s&&s(e,t,n,r,i);return!0!==a&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.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)},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===pe.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})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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=ve.create(t,re.dataType,re.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.iKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.0-rc3",u}(),Ne=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(l.WARNING,R,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(l.WARNING,U,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=X.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=Ie,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 i,t,d,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=d||(d={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var u,r,g=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.disableCookies=function(){e._canUseCookies=!1},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=u||(u={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,c=2,l=3,f=4,p=5,m=6,s=8,h=10,v=11,y=25,w=29,S=30,_=31,I=32,T=35,N=36,E=37,k=38,D=39,x=45,P=49,b=52,A=56,C=57,M=61,R=62,L=63,U=64,V=66,O=68,z=69,G=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=G}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.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<G&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(q+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];s.priority>G&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),q="Channel has invalid priority",j=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,C,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,M,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,V)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,A,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,b,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.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,P,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,z).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.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},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),B=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._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},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,o,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,l,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,p,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){g.disableCookies()},s.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(u.WARNING,O,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.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"}},s.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},s.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},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.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},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),H=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),K=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.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=j.sanitizeString(e,n?n+" "+c:c)}else a=j.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),X=function(){function e(){}return e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},e}(),W=function(e,t){return(W=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 F(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var J,Q,Y=function(){return(Y=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)},$=function(e){function t(){return e.call(this)||this}return F(t,e),t}(function(){}),Z=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=j.sanitizeString(e,n)||B.NotSpecified,r.data=t,r.time=B.toISOStringForIE8(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100==r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}F(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),ee=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(Z),te=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=j.sanitizeString(e,t)||B.NotSpecified,i.properties=j.sanitizeProperties(e,n),i.measurements=j.sanitizeMeasurements(e,r),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(ee),ne=function(){},re=function(){this.hasFullStack=!0,this.parsedStack=[]},ie=function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(a.exceptions=[new ae(e,t)],a.properties=j.sanitizeProperties(e,n),a.measurements=j.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}return F(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ae.CreateFromInterface(t,e)});return new r(t,Y({},e,{exceptions:n}))},r.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},r.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},r.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",r.dataType="ExceptionData",r}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return F(e,t),e}(Z)),ae=function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=j.sanitizeString(e,t.name)||B.NotSpecified,n.message=j.sanitizeMessage(e,t.message)||B.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=j.sanitizeException(e,r),n.hasFullStack=B.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}return F(a,i),a.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}},a.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return oe.CreateFromInterface(e)})||t.parsedStack;return new a(e,Y({},t,{parsedStack:n}))},a.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(oe.regex.test(o)){var s=new oe(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},a}(re),oe=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=B.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=B.trim(i[2])||n.method,n.fileName=B.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+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return F(o,a),o.CreateFromInterface=function(e){return new o(e,null)},o.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(ne),se=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return F(e,t),e}(Z);(Q=J||(J={}))[Q.Measurement=0]="Measurement",Q[Q.Aggregation=1]="Aggregation";var ce,le,ue=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}return F(e,t),e}(function(){this.kind=J.Measurement}),ge=function(l){function e(e,t,n,r,i,a,o){var s=l.call(this)||this;s.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.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=j.sanitizeString(e,t)||B.NotSpecified,c.value=n,s.metrics=[c],s.properties=j.sanitizeProperties(e,o),s}return F(e,l),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(se),fe=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(ee),pe=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=j.sanitizeId(e,o),s.url=j.sanitizeUrl(e,n),s.name=j.sanitizeString(e,t)||B.NotSpecified,isNaN(r)||(s.duration=B.msToTimeSpan(r)),s.properties=j.sanitizeProperties(e,i),s.measurements=j.sanitizeMeasurements(e,a),s}return F(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(fe),de=function(p){function e(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var g=p.call(this)||this;g.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},g.id=t,g.duration=B.msToTimeSpan(i),g.success=a,g.resultCode=o+"",g.type=j.sanitizeString(e,c);var f=K.ParseDependencyPath(e,n,s,r);return g.data=j.sanitizeUrl(e,r)||f.data,g.target=f.target,g.name=f.name,g.properties=j.sanitizeProperties(e,l),g.measurements=j.sanitizeMeasurements(e,u),g}return F(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return F(e,t),e}(Z)),me=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||B.NotSpecified,i.message=j.sanitizeMessage(e,t),i.properties=j.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return F(e,t),e}(Z)),he=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},o.url=j.sanitizeUrl(e,n),o.name=j.sanitizeString(e,t)||B.NotSpecified,o.properties=j.sanitizeProperties(e,i),o.measurements=j.sanitizeMeasurements(e,a),o}return F(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(fe));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}F(e,r)}($);(le=ce||(ce={}))[le.Verbose=0]="Verbose",le[le.Information=1]="Information",le[le.Warning=2]="Warning",le[le.Error=3]="Error",le[le.Critical=4]="Critical";var ve=function(){function e(){}return e.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},e}(),ye=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=j.sanitizeString(r,n)||B.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},e}(),we=function(){function e(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)}return e.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,y,"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=X.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<X.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,k,"trackPageView failed on page load calculation: "+B.getExceptionName(e),{exception:B.dump(e)})}},100)},e}(),Se=function(){function e(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}return e.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: "+B.dump(e))}},e.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: "+B.dump(e)),null}},e.prototype.startPageVisitTimer=function(e,t){try{if(B.canUseSessionStorage()){if(null!=B.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new _e(e,t),r=JSON.stringify(n);B.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+B.dump(e))}},e.prototype.stopPageVisitTimer=function(){try{if(B.canUseSessionStorage()){var e=Date.now(),t=B.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,B.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+B.dump(e)),null}},e}(),_e=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Ie=function(){function e(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return e.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=X.GetDuration(t.navigationStart,t.loadEventEnd),r=X.GetDuration(t.navigationStart,t.connectEnd),i=X.GetDuration(t.requestStart,t.responseStart),a=X.GetDuration(t.responseStart,t.responseEnd),o=X.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,h,"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,s,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=B.msToTimeSpan(n),e.networkConnect=B.msToTimeSpan(r),e.sentRequest=B.msToTimeSpan(i),e.receivedResponse=B.msToTimeSpan(a),e.domProcessing=B.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,x,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},e.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},e.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},e.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},e.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},e}(),Te="duration",Ne=function(){function l(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return l.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=B.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=B.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=B.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=B.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=B.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=B.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},l.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,U,"One of telemetry initializers failed, telemetry item will not be sent: "+B.getExceptionName(e),{exception:B.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},l.prototype.setNextPlugin=function(e){this._nextPlugin=e},l.prototype.trackEvent=function(e,t){try{var n=ye.create(e,te.dataType,te.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,D,"trackTrace failed, trace will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,w,"startTrackEvent failed, event will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,S,"stopTrackEvent failed, event will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackTrace=function(e,t){try{var n=ye.create(e,me.dataType,me.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,D,"trackTrace failed, trace will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackMetric=function(e,t){try{var n=ye.create(e,ge.dataType,ge.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,N,"trackMetric failed, metric will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"trackPageView failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri||document.referrer);var r=ye.create(e,pe.dataType,pe.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},l.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=ye.create(e,he.dataType,he.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},l.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"trackPageViewPerformance failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.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,_,"startTrackPage failed, page view may not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.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,I,"stopTrackPage failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.sendExceptionInternal=function(e,t,n){var r=new ie(this._logger,e.error,e.properties,e.measurements,e.severityLevel).toInterface(),i=ye.create(r,ie.dataType,ie.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(i),this.core.track(i)},l.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,T,"trackException failed, exception will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(B.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!B.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({error:t.error,severityLevel:ce.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,v,"_onError threw exception while logging error, error will not be collected: "+B.getExceptionName(e),{exception:B.dump(e),errorString:r})}},l.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},l.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=l.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=ve.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&&B.disableCookies(),this.config.isStorageUseDisabled&&B.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}};if(this._pageViewPerformanceManager=new Ie(this.core),this._pageViewManager=new we(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new Se(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new Ee(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Te]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Ee(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Te]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var a=s&&s(e,t,n,r,i);return!0!==a&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},l.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)},l.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===de.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})}},l.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},l.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=ye.create(t,ie.dataType,ie.envelopeType,this._logger,{url:e});this.core.track(n)},l.prototype._setTelemetryNameAndIKey=function(e){e.iKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},l.Version="2.0.0-rc4",l}(),Ee=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,R,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,L,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=X.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=Ne,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map

@@ -250,3 +250,4 @@ /**

ApplicationInsights.prototype.sendExceptionInternal = function (exception, customProperties, systemProperties) {
var telemetryItem = TelemetryItemCreator.create(exception, Exception.dataType, Exception.envelopeType, this._logger, customProperties, systemProperties);
var exceptionPartB = new Exception(this._logger, exception.error, exception.properties, exception.measurements, exception.severityLevel).toInterface();
var telemetryItem = TelemetryItemCreator.create(exceptionPartB, Exception.dataType, Exception.envelopeType, this._logger, customProperties, systemProperties);
this._setTelemetryNameAndIKey(telemetryItem);

@@ -464,3 +465,3 @@ this.core.track(telemetryItem);

};
ApplicationInsights.Version = "2.0.0-rc3"; // Not currently used anywhere
ApplicationInsights.Version = "2.0.0-rc4"; // Not currently used anywhere
return ApplicationInsights;

@@ -467,0 +468,0 @@ }());

/*!
* Application Insights JavaScript SDK - Web Analytics, 2.0.0-rc3
* Application Insights JavaScript SDK - Web Analytics, 2.0.0-rc4
* 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 i,t,d,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=d||(d={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var l,r,g=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=l||(l={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,c=2,u=3,f=4,p=5,h=6,s=8,m=10,v=11,y=25,w=29,_=30,S=31,T=32,I=35,N=36,E=37,D=38,x=39,k=45,P=49,b=52,A=56,C=57,M=61,R=62,U=63,V=64,L=66,z=68,O=69,G=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=G}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.prototype.initialize=function(n,r,i){var a=this;if(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<G&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(q+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];s.priority>G&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),q="Channel has invalid priority",B=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(l.WARNING,C,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(l.WARNING,M,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,L)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(l.WARNING,A,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(l.WARNING,b,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.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(l.WARNING,P,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,O).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(l.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),j=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._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},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,o,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,u,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(l.WARNING,p,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(l.WARNING,h,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){s._canUseCookies=!1},s.canUseCookies=function(t){if(void 0===s._canUseCookies){s._canUseCookies=!1;try{s._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(l.WARNING,z,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.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"}},s.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},s.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},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.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},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),H=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),K=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.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=B.sanitizeString(e,n?n+" "+c:c)}else a=B.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),X=function(){function e(){}return e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},e}(),W=function(e,t){return(W=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 F(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var J,Q,Y=function(e){function t(){return e.call(this)||this}return F(t,e),t}(function(){}),$=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=B.sanitizeString(e,n)||j.NotSpecified,r.data=t,r.time=j.toISOStringForIE8(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100==r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}F(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),Z=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}($),ee=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=B.sanitizeString(e,t)||j.NotSpecified,i.properties=B.sanitizeProperties(e,n),i.measurements=B.sanitizeMeasurements(e,r),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(Z),te=function(){},ne=function(){this.hasFullStack=!0,this.parsedStack=[]},re=function(o){function e(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},a.properties=B.sanitizeProperties(e,n),a.measurements=B.sanitizeMeasurements(e,r),a.exceptions=[new ie(e,t)],i&&(a.severityLevel=i),a}return F(e,o),e.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},e.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",e.dataType="ExceptionData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return F(e,t),e}($)),ie=function(i){function e(e,t){var n=i.call(this)||this;n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},n.typeName=B.sanitizeString(e,t.name)||j.NotSpecified,n.message=B.sanitizeMessage(e,t.message)||j.NotSpecified;var r=t.stack;return n.parsedStack=n.parseStack(r),n.stack=B.sanitizeException(e,r),n.hasFullStack=j.isArray(n.parsedStack)&&0<n.parsedStack.length,n}return F(e,i),e.prototype.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(ae.regex.test(o)){var s=new ae(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,g=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=u,c++,u--}}return t},e}(ne),ae=function(i){function a(e,t){var n=i.call(this)||this;n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},n.level=t,n.method="<no_method>",n.assembly=j.trim(e);var r=e.match(a.regex);return r&&5<=r.length&&(n.method=j.trim(r[2])||n.method,n.fileName=j.trim(r[4]),n.line=parseInt(r[5])||0),n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=a.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return F(a,i),a.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,a.baseSize=58,a}(te),oe=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return F(e,t),e}($);(Q=J||(J={}))[Q.Measurement=0]="Measurement",Q[Q.Aggregation=1]="Aggregation";var se,ce,ue=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}return F(e,t),e}(function(){this.kind=J.Measurement}),le=function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.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=B.sanitizeString(e,t)||j.NotSpecified,c.value=n,s.metrics=[c],s.properties=B.sanitizeProperties(e,o),s}return F(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(oe),ge=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(Z),fe=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=B.sanitizeId(e,o),s.url=B.sanitizeUrl(e,n),s.name=B.sanitizeString(e,t)||j.NotSpecified,isNaN(r)||(s.duration=j.msToTimeSpan(r)),s.properties=B.sanitizeProperties(e,i),s.measurements=B.sanitizeMeasurements(e,a),s}return F(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(ge),pe=function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var g=p.call(this)||this;g.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},g.id=t,g.duration=j.msToTimeSpan(i),g.success=a,g.resultCode=o+"",g.type=B.sanitizeString(e,c);var f=K.ParseDependencyPath(e,n,s,r);return g.data=B.sanitizeUrl(e,r)||f.data,g.target=f.target,g.name=f.name,g.properties=B.sanitizeProperties(e,u),g.measurements=B.sanitizeMeasurements(e,l),g}return F(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return F(e,t),e}($)),de=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||j.NotSpecified,i.message=B.sanitizeMessage(e,t),i.properties=B.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return F(e,t),e}($)),he=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},o.url=B.sanitizeUrl(e,n),o.name=B.sanitizeString(e,t)||j.NotSpecified,o.properties=B.sanitizeProperties(e,i),o.measurements=B.sanitizeMeasurements(e,a),o}return F(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(ge));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}F(e,r)}(Y);(ce=se||(se={}))[ce.Verbose=0]="Verbose",ce[ce.Information=1]="Information",ce[ce.Warning=2]="Warning",ce[ce.Error=3]="Error",ce[ce.Critical=4]="Critical";var me=function(){function e(){}return e.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},e}(),ve=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=B.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},e}(),ye=function(){function e(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)}return e.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(l.WARNING,y,"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=X.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 u=setInterval(function(){try{if(r._pageViewPerformanceManager.isPerformanceTimingDataReady()){clearInterval(u);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<X.GetDuration(c,+new Date)&&(clearInterval(u),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(l.CRITICAL,D,"trackPageView failed on page load calculation: "+j.getExceptionName(e),{exception:j.dump(e)})}},100)},e}(),we=function(){function e(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}return e.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))}},e.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}},e.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 _e(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))}},e.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}},e}(),_e=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Se=function(){function e(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return e.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=X.GetDuration(t.navigationStart,t.loadEventEnd),r=X.GetDuration(t.navigationStart,t.connectEnd),i=X.GetDuration(t.requestStart,t.responseStart),a=X.GetDuration(t.responseStart,t.responseEnd),o=X.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(l.WARNING,m,"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(l.WARNING,s,"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(l.WARNING,k,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},e.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},e.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},e.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},e.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},e}(),Te="duration",Ie=function(){function u(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return u.getDefaultConfig=function(e){return e||(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},u.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(l.CRITICAL,V,"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)},u.prototype.setNextPlugin=function(e){this._nextPlugin=e},u.prototype.trackEvent=function(e,t){try{var n=ve.create(e,ee.dataType,ee.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.WARNING,x,"trackTrace failed, trace will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(l.CRITICAL,w,"startTrackEvent failed, event will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(l.CRITICAL,_,"stopTrackEvent failed, event will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackTrace=function(e,t){try{var n=ve.create(e,de.dataType,de.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.WARNING,x,"trackTrace failed, trace will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackMetric=function(e,t){try{var n=ve.create(e,le.dataType,le.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(l.CRITICAL,N,"trackMetric failed, metric will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(l.CRITICAL,E,"trackPageView failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri||document.referrer);var r=ve.create(e,fe.dataType,fe.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},u.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=ve.create(e,he.dataType,he.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},u.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(l.CRITICAL,E,"trackPageViewPerformance failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.startTrackPage=function(e){try{"string"!=typeof e&&(e=window.document&&window.document.title||""),this._pageTracking.start(e)}catch(e){this._logger.throwInternal(l.CRITICAL,S,"startTrackPage failed, page view may not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.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(l.CRITICAL,T,"stopTrackPage failed, page view will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.prototype.sendExceptionInternal=function(e,t,n){var r=ve.create(e,re.dataType,re.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},u.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(l.CRITICAL,I,"trackException failed, exception will not be collected: "+j.getExceptionName(e),{exception:j.dump(e)})}},u.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({error:t.error,severityLevel:se.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(l.CRITICAL,v,"_onError threw exception while logging error, error will not be collected: "+j.getExceptionName(e),{exception:j.dump(e),errorString:r})}},u.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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=u.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=me.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}};if(this._pageViewPerformanceManager=new Se(this.core),this._pageViewManager=new ye(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new we(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new Ne(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Te]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Ne(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Te]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var a=s&&s(e,t,n,r,i);return!0!==a&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},u.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)},u.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===pe.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})}},u.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},u.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=ve.create(t,re.dataType,re.envelopeType,this._logger,{url:e});this.core.track(n)},u.prototype._setTelemetryNameAndIKey=function(e){e.iKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},u.Version="2.0.0-rc3",u}(),Ne=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(l.WARNING,R,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(l.WARNING,U,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=X.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=Ie,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 i,t,d,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=d||(d={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var u,r,g=function(){function e(){}return e.isNullOrUndefined=function(e){return null==e},e.disableCookies=function(){e._canUseCookies=!1},e.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(a,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),a=/[xy]/g;(r=u||(u={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var o=1,c=2,l=3,f=4,p=5,m=6,s=8,h=10,v=11,y=25,w=29,S=30,_=31,I=32,T=35,N=36,E=37,k=38,D=39,x=45,P=49,b=52,A=56,C=57,M=61,R=62,L=63,U=64,V=66,O=68,z=69,G=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=G}e.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(e.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),e.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<G&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(q+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];s.priority>G&&e.push(s)}if(0<e.length){(e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,i)});for(t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}}}(),500),q="Channel has invalid priority",j=function(){function s(){}return s.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=s.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,s.MAX_NAME_LENGTH-3)+s.padNumber(a);i=o}return i},s.sanitizeKey=function(e,t){var n;return t&&(t=s.trim(t.toString())).length>s.MAX_NAME_LENGTH&&(n=t.substring(0,s.MAX_NAME_LENGTH),e.throwInternal(u.WARNING,C,"name is too long. It has been truncated to "+s.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},s.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=s.MAX_STRING_LENGTH),t&&(n=n||s.MAX_STRING_LENGTH,(t=s.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(u.WARNING,M,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},s.sanitizeUrl=function(e,t){return s.sanitizeInput(e,t,s.MAX_URL_LENGTH,V)},s.sanitizeMessage=function(e,t){var n;return t&&t.length>s.MAX_MESSAGE_LENGTH&&(n=t.substring(0,s.MAX_MESSAGE_LENGTH),e.throwInternal(u.WARNING,A,"message is too long, it has been truncated to "+s.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},s.sanitizeException=function(e,t){var n;return t&&t.length>s.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,s.MAX_EXCEPTION_LENGTH),e.throwInternal(u.WARNING,b,"exception is too long, it has been truncated to "+s.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},s.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,P,"custom property is not valid",{exception:e},!0)}i=s.sanitizeString(t,i,s.MAX_PROPERTY_LENGTH),n[r=s.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},s.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=s.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},s.sanitizeId=function(e,t){return t?s.sanitizeInput(e,t,s.MAX_ID_LENGTH,z).toString():t},s.sanitizeInput=function(e,t,n,r){var i;return t&&(t=s.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},s.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.MAX_NAME_LENGTH=150,s.MAX_ID_LENGTH=128,s.MAX_PROPERTY_LENGTH=8192,s.MAX_STRING_LENGTH=1024,s.MAX_URL_LENGTH=2048,s.MAX_MESSAGE_LENGTH=32768,s.MAX_EXCEPTION_LENGTH=32768,s}(),B=function(){function s(){}return s.disableStorage=function(){s._canUseLocalStorage=!1,s._canUseSessionStorage=!1},s._getLocalStorageObject=function(){return s.canUseLocalStorage()?s._getVerifiedStorageObject(i.LocalStorage):null},s._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},s.isInternalApplicationInsightsEndpoint=function(e){return-1!==s._internalEndpoints.indexOf(e.toLowerCase())},s.canUseLocalStorage=function(){return void 0===s._canUseLocalStorage&&(s._canUseLocalStorage=!!s._getVerifiedStorageObject(i.LocalStorage)),s._canUseLocalStorage},s.getStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,o,"Browser failed read of local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setStorage=function(t,e,n){var r=s._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,l,"Browser failed write to local storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeStorage=function(t,e){var n=s._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseLocalStorage=!1,t.throwInternal(u.WARNING,p,"Browser failed removal of local storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s._getSessionStorageObject=function(){return s.canUseSessionStorage()?s._getVerifiedStorageObject(i.SessionStorage):null},s.canUseSessionStorage=function(){return void 0===s._canUseSessionStorage&&(s._canUseSessionStorage=!!s._getVerifiedStorageObject(i.SessionStorage)),s._canUseSessionStorage},s.getSessionStorageKeys=function(){var e=[];if(s.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},s.getSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,c,"Browser failed read of session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return null},s.setSessionStorage=function(t,e,n){var r=s._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,f,"Browser failed write to session storage. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.removeSessionStorage=function(t,e){var n=s._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){s._canUseSessionStorage=!1,t.throwInternal(u.WARNING,m,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){g.disableCookies()},s.canUseCookies=function(t){if(void 0===g._canUseCookies){g._canUseCookies=!1;try{g._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(u.WARNING,O,"Cannot access document.cookie - "+s.getExceptionName(e),{exception:s.dump(e)})}}return s._canUseCookies},s.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),s.document.location&&"https:"===s.document.location.protocol&&(a=";secure"),s.canUseCookies(e)&&(s.document.cookie=t+"="+n+i+";path=/"+a)},s.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},s.getCookie=function(e,t){if(s.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=s.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=s.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},s.deleteCookie=function(e,t){s.canUseCookies(e)&&(s.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},s.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},s.newId=function(){for(var e="",t=1073741824*Math.random();0<t;){e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64)}return e},s.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},s.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},s.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},s.toISOStringForIE8=function(e){if(s.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"}},s.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},s.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},s.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},s.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},s.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},s.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},s.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},s.document="undefined"!=typeof document?document:{},s._canUseCookies=void 0,s._canUseLocalStorage=void 0,s._canUseSessionStorage=void 0,s._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],s.NotSpecified="not_specified",s}(),H=function(){function r(){}return r.parseUrl=function(e){return r.htmlAnchorElement||(r.htmlAnchorElement=r.document.createElement?r.document.createElement("a"):{}),r.htmlAnchorElement.href=e,r.htmlAnchorElement},r.getAbsoluteUrl=function(e){var t,n=r.parseUrl(e);return n&&(t=n.href),t},r.getPathName=function(e){var t,n=r.parseUrl(e);return n&&(t=n.pathname),t},r.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},r.document="undefined"!=typeof document?document:{},r}(),K=function(){function e(){}return e.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=H.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=j.sanitizeString(e,n?n+" "+c:c)}else a=j.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),X=function(){function e(){}return e.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()},e.GetDuration=function(e,t){var n=null;return 0===e||0===t||g.isNullOrUndefined(e)||g.isNullOrUndefined(t)||(n=t-e),n},e}(),W=function(e,t){return(W=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 F(e,t){function n(){this.constructor=e}W(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var J,Q,Y=function(){return(Y=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)},$=function(e){function t(){return e.call(this)||this}return F(t,e),t}(function(){}),Z=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=j.sanitizeString(e,n)||B.NotSpecified,r.data=t,r.time=B.toISOStringForIE8(new Date),r.aiDataContract={time:d.Required,iKey:d.Required,name:d.Required,sampleRate:function(){return 100==r.sampleRate?d.Hidden:d.Required},tags:d.Required,data:d.Required},r}F(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),ee=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(Z),te=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,name:d.Required,properties:d.Default,measurements:d.Default},i.name=j.sanitizeString(e,t)||B.NotSpecified,i.properties=j.sanitizeProperties(e,n),i.measurements=j.sanitizeMeasurements(e,r),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData",e}(ee),ne=function(){},re=function(){this.hasFullStack=!0,this.parsedStack=[]},ie=function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:d.Required,exceptions:d.Required,severityLevel:d.Default,properties:d.Default,measurements:d.Default},t instanceof Error?(a.exceptions=[new ae(e,t)],a.properties=j.sanitizeProperties(e,n),a.measurements=j.sanitizeMeasurements(e,r),i&&(a.severityLevel=i)):(a.exceptions=t.exceptions,a.properties=t.properties,a.measurements=t.measurements,t.severityLevel&&(a.severityLevel=t.severityLevel)),a}return F(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ae.CreateFromInterface(t,e)});return new r(t,Y({},e,{exceptions:n}))},r.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},r.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},r.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",r.dataType="ExceptionData",r}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return F(e,t),e}(Z)),ae=function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:d.Default,outerId:d.Default,typeName:d.Required,message:d.Required,hasFullStack:d.Default,stack:d.Default,parsedStack:d.Array},t instanceof Error){n.typeName=j.sanitizeString(e,t.name)||B.NotSpecified,n.message=j.sanitizeMessage(e,t.message)||B.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=j.sanitizeException(e,r),n.hasFullStack=B.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}return F(a,i),a.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}},a.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return oe.CreateFromInterface(e)})||t.parsedStack;return new a(e,Y({},t,{parsedStack:n}))},a.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(oe.regex.test(o)){var s=new oe(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,l=t.length-1,u=0,g=c,f=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var p=f-g+1;t.splice(g,p);break}g=c,f=l,c++,l--}}return t},a}(re),oe=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:d.Required,method:d.Required,assembly:d.Default,fileName:d.Default,line:d.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=B.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=B.trim(i[2])||n.method,n.fileName=B.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+=o.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}return F(o,a),o.CreateFromInterface=function(e){return new o(e,null)},o.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},o.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,o.baseSize=58,o}(ne),se=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return F(e,t),e}(Z);(Q=J||(J={}))[Q.Measurement=0]="Measurement",Q[Q.Aggregation=1]="Aggregation";var ce,le,ue=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:d.Required,kind:d.Default,value:d.Required,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default},e}return F(e,t),e}(function(){this.kind=J.Measurement}),ge=function(l){function e(e,t,n,r,i,a,o){var s=l.call(this)||this;s.aiDataContract={ver:d.Required,metrics:d.Required,properties:d.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=j.sanitizeString(e,t)||B.NotSpecified,c.value=n,s.metrics=[c],s.properties=j.sanitizeProperties(e,o),s}return F(e,l),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData",e}(se),fe=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(ee),pe=function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,properties:d.Default,measurements:d.Default,id:d.Default},s.id=j.sanitizeId(e,o),s.url=j.sanitizeUrl(e,n),s.name=j.sanitizeString(e,t)||B.NotSpecified,isNaN(r)||(s.duration=B.msToTimeSpan(r)),s.properties=j.sanitizeProperties(e,i),s.measurements=j.sanitizeMeasurements(e,a),s}return F(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData",e}(fe),de=function(p){function e(e,t,n,r,i,a,o,s,c,l,u){void 0===c&&(c="Ajax");var g=p.call(this)||this;g.aiDataContract={id:d.Required,ver:d.Required,name:d.Default,resultCode:d.Default,duration:d.Default,success:d.Default,data:d.Default,target:d.Default,type:d.Default,properties:d.Default,measurements:d.Default,kind:d.Default,value:d.Default,count:d.Default,min:d.Default,max:d.Default,stdDev:d.Default,dependencyKind:d.Default,dependencySource:d.Default,commandName:d.Default,dependencyTypeName:d.Default},g.id=t,g.duration=B.msToTimeSpan(i),g.success=a,g.resultCode=o+"",g.type=j.sanitizeString(e,c);var f=K.ParseDependencyPath(e,n,s,r);return g.data=j.sanitizeUrl(e,r)||f.data,g.target=f.target,g.name=f.name,g.properties=j.sanitizeProperties(e,l),g.measurements=j.sanitizeMeasurements(e,u),g}return F(e,p),e.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",e.dataType="RemoteDependencyData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}return F(e,t),e}(Z)),me=function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:d.Required,message:d.Required,severityLevel:d.Default,properties:d.Default},t=t||B.NotSpecified,i.message=j.sanitizeMessage(e,t),i.properties=j.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}return F(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return F(e,t),e}(Z)),he=function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:d.Required,name:d.Default,url:d.Default,duration:d.Default,perfTotal:d.Default,networkConnect:d.Default,sentRequest:d.Default,receivedResponse:d.Default,domProcessing:d.Default,properties:d.Default,measurements:d.Default},o.url=j.sanitizeUrl(e,n),o.name=j.sanitizeString(e,t)||B.NotSpecified,o.properties=j.sanitizeProperties(e,i),o.measurements=j.sanitizeMeasurements(e,a),o}return F(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData",e}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return F(e,t),e}(fe));!function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:d.Required,baseData:d.Required},n.baseType=e,n.baseData=t,n}F(e,r)}($);(le=ce||(ce={}))[le.Verbose=0]="Verbose",le[le.Information=1]="Information",le[le.Warning=2]="Warning",le[le.Error=3]="Error",le[le.Critical=4]="Critical";var ve=function(){function e(){}return e.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},e}(),ye=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=j.sanitizeString(r,n)||B.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},e}(),we=function(){function e(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)}return e.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,y,"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=X.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<X.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,k,"trackPageView failed on page load calculation: "+B.getExceptionName(e),{exception:B.dump(e)})}},100)},e}(),Se=function(){function e(e,t){this.prevPageVisitDataKeyName="prevPageVisitData",this.pageVisitTimeTrackingHandler=t,this._logger=e}return e.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: "+B.dump(e))}},e.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: "+B.dump(e)),null}},e.prototype.startPageVisitTimer=function(e,t){try{if(B.canUseSessionStorage()){if(null!=B.getSessionStorage(this._logger,this.prevPageVisitDataKeyName))throw new Error("Cannot call startPageVisit consecutively without first calling stopPageVisit");var n=new _e(e,t),r=JSON.stringify(n);B.setSessionStorage(this._logger,this.prevPageVisitDataKeyName,r)}}catch(e){this._logger.warnToConsole("Call to start failed: "+B.dump(e))}},e.prototype.stopPageVisitTimer=function(){try{if(B.canUseSessionStorage()){var e=Date.now(),t=B.getSessionStorage(this._logger,this.prevPageVisitDataKeyName);if(t){var n=JSON.parse(t);return n.pageVisitTime=e-n.pageVisitStartTime,B.removeSessionStorage(this._logger,this.prevPageVisitDataKeyName),n}return null}return null}catch(e){return this._logger.warnToConsole("Stop page visit timer failed: "+B.dump(e)),null}},e}(),_e=function(e,t){this.pageVisitStartTime=Date.now(),this.pageName=e,this.pageUrl=t},Ie=function(){function e(e){this.MAX_DURATION_ALLOWED=36e5,e&&(this._logger=e.logger)}return e.prototype.populatePageViewPerformanceEvent=function(e){e.isValid=!1;var t=this.getPerformanceTiming();if(t){var n=X.GetDuration(t.navigationStart,t.loadEventEnd),r=X.GetDuration(t.navigationStart,t.connectEnd),i=X.GetDuration(t.requestStart,t.responseStart),a=X.GetDuration(t.responseStart,t.responseEnd),o=X.GetDuration(t.responseEnd,t.loadEventEnd);0==n?this._logger.throwInternal(u.WARNING,h,"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,s,"client performance math error.",{total:n,network:r,request:i,response:a,dom:o}):(e.durationMs=n,e.perfTotal=e.duration=B.msToTimeSpan(n),e.networkConnect=B.msToTimeSpan(r),e.sentRequest=B.msToTimeSpan(i),e.receivedResponse=B.msToTimeSpan(a),e.domProcessing=B.msToTimeSpan(o),e.isValid=!0):this._logger.throwInternal(u.WARNING,x,"Invalid page load duration value. Browser perf data won't be sent.",{total:n,network:r,request:i,response:a,dom:o})}},e.prototype.getPerformanceTiming=function(){return this.isPerformanceTimingSupported()?window.performance.timing:null},e.prototype.isPerformanceTimingSupported=function(){return"undefined"!=typeof window&&window.performance&&window.performance.timing},e.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},e.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},e}(),Te="duration",Ne=function(){function l(){this.identifier="ApplicationInsightsAnalytics",this.priority=160,this._isInitialized=!1,this._trackAjaxAttempts=0,this.initialize=this._initialize.bind(this)}return l.getDefaultConfig=function(e){return e||(e={}),e.sessionRenewalMs=18e5,e.sessionExpirationMs=864e5,e.disableExceptionTracking=B.stringToBoolOrDefault(e.disableExceptionTracking),e.autoTrackPageVisitTime=B.stringToBoolOrDefault(e.autoTrackPageVisitTime),e.overridePageViewDuration=B.stringToBoolOrDefault(e.overridePageViewDuration),(isNaN(e.samplingPercentage)||e.samplingPercentage<=0||100<=e.samplingPercentage)&&(e.samplingPercentage=100),e.isCookieUseDisabled=B.stringToBoolOrDefault(e.isCookieUseDisabled),e.isStorageUseDisabled=B.stringToBoolOrDefault(e.isStorageUseDisabled),e.isBrowserLinkTrackingEnabled=B.stringToBoolOrDefault(e.isBrowserLinkTrackingEnabled),e},l.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,U,"One of telemetry initializers failed, telemetry item will not be sent: "+B.getExceptionName(e),{exception:B.dump(e)},!0)}}t||g.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},l.prototype.setNextPlugin=function(e){this._nextPlugin=e},l.prototype.trackEvent=function(e,t){try{var n=ye.create(e,te.dataType,te.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,D,"trackTrace failed, trace will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.startTrackEvent=function(e){try{this._eventTracking.start(e)}catch(e){this._logger.throwInternal(u.CRITICAL,w,"startTrackEvent failed, event will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.stopTrackEvent=function(e,t,n){try{this._eventTracking.stop(e,void 0,t)}catch(e){this._logger.throwInternal(u.CRITICAL,S,"stopTrackEvent failed, event will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackTrace=function(e,t){try{var n=ye.create(e,me.dataType,me.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.WARNING,D,"trackTrace failed, trace will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackMetric=function(e,t){try{var n=ye.create(e,ge.dataType,ge.envelopeType,this._logger,t);this._setTelemetryNameAndIKey(n),this.core.track(n)}catch(e){this._logger.throwInternal(u.CRITICAL,N,"trackMetric failed, metric will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.trackPageView=function(e,t){try{var n=e||{};this._pageViewManager.trackPageView(n,t),this.config.autoTrackPageVisitTime&&this._pageVisitTimeManager.trackPreviousPageVisit(n.name,n.uri)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"trackPageView failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.sendPageViewInternal=function(e,t,n){"undefined"!=typeof document&&(e.refUri=e.refUri||document.referrer);var r=ye.create(e,pe.dataType,pe.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r),this._trackAjaxAttempts=0},l.prototype.sendPageViewPerformanceInternal=function(e,t,n){var r=ye.create(e,he.dataType,he.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(r),this.core.track(r)},l.prototype.trackPageViewPerformance=function(e,t){try{this._pageViewPerformanceManager.populatePageViewPerformanceEvent(e),this.sendPageViewPerformanceInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,E,"trackPageViewPerformance failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.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,_,"startTrackPage failed, page view may not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.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,I,"stopTrackPage failed, page view will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype.sendExceptionInternal=function(e,t,n){var r=new ie(this._logger,e.error,e.properties,e.measurements,e.severityLevel).toInterface(),i=ye.create(r,ie.dataType,ie.envelopeType,this._logger,t,n);this._setTelemetryNameAndIKey(i),this.core.track(i)},l.prototype.trackException=function(e,t){try{this.sendExceptionInternal(e,t)}catch(e){this._logger.throwInternal(u.CRITICAL,T,"trackException failed, exception will not be collected: "+B.getExceptionName(e),{exception:B.dump(e)})}},l.prototype._onerror=function(t){try{var e={url:t&&t.url||document.URL,lineNumber:t.lineNumber,columnNumber:t.columnNumber,message:t.message};if(B.isCrossOriginError(t.message,t.url,t.lineNumber,t.columnNumber,t.error))this._sendCORSException(e.url);else{if(!B.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({error:t.error,severityLevel:ce.Error},e)}}catch(e){var r=t.error?t.error.name+", "+t.error.message:"null";this._logger.throwInternal(u.CRITICAL,v,"_onError threw exception while logging error, error will not be collected: "+B.getExceptionName(e),{exception:B.dump(e),errorString:r})}},l.prototype.addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},l.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=l.getDefaultConfig();if(void 0!==r){for(var i in r)this.config[i]=ve.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&&B.disableCookies(),this.config.isStorageUseDisabled&&B.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}};if(this._pageViewPerformanceManager=new Ie(this.core),this._pageViewManager=new we(this,this.config.overridePageViewDuration,this.core,this._pageViewPerformanceManager),this._pageVisitTimeManager=new Se(this._logger,function(e,t,n){return o.trackPageVisitTime(e,t,n)}),this._telemetryInitializers=[],this._addDefaultTelemetryInitializers(a),this._eventTracking=new Ee(this._logger,"trackEvent"),this._eventTracking.action=function(e,t,n,r){r||(r={}),r[Te]=n.toString(),o.trackEvent({name:e,properties:r})},this._pageTracking=new Ee(this._logger,"trackPageView"),!(this._pageTracking.action=function(e,t,n,r,i){g.isNullOrUndefined(r)&&(r={}),r[Te]=n.toString();var a={name:e,uri:t,properties:r,measurements:i};o.sendPageViewInternal(a)})===this.config.disableExceptionTracking&&!this.config.autoExceptionInstrumented){var s=window.onerror,c=this;window.onerror=function(e,t,n,r,i){var a=s&&s(e,t,n,r,i);return!0!==a&&c._onerror({message:e,url:t,lineNumber:n,columnNumber:r,error:i}),a},this.config.autoExceptionInstrumented=!0}this._isInitialized=!0}},l.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)},l.prototype._addDefaultTelemetryInitializers=function(e){if(!e.isBrowserLinkTrackingEnabled()){var r=["/browserLinkSignalR/","/__browserLink/"];this._addTelemetryInitializer(function(e){if(e.baseType===de.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})}},l.prototype._addTelemetryInitializer=function(e){this._telemetryInitializers.push(e)},l.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=ye.create(t,ie.dataType,ie.envelopeType,this._logger,{url:e});this.core.track(n)},l.prototype._setTelemetryNameAndIKey=function(e){e.iKey=this._globalconfig.instrumentationKey;var t=this._globalconfig.instrumentationKey.replace(/-/g,"");e.name=e.name.replace("{0}",t)},l.Version="2.0.0-rc4",l}(),Ee=function(){function e(e,t){this._name=t,this._events={},this._logger=e}return e.prototype.start=function(e){void 0!==this._events[e]&&this._logger.throwInternal(u.WARNING,R,"start was called more than once for this event without calling stop.",{name:this._name,key:e},!0),this._events[e]=+new Date},e.prototype.stop=function(e,t,n,r){var i=this._events[e];if(isNaN(i))this._logger.throwInternal(u.WARNING,L,"stop was called without a corresponding start.",{name:this._name,key:e},!0);else{var a=+new Date,o=X.GetDuration(i,a);this.action(e,t,o,n,r)}delete this._events[e],this._events[e]=void 0},e}();e.ApplicationInsights=Ne,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-analytics-js.min.js.map
{
"name": "@microsoft/applicationinsights-analytics-js",
"version": "2.0.0-rc3",
"version": "2.0.0-rc4",
"description": "Microsoft Application Insights Javascript SDK apis",

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

"dependencies": {
"@microsoft/applicationinsights-core-js": "2.0.0-rc3",
"@microsoft/applicationinsights-common": "2.0.0-rc3",
"@microsoft/applicationinsights-core-js": "2.0.0-rc4",
"@microsoft/applicationinsights-common": "2.0.0-rc4",
"tslib": "^1.9.3"

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

@@ -11,3 +11,4 @@ /**

IPageViewTelemetryInternal, IPageViewTelemetry, IPageViewPerformanceTelemetry, IPageViewPerformanceTelemetryInternal,
ConfigurationManager, DateTimeUtils
ConfigurationManager, DateTimeUtils,
IExceptionInternal
} from "@microsoft/applicationinsights-common";

@@ -30,3 +31,3 @@

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

@@ -371,4 +372,12 @@ public identifier: string = "ApplicationInsightsAnalytics"; // do not change name or priority

public sendExceptionInternal(exception: IExceptionTelemetry, customProperties?: { [key: string]: any }, systemProperties?: { [key: string]: any }) {
let telemetryItem: ITelemetryItem = TelemetryItemCreator.create<IExceptionTelemetry>(
exception,
const exceptionPartB = new Exception(
this._logger,
exception.error,
exception.properties,
exception.measurements,
exception.severityLevel
).toInterface();
let telemetryItem: ITelemetryItem = TelemetryItemCreator.create<IExceptionInternal>(
exceptionPartB,
Exception.dataType,

@@ -380,5 +389,3 @@ Exception.envelopeType,

);
this._setTelemetryNameAndIKey(telemetryItem);
this.core.track(telemetryItem);

@@ -385,0 +392,0 @@ }

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is 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