@microsoft/applicationinsights-dependencies-js
Advanced tools
Comparing version 2.0.0-rc4 to 2.0.0-rc5
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc4 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc5 | ||
* 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,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var a,r,c=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(o,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),o=/[xy]/g;(r=a||(a={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var u=1,l=2,d=3,f=4,p=5,g=6,s=13,m=14,v=15,x=16,y=17,D=18,S=49,I=52,C=55,N=56,w=57,A=61,_=66,M=68,b=69,T=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=T}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&&c.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<T&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+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>T&&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),j="Channel has invalid priority",R=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=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(a.WARNING,w,"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(a.WARNING,A,"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,_)},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(a.WARNING,N,"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(a.WARNING,I,"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(a.WARNING,S,"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,b).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(a.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}(),U=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(a.WARNING,u,"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(a.WARNING,d,"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(a.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(a.WARNING,l,"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(a.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(a.WARNING,g,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){c.disableCookies()},s.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(a.WARNING,M,"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}(),q=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}(),L=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=q.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var i=e&&e.correlationHeaderExcludedDomains;if(!i||0==i.length)return!0;for(var a=0;a<i.length;a++){if(new RegExp(i[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,R.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var i=n[r].split("=");if(2==i.length&&i[0]==t)return i[1]}},n.correlationIdPrefix="cid-v1:",n}(),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=q.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=E.sanitizeString(e,n?n+" "+c:c)}else a=E.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),F=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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),H="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",O=function(e,t){return(O=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 z(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var P,G,X=function(){return(X=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)},W=function(e){function t(){return e.call(this)||this}return z(t,e),t}(function(){}),B=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=E.sanitizeString(e,n)||U.NotSpecified,r.data=t,r.time=U.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}z(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),V=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(B),K=(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=E.sanitizeString(e,t)||U.NotSpecified,i.properties=E.sanitizeProperties(e,n),i.measurements=E.sanitizeMeasurements(e,r),i}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(V),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},J=(function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(a.exceptions=[new J(e,t)],a.properties=E.sanitizeProperties(e,n),a.measurements=E.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}z(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return J.CreateFromInterface(t,e)});return new r(t,X({},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"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return z(e,t),e}(B)),function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=E.sanitizeString(e,t.name)||U.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||U.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=E.sanitizeException(e,r),n.hasFullStack=U.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 z(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 Y.CreateFromInterface(e)})||t.parsedStack;return new a(e,X({},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(Y.regex.test(o)){var s=new Y(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=c,f=u,c++,u--}}return t},a}(Q)),Y=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=U.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=U.trim(i[2])||n.method,n.fileName=U.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 z(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}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return z(e,t),e}(B);(G=P||(P={}))[G.Measurement=0]="Measurement",G[G.Aggregation=1]="Aggregation";var Z,ee,te=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return z(e,t),e}(function(){this.kind=P.Measurement}),ne=(function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new te;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=E.sanitizeString(e,t)||U.NotSpecified,c.value=n,s.metrics=[c],s.properties=E.sanitizeProperties(e,o),s}z(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(V)),re=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||U.NotSpecified,isNaN(r)||(s.duration=U.msToTimeSpan(r)),s.properties=E.sanitizeProperties(e,i),s.measurements=E.sanitizeMeasurements(e,a),s}z(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=p.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=U.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=E.sanitizeString(e,c);var f=k.ParseDependencyPath(e,n,s,r);return d.data=E.sanitizeUrl(e,r)||f.data,d.target=f.target,d.name=f.name,d.properties=E.sanitizeProperties(e,u),d.measurements=E.sanitizeMeasurements(e,l),d}return z(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 z(e,t),e}(B)));(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||U.NotSpecified,i.message=E.sanitizeMessage(e,t),i.properties=E.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return z(e,t),e}(B)),function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||U.NotSpecified,o.properties=E.sanitizeProperties(e,i),o.measurements=E.sanitizeMeasurements(e,a),o}z(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(ne)),function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}z(e,r)}(W);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ie=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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(i)?r:i},e}(),ae=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=E.sanitizeString(r,n)||U.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),oe=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},se=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new oe,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*F.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?q.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?E.sanitizeUrl(this._logger,q.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ce=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),ue=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,r){var i=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,i="object"==typeof n&&!0===n[H]||!!r&&!0===r[H]):void 0!==e&&(o=this.initialized,i=!0===e[H],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!i},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,i=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!i.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||i.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return r.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,r){var i;i=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+U.newId():U.newId();var a=new se(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(a.CRITICAL,y,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=F.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(a.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var r=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ce.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=U.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:U.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=F.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(R.requestContextHeaderLowerCase)){var n=t.getResponseHeader(R.requestContextHeader);return L.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ae.create(e,re.dataType,re.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(a.CRITICAL,C,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,i=this;window.fetch=function(t,e){var n;if(i.isFetchInstrumented(t)&&i.isMonitoredInstance(void 0,void 0,t,e))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}return r(t,e).then(function(e){return i.onFetchComplete(e,n),e}).catch(function(e){throw i.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[H]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+U.newId():U.newId();var r=new se(n,this._core.logger);return r.requestSentTime=F.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},o.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(L.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(R.requestIdHeader,e.id);var i=this._config.appId;return i&&n.headers.set(R.requestContextHeader,R.requestContextAppIdFormat+i),n}return n}if(r){if(this.currentWindowHost&&L.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(R.requestIdHeader,r.ajaxData.id);var a=this._config.appId;a&&r.setRequestHeader(R.requestContextHeader,R.requestContextAppIdFormat+a)}return r}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(a.CRITICAL,v,"Failed to grab failed fetch diagnostics message",{exception:U.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(R.requestContextHeader);return L.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=o.getDefaultConfig();for(var i in this._config=o.getEmptyConfig(),r)this._config[i]=ie.getConfig(e,i,o.identifier,r[i]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=ue,e.ajaxRecord=se,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var P=(G.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},G.getCorrelationContext=function(e){if(e){var t=G.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==G.correlationIdPrefix)return t}},G.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},G.correlationIdPrefix="cid-v1:",G);function G(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=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 J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel)),i}var me,ve=(J(xe,me=he),xe.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}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Pe,Oe=Fe),Pe.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Pe.dataType="RemoteDependencyData",Pe);function Pe(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Ge,Xe=(J(We,Ge=re),We);function We(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i){var o=Ye.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=L.sanitizeUrl(e,n),o.name=L.sanitizeString(e,t)||F.NotSpecified,o.properties=L.sanitizeProperties(e,a),o.measurements=L.sanitizeMeasurements(e,i),o}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},ht.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},ht.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return P.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(P.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&P.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return P.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
@@ -11,3 +11,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
this.identifier = AjaxMonitor.identifier; | ||
this.priority = 161; | ||
this.priority = 171; | ||
this.currentWindowHost = window && window.location && window.location.host && window.location.host.toLowerCase(); | ||
@@ -74,3 +74,3 @@ this.initialized = false; | ||
catch (e) { | ||
this._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { | ||
ajaxMonitorInstance._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxOpen, "Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.", { | ||
ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), | ||
@@ -121,3 +121,3 @@ exception: Util.dump(e) | ||
catch (e) { | ||
this._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { | ||
ajaxMonitorInstance._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxSend, "Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.", { | ||
ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), | ||
@@ -146,3 +146,3 @@ exception: Util.dump(e) | ||
catch (e) { | ||
this._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { | ||
ajaxMonitorInstance._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxAbort, "Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.", { | ||
ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(this), | ||
@@ -156,3 +156,2 @@ exception: Util.dump(e) | ||
AjaxMonitor.prototype.attachToOnReadyStateChange = function (xhr) { | ||
var _this = this; | ||
var ajaxMonitorInstance = this; | ||
@@ -171,3 +170,3 @@ xhr.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached = EventHelper.AttachEvent(xhr, "readystatechange", function () { | ||
if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { | ||
_this._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { | ||
ajaxMonitorInstance._core.logger.throwInternal(LoggingSeverity.CRITICAL, _InternalMessageId.FailedMonitorAjaxRSC, "Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.", { | ||
ajaxDiagnosticsMessage: AjaxMonitor.getFailedAjaxDiagnosticsMessage(xhr), | ||
@@ -340,3 +339,3 @@ exception: Util.dump(e) | ||
init.headers.set(RequestHeaders.requestIdHeader, ajaxData.id); | ||
var appId_1 = this._config.appId; | ||
var appId_1 = this._config.appId || this._context.appId(); | ||
if (appId_1) { | ||
@@ -352,3 +351,3 @@ init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId_1); | ||
xhr.setRequestHeader(RequestHeaders.requestIdHeader, xhr.ajaxData.id); | ||
var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it | ||
var appId = this._config.appId || this._context.appId(); | ||
if (appId) { | ||
@@ -517,3 +516,9 @@ xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId); | ||
if (extensions.length > 0 && extensions) { | ||
var propExt = extensions[PropertiesPluginIdentifier]; | ||
var propExt = void 0, extIx = 0; | ||
while (!propExt && extIx < extensions.length) { | ||
if (extensions[extIx] && extensions[extIx].identifier === PropertiesPluginIdentifier) { | ||
propExt = extensions[extIx]; | ||
} | ||
extIx++; | ||
} | ||
if (propExt) { | ||
@@ -520,0 +525,0 @@ this._context = propExt.context; // we could move IPropertiesPlugin to common as well |
/*! | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc4 | ||
* Application Insights JavaScript SDK - Dependencies Plugin, 2.0.0-rc5 | ||
* 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,h,n;(t=i||(i={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var a,r,c=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(o,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},e}(),o=/[xy]/g;(r=a||(a={}))[r.CRITICAL=1]="CRITICAL",r[r.WARNING=2]="WARNING";var u=1,l=2,d=3,f=4,p=5,g=6,s=13,m=14,v=15,x=16,y=17,D=18,S=49,I=52,C=55,N=56,w=57,A=61,_=66,M=68,b=69,T=(function(){function e(){this.identifier="ChannelControllerPlugin",this.priority=T}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&&c.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<T&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error(j+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>T&&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),j="Channel has invalid priority",R=function(){function e(){}return e.requestContextHeader="Request-Context",e.requestContextTargetKey="appId",e.requestContextAppIdFormat="appId=cid-v1:",e.requestIdHeader="Request-Id",e.sdkContextHeader="Sdk-Context",e.sdkContextHeaderAppIdRequest="appId",e.requestContextHeaderLowerCase="request-context",e}(),E=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(a.WARNING,w,"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(a.WARNING,A,"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,_)},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(a.WARNING,N,"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(a.WARNING,I,"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(a.WARNING,S,"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,b).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(a.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}(),U=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(a.WARNING,u,"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(a.WARNING,d,"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(a.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(a.WARNING,l,"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(a.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(a.WARNING,g,"Browser failed removal of session storage item. "+s.getExceptionName(e),{exception:s.dump(e)})}return!1},s.disableCookies=function(){c.disableCookies()},s.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==s.document.cookie}catch(e){t.throwInternal(a.WARNING,M,"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}(),q=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}(),L=function(){function n(){}return n.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=q.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var i=e&&e.correlationHeaderExcludedDomains;if(!i||0==i.length)return!0;for(var a=0;a<i.length;a++){if(new RegExp(i[a].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1}return!0},n.getCorrelationContext=function(e){if(e){var t=n.getCorrelationContextValue(e,R.requestContextTargetKey);if(t&&t!==n.correlationIdPrefix)return t}},n.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var i=n[r].split("=");if(2==i.length&&i[0]==t)return i[1]}},n.correlationIdPrefix="cid-v1:",n}(),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=q.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=E.sanitizeString(e,n?n+" "+c:c)}else a=E.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},e}(),F=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||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},e}(),H="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",O=function(e,t){return(O=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 z(e,t){function n(){this.constructor=e}O(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var P,G,X=function(){return(X=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)},W=function(e){function t(){return e.call(this)||this}return z(t,e),t}(function(){}),B=(function(i){function e(e,t,n){var r=i.call(this)||this;return r.name=E.sanitizeString(e,n)||U.NotSpecified,r.data=t,r.time=U.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}z(e,i)}(function(){this.ver=1,this.sampleRate=100,this.tags={}}),function(){}),V=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(B),K=(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=E.sanitizeString(e,t)||U.NotSpecified,i.properties=E.sanitizeProperties(e,n),i.measurements=E.sanitizeMeasurements(e,r),i}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Event",e.dataType="EventData"}(V),function(){}),Q=function(){this.hasFullStack=!0,this.parsedStack=[]},J=(function(o){function r(e,t,n,r,i){var a=o.call(this)||this;return a.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(a.exceptions=[new J(e,t)],a.properties=E.sanitizeProperties(e,n),a.measurements=E.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}z(r,o),r.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return J.CreateFromInterface(t,e)});return new r(t,X({},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"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}return z(e,t),e}(B)),function(i){function a(e,t){var n=i.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=E.sanitizeString(e,t.name)||U.NotSpecified,n.message=E.sanitizeMessage(e,t.message)||U.NotSpecified;var r=t.stack;n.parsedStack=a.parseStack(r),n.stack=E.sanitizeException(e,r),n.hasFullStack=U.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 z(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 Y.CreateFromInterface(e)})||t.parsedStack;return new a(e,X({},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(Y.regex.test(o)){var s=new Y(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var c=0,u=t.length-1,l=0,d=c,f=u;c<u;){if(32768<(l+=t[c].sizeInBytes+t[u].sizeInBytes)){var p=f-d+1;t.splice(d,p);break}d=c,f=u,c++,u--}}return t},a}(Q)),Y=function(a){function o(e,t){var n=a.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=U.trim(r),n.fileName="",n.line=0;var i=r.match(o.regex);i&&5<=i.length&&(n.method=U.trim(i[2])||n.method,n.fileName=U.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 z(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}(K),$=function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}return z(e,t),e}(B);(G=P||(P={}))[G.Measurement=0]="Measurement",G[G.Aggregation=1]="Aggregation";var Z,ee,te=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}return z(e,t),e}(function(){this.kind=P.Measurement}),ne=(function(u){function e(e,t,n,r,i,a,o){var s=u.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new te;return c.count=0<r?r:void 0,c.max=isNaN(a)||null===a?void 0:a,c.min=isNaN(i)||null===i?void 0:i,c.name=E.sanitizeString(e,t)||U.NotSpecified,c.value=n,s.metrics=[c],s.properties=E.sanitizeProperties(e,o),s}z(e,u),e.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",e.dataType="MetricData"}($),function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(V)),re=(function(c){function e(e,t,n,r,i,a,o){var s=c.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=E.sanitizeId(e,o),s.url=E.sanitizeUrl(e,n),s.name=E.sanitizeString(e,t)||U.NotSpecified,isNaN(r)||(s.duration=U.msToTimeSpan(r)),s.properties=E.sanitizeProperties(e,i),s.measurements=E.sanitizeMeasurements(e,a),s}z(e,c),e.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",e.dataType="PageviewData"}(ne),function(p){function e(e,t,n,r,i,a,o,s,c,u,l){void 0===c&&(c="Ajax");var d=p.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=U.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=E.sanitizeString(e,c);var f=k.ParseDependencyPath(e,n,s,r);return d.data=E.sanitizeUrl(e,r)||f.data,d.target=f.target,d.name=f.name,d.properties=E.sanitizeProperties(e,u),d.measurements=E.sanitizeMeasurements(e,l),d}return z(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 z(e,t),e}(B)));(function(a){function e(e,t,n,r){var i=a.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||U.NotSpecified,i.message=E.sanitizeMessage(e,t),i.properties=E.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}z(e,a),e.envelopeType="Microsoft.ApplicationInsights.{0}.Message",e.dataType="MessageData"})(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e}return z(e,t),e}(B)),function(s){function e(e,t,n,r,i,a){var o=s.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=E.sanitizeUrl(e,n),o.name=E.sanitizeString(e,t)||U.NotSpecified,o.properties=E.sanitizeProperties(e,i),o.measurements=E.sanitizeMeasurements(e,a),o}z(e,s),e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",e.dataType="PageviewPerformanceData"}(function(t){function e(){var e=t.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}return z(e,t),e}(ne)),function(r){function e(e,t){var n=r.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}z(e,r)}(W);(ee=Z||(Z={}))[ee.Verbose=0]="Verbose",ee[ee.Information=1]="Information",ee[ee.Warning=2]="Warning",ee[ee.Error=3]="Error",ee[ee.Critical=4]="Critical";var ie=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]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(i)?r:i},e}(),ae=function(){function e(){}return e.create=function(e,t,n,r,i,a){if(n=E.sanitizeString(r,n)||U.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:a||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(i))for(var s in i)i.hasOwnProperty(s)&&(o.data[s]=i[s]);return o},e}(),oe=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},se=function(){function e(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new oe,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*F.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}return e.prototype.getAbsoluteUrl=function(){return this.requestUrl?q.getAbsoluteUrl(this.requestUrl):null},e.prototype.getPathName=function(){return this.requestUrl?E.sanitizeUrl(this._logger,q.getCompleteUrl(this.method,this.requestUrl)):null},e}(),ce=function(){function e(){}return e.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},e.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},e}(),ue=function(){function o(){this._trackAjaxAttempts=0,this.identifier=o.identifier,this.priority=161,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}return o.prototype.isMonitoredInstance=function(e,t,n,r){var i=!1,a=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,i="object"==typeof n&&!0===n[H]||!!r&&!0===r[H]):void 0!==e&&(o=this.initialized,i=!0===e[H],a=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&a&&!i},o.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},o.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,i=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!i.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||i.openHandler(this,e,t,n)}catch(e){this._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return r.apply(this,arguments)}},o.prototype.openHandler=function(e,t,n,r){var i;i=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+U.newId():U.newId();var a=new se(i,this._core.logger);a.method=t,a.requestUrl=n,a.xhrMonitoringState.openDone=!0,e.ajaxData=a,this.attachToOnReadyStateChange(e)},o.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},o.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){this._core.logger.throwInternal(a.CRITICAL,y,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return t.apply(this,arguments)}},o.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=F.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},o.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){this._core.logger.throwInternal(a.CRITICAL,s,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(this),exception:U.dump(e)})}return e.apply(this,arguments)}},o.prototype.attachToOnReadyStateChange=function(n){var r=this,e=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ce.AttachEvent(n,"readystatechange",function(){try{e.isMonitoredInstance(n)&&4===n.readyState&&e.onAjaxComplete(n)}catch(e){var t=U.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(a.CRITICAL,x,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(n),exception:U.dump(e)})}})},o.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=F.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},o.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e)if(-1!==e.toLowerCase().indexOf(R.requestContextHeaderLowerCase)){var n=t.getResponseHeader(R.requestContextHeader);return L.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:o.getFailedAjaxDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=ae.create(e,re.dataType,re.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(a.CRITICAL,C,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},o.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},o.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},o.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},o.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,i=this;window.fetch=function(t,e){var n;if(i.isFetchInstrumented(t)&&i.isMonitoredInstance(void 0,void 0,t,e))try{n=i.createFetchRecord(t,e),e=i.includeCorrelationHeaders(n,t,e)}catch(e){i._core.logger.throwInternal(a.CRITICAL,v,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}return r(t,e).then(function(e){return i.onFetchComplete(e,n),e}).catch(function(e){throw i.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},o.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[H]},o.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},o.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+U.newId():U.newId();var r=new se(n,this._core.logger);return r.requestSentTime=F.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},o.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(L.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(R.requestIdHeader,e.id);var i=this._config.appId;return i&&n.headers.set(R.requestContextHeader,R.requestContextAppIdFormat+i),n}return n}if(r){if(this.currentWindowHost&&L.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(R.requestIdHeader,r.ajaxData.id);var a=this._config.appId;a&&r.setRequestHeader(R.requestContextHeader,R.requestContextAppIdFormat+a)}return r}},o.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(a.CRITICAL,v,"Failed to grab failed fetch diagnostics message",{exception:U.dump(e)})}return t},o.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=F.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(a.WARNING,m,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(R.requestContextHeader);return L.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(a.WARNING,D,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:U.dump(e)})}},o.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},o.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},o.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},o.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=o.getDefaultConfig();for(var i in this._config=o.getEmptyConfig(),r)this._config[i]=ie.getConfig(e,i,o.identifier,r[i]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){var a=n.AppInsightsPropertiesPlugin;a&&(this._context=a.context)}}},o.identifier="AjaxDependencyPlugin",o}();e.AjaxPlugin=ue,e.ajaxRecord=se,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var a,t,h,n;(t=a||(a={}))[t.LocalStorage=0]="LocalStorage",t[t.SessionStorage=1]="SessionStorage",(n=h||(h={}))[n.Default=0]="Default",n[n.Required=1]="Required",n[n.Array=2]="Array",n[n.Hidden=4]="Hidden";var c=(r.isNullOrUndefined=function(e){return null==e},r.disableCookies=function(){r._canUseCookies=!1},r.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(s,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},r);function r(){}var i,o,s=/[xy]/g;(o=i||(i={}))[o.CRITICAL=1]="CRITICAL",o[o.WARNING=2]="WARNING";var l=1,u=2,d=3,p=4,f=5,g=6,m=13,v=14,x=15,y=16,D=17,S=18,I=49,C=52,N=55,w=56,A=57,_=61,M=66,b=68,T=69;j.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(j.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),j.prototype.initialize=function(n,r,a){var i=this;if(n.isCookieUseDisabled&&c.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){if((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){e.priority<R&&(o=e.identifier),e.initialize(n,r,a)}),o)throw Error(E+o);for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);i.channelQueue.push(e)}})}for(var e=new Array,t=0;t<a.length;t++){var s=a[t];s.priority>R&&e.push(s)}if(0<e.length){for((e=e.sort(function(e,t){return e.priority-t.priority})).forEach(function(e){return e.initialize(n,r,a)}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);this.channelQueue.push(e)}};function j(){this.identifier="ChannelControllerPlugin",this.priority=R}var R=500,E="Channel has invalid priority",U=(q.requestContextHeader="Request-Context",q.requestContextTargetKey="appId",q.requestContextAppIdFormat="appId=cid-v1:",q.requestIdHeader="Request-Id",q.sdkContextHeader="Sdk-Context",q.sdkContextHeaderAppIdRequest="appId",q.requestContextHeaderLowerCase="request-context",q);function q(){}var L=(k.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,a=k.sanitizeKey(e,t);if(a.length!==r){for(var i=0,o=a;void 0!==n[o];)i++,o=a.substring(0,k.MAX_NAME_LENGTH-3)+k.padNumber(i);a=o}return a},k.sanitizeKey=function(e,t){var n;return t&&(t=k.trim(t.toString())).length>k.MAX_NAME_LENGTH&&(n=t.substring(0,k.MAX_NAME_LENGTH),e.throwInternal(i.WARNING,A,"name is too long. It has been truncated to "+k.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},k.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=k.MAX_STRING_LENGTH),t&&(n=n||k.MAX_STRING_LENGTH,(t=k.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(i.WARNING,_,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},k.sanitizeUrl=function(e,t){return k.sanitizeInput(e,t,k.MAX_URL_LENGTH,M)},k.sanitizeMessage=function(e,t){var n;return t&&t.length>k.MAX_MESSAGE_LENGTH&&(n=t.substring(0,k.MAX_MESSAGE_LENGTH),e.throwInternal(i.WARNING,w,"message is too long, it has been truncated to "+k.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},k.sanitizeException=function(e,t){var n;return t&&t.length>k.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,k.MAX_EXCEPTION_LENGTH),e.throwInternal(i.WARNING,C,"exception is too long, it has been truncated to "+k.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},k.sanitizeProperties=function(t,e){if(e){var n={};for(var r in e){var a=e[r];if("object"==typeof a&&"undefined"!=typeof JSON)try{a=JSON.stringify(a)}catch(e){t.throwInternal(i.WARNING,I,"custom property is not valid",{exception:e},!0)}a=k.sanitizeString(t,a,k.MAX_PROPERTY_LENGTH),n[r=k.sanitizeKeyAndAddUniqueness(t,r,n)]=a}e=n}return e},k.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var a=t[r];n[r=k.sanitizeKeyAndAddUniqueness(e,r,n)]=a}t=n}return t},k.sanitizeId=function(e,t){return t?k.sanitizeInput(e,t,k.MAX_ID_LENGTH,T).toString():t},k.sanitizeInput=function(e,t,n,r){var a;return t&&(t=k.trim(t)).length>n&&(a=t.substring(0,n),e.throwInternal(i.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),a||t},k.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},k.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},k.MAX_NAME_LENGTH=150,k.MAX_ID_LENGTH=128,k.MAX_PROPERTY_LENGTH=8192,k.MAX_STRING_LENGTH=1024,k.MAX_URL_LENGTH=2048,k.MAX_MESSAGE_LENGTH=32768,k.MAX_EXCEPTION_LENGTH=32768,k);function k(){}var F=(H.disableStorage=function(){H._canUseLocalStorage=!1,H._canUseSessionStorage=!1},H._getLocalStorageObject=function(){return H.canUseLocalStorage()?H._getVerifiedStorageObject(a.LocalStorage):null},H._getVerifiedStorageObject=function(e){var t,n,r=null;try{if("undefined"==typeof window)return null;n=new Date,(r=e===a.LocalStorage?window.localStorage:window.sessionStorage).setItem(n,n),t=r.getItem(n)!=n,r.removeItem(n),t&&(r=null)}catch(e){r=null}return r},H.isInternalApplicationInsightsEndpoint=function(e){return-1!==H._internalEndpoints.indexOf(e.toLowerCase())},H.canUseLocalStorage=function(){return void 0===H._canUseLocalStorage&&(H._canUseLocalStorage=!!H._getVerifiedStorageObject(a.LocalStorage)),H._canUseLocalStorage},H.getStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,l,"Browser failed read of local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setStorage=function(t,e,n){var r=H._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,d,"Browser failed write to local storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeStorage=function(t,e){var n=H._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseLocalStorage=!1,t.throwInternal(i.WARNING,f,"Browser failed removal of local storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H._getSessionStorageObject=function(){return H.canUseSessionStorage()?H._getVerifiedStorageObject(a.SessionStorage):null},H.canUseSessionStorage=function(){return void 0===H._canUseSessionStorage&&(H._canUseSessionStorage=!!H._getVerifiedStorageObject(a.SessionStorage)),H._canUseSessionStorage},H.getSessionStorageKeys=function(){var e=[];if(H.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},H.getSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,u,"Browser failed read of session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return null},H.setSessionStorage=function(t,e,n){var r=H._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,p,"Browser failed write to session storage. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.removeSessionStorage=function(t,e){var n=H._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){H._canUseSessionStorage=!1,t.throwInternal(i.WARNING,g,"Browser failed removal of session storage item. "+H.getExceptionName(e),{exception:H.dump(e)})}return!1},H.disableCookies=function(){c.disableCookies()},H.canUseCookies=function(t){if(void 0===c._canUseCookies){c._canUseCookies=!1;try{c._canUseCookies=void 0!==H.document.cookie}catch(e){t.throwInternal(i.WARNING,b,"Cannot access document.cookie - "+H.getExceptionName(e),{exception:H.dump(e)})}}return c._canUseCookies},H.setCookie=function(e,t,n,r){var a="",i="";r&&(a=";domain="+r),H.document.location&&"https:"===H.document.location.protocol&&(i=";secure"),H.canUseCookies(e)&&(H.document.cookie=t+"="+n+a+";path=/"+i)},H.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},H.getCookie=function(e,t){if(H.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",a=H.document.cookie.split(";"),i=0;i<a.length;i++){var o=a[i];if((o=H.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,a[i].length);break}}return n}},H.deleteCookie=function(e,t){H.canUseCookies(e)&&(H.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},H.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},H.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},H.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},H.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},H.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},H.toISOStringForIE8=function(e){if(H.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"}},H.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},H.msToTimeSpan=function(e){(isNaN(e)||e<0)&&(e=0);var t=""+(e=Math.round(e))%1e3,n=""+Math.floor(e/1e3)%60,r=""+Math.floor(e/6e4)%60,a=""+Math.floor(e/36e5)%24,i=Math.floor(e/864e5);return t=1===t.length?"00"+t:2===t.length?"0"+t:t,n=n.length<2?"0"+n:n,r=r.length<2?"0"+r:r,(0<i?i+".":"")+(a=a.length<2?"0"+a:a)+":"+r+":"+n+"."+t},H.isCrossOriginError=function(e,t,n,r,a){return("Script error."===e||"Script error"===e)&&!a},H.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},H.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},H.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},H.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},H.getExtension=function(e,t){for(var n=null,r=0;!n&&r<e.length;)e[r]&&e[r].identifier===t&&(n=e[r]),r++;return n},H.document="undefined"!=typeof document?document:{},H._canUseLocalStorage=void 0,H._canUseSessionStorage=void 0,H._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],H.NotSpecified="not_specified",H);function H(){}var O=(z.parseUrl=function(e){return z.htmlAnchorElement||(z.htmlAnchorElement=z.document.createElement?z.document.createElement("a"):{host:z.parseHost(e)}),z.htmlAnchorElement.href=e,z.htmlAnchorElement},z.getAbsoluteUrl=function(e){var t,n=z.parseUrl(e);return n&&(t=n.href),t},z.getPathName=function(e){var t,n=z.parseUrl(e);return n&&(t=n.pathname),t},z.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},z.parseHost=function(e){var t=e.match(/:\/\/(www[0-9]?\.)?(.[^/:]+)/i);return null!=t&&2<t.length&&"string"==typeof t[2]&&0<t[2].length?t[2]:null},z.document="undefined"!=typeof document?document:{},z);function z(){}var P=(G.canIncludeCorrelationHeader=function(e,t,n){if(e&&e.disableCorrelationHeaders)return!1;if(!t)return!1;var r=O.parseUrl(t).host.toLowerCase();if(!(e&&e.enableCorsCorrelation||r===n))return!1;var a=e&&e.correlationHeaderExcludedDomains;if(!a||0==a.length)return!0;for(var i=0;i<a.length;i++)if(new RegExp(a[i].toLowerCase().replace(/\./g,".").replace(/\*/g,".*")).test(r))return!1;return!0},G.getCorrelationContext=function(e){if(e){var t=G.getCorrelationContextValue(e,U.requestContextTargetKey);if(t&&t!==G.correlationIdPrefix)return t}},G.getCorrelationContextValue=function(e,t){if(e)for(var n=e.split(","),r=0;r<n.length;++r){var a=n[r].split("=");if(2==a.length&&a[0]==t)return a[1]}},G.correlationIdPrefix="cid-v1:",G);function G(){}var X=(W.ParseDependencyPath=function(e,t,n,r){var a,i=r,o=r;if(t&&0<t.length){var s=O.parseUrl(t);if(a=s.host,!i)if(null!=s.pathname){var c=0===s.pathname.length?"/":s.pathname;"/"!==c.charAt(0)&&(c="/"+c),o=s.pathname,i=L.sanitizeString(e,n?n+" "+c:c)}else i=L.sanitizeString(e,t)}else i=a=r;return{target:a,name:i,data:o}},W);function W(){}var B=(V.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()},V.GetDuration=function(e,t){var n=null;return 0===e||0===t||c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||(n=t-e),n},V);function V(){}var K="Microsoft_ApplicationInsights_BypassAjaxInstrumentation",Q=function(e,t){return(Q=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 J(e,t){function n(){this.constructor=e}Q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var Y,$=function(){return($=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)},Z=(J(ee,Y=function(){}),ee);function ee(){return Y.call(this)||this}var te;J(ne,te=function(){this.ver=1,this.sampleRate=100,this.tags={}});function ne(e,t,n){var r=te.call(this)||this;return r.name=L.sanitizeString(e,n)||F.NotSpecified,r.data=t,r.time=F.toISOStringForIE8(new Date),r.aiDataContract={time:h.Required,iKey:h.Required,name:h.Required,sampleRate:function(){return 100==r.sampleRate?h.Hidden:h.Required},tags:h.Required,data:h.Required},r}function re(){}var ae,ie=(J(oe,ae=re),oe);function oe(){var e=ae.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var se;J(ce,se=ie),ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",ce.dataType="EventData";function ce(e,t,n,r){var a=se.call(this)||this;return a.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},a.name=L.sanitizeString(e,t)||F.NotSpecified,a.properties=L.sanitizeProperties(e,n),a.measurements=L.sanitizeMeasurements(e,r),a}function le(){}var ue,de=(J(pe,ue=re),pe);function pe(){var e=ue.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function he(){this.hasFullStack=!0,this.parsedStack=[]}var fe;J(ge,fe=de),ge.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ve.CreateFromInterface(t,e)});return new ge(t,$({},e,{exceptions:n}))},ge.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,a=e.severityLevel;return{ver:e.ver,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:a,properties:n,measurements:r,problemGroup:void 0,id:null,isManual:null}},ge.CreateSimpleException=function(e,t,n,r,a,i){return{exceptions:[{hasFullStack:!0,message:e,stack:a,typeName:t}]}},ge.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",ge.dataType="ExceptionData";function ge(e,t,n,r,a){var i=fe.call(this)||this;return i.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(i.exceptions=[new ve(e,t)],i.properties=L.sanitizeProperties(e,n),i.measurements=L.sanitizeMeasurements(e,r),a&&(i.severityLevel=a)):(i.exceptions=t.exceptions,i.properties=t.properties,i.measurements=t.measurements,t.severityLevel&&(i.severityLevel=t.severityLevel)),i}var me,ve=(J(xe,me=he),xe.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}},xe.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return De.CreateFromInterface(e)})||t.parsedStack;return new xe(e,$({},t,{parsedStack:n}))},xe.parseStack=function(e){var t=void 0;if("string"==typeof e){var n=e.split("\n");t=[];for(var r=0,a=0,i=0;i<=n.length;i++){var o=n[i];if(De.regex.test(o)){var s=new De(n[i],r++);a+=s.sizeInBytes,t.push(s)}}if(32768<a)for(var c=0,l=t.length-1,u=0,d=c,p=l;c<l;){if(32768<(u+=t[c].sizeInBytes+t[l].sizeInBytes)){var h=p-d+1;t.splice(d,h);break}d=c,p=l,c++,l--}}return t},xe);function xe(e,t){var n=me.call(this)||this;if(n.aiDataContract={id:h.Default,outerId:h.Default,typeName:h.Required,message:h.Required,hasFullStack:h.Default,stack:h.Default,parsedStack:h.Array},t instanceof Error){n.typeName=L.sanitizeString(e,t.name)||F.NotSpecified,n.message=L.sanitizeMessage(e,t.message)||F.NotSpecified;var r=t.stack;n.parsedStack=xe.parseStack(r),n.stack=L.sanitizeException(e,r),n.hasFullStack=F.isArray(n.parsedStack)&&0<n.parsedStack.length}else n.typeName=t.typeName,n.message=t.message,n.stack=t.stack,n.parsedStack=t.parsedStack,n.hasFullStack=t.hasFullStack;return n}var ye,De=(J(Se,ye=le),Se.CreateFromInterface=function(e){return new Se(e,null)},Se.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Se.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Se.baseSize=58,Se);function Se(e,t){var n=ye.call(this)||this;if(n.sizeInBytes=0,n.aiDataContract={level:h.Required,method:h.Required,assembly:h.Default,fileName:h.Default,line:h.Default},"string"==typeof e){var r=e;n.level=t,n.method="<no_method>",n.assembly=F.trim(r),n.fileName="",n.line=0;var a=r.match(Se.regex);a&&5<=a.length&&(n.method=F.trim(a[2])||n.method,n.fileName=F.trim(a[4]),n.line=parseInt(a[5])||0)}else n.level=e.level,n.method=e.method,n.assembly=e.assembly,n.fileName=e.fileName,n.line=e.line,n.sizeInBytes=0;return n.sizeInBytes+=n.method.length,n.sizeInBytes+=n.fileName.length,n.sizeInBytes+=n.assembly.length,n.sizeInBytes+=Se.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var Ie,Ce,Ne,we=(J(Ae,Ie=re),Ae);function Ae(){var e=Ie.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Ne=Ce||(Ce={}))[Ne.Measurement=0]="Measurement",Ne[Ne.Aggregation=1]="Aggregation";var _e,Me=(J(be,_e=function(){this.kind=Ce.Measurement}),be);function be(){var e=null!==_e&&_e.apply(this,arguments)||this;return e.aiDataContract={name:h.Required,kind:h.Default,value:h.Required,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default},e}var Te;J(je,Te=we),je.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",je.dataType="MetricData";function je(e,t,n,r,a,i,o){var s=Te.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var c=new Me;return c.count=0<r?r:void 0,c.max=isNaN(i)||null===i?void 0:i,c.min=isNaN(a)||null===a?void 0:a,c.name=L.sanitizeString(e,t)||F.NotSpecified,c.value=n,s.metrics=[c],s.properties=L.sanitizeProperties(e,o),s}var Re,Ee=(J(Ue,Re=ie),Ue);function Ue(){var e=Re.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var qe;J(Le,qe=Ee),Le.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",Le.dataType="PageviewData";function Le(e,t,n,r,a,i,o){var s=qe.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,properties:h.Default,measurements:h.Default,id:h.Default},s.id=L.sanitizeId(e,o),s.url=L.sanitizeUrl(e,n),s.name=L.sanitizeString(e,t)||F.NotSpecified,isNaN(r)||(s.duration=F.msToTimeSpan(r)),s.properties=L.sanitizeProperties(e,a),s.measurements=L.sanitizeMeasurements(e,i),s}var ke,Fe=(J(He,ke=re),He);function He(){var e=ke.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var Oe,ze=(J(Pe,Oe=Fe),Pe.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",Pe.dataType="RemoteDependencyData",Pe);function Pe(e,t,n,r,a,i,o,s,c,l,u){void 0===c&&(c="Ajax");var d=Oe.call(this)||this;d.aiDataContract={id:h.Required,ver:h.Required,name:h.Default,resultCode:h.Default,duration:h.Default,success:h.Default,data:h.Default,target:h.Default,type:h.Default,properties:h.Default,measurements:h.Default,kind:h.Default,value:h.Default,count:h.Default,min:h.Default,max:h.Default,stdDev:h.Default,dependencyKind:h.Default,dependencySource:h.Default,commandName:h.Default,dependencyTypeName:h.Default},d.id=t,d.duration=F.msToTimeSpan(a),d.success=i,d.resultCode=o+"",d.type=L.sanitizeString(e,c);var p=X.ParseDependencyPath(e,n,s,r);return d.data=L.sanitizeUrl(e,r)||p.data,d.target=p.target,d.name=p.name,d.properties=L.sanitizeProperties(e,l),d.measurements=L.sanitizeMeasurements(e,u),d}var Ge,Xe=(J(We,Ge=re),We);function We(){var e=Ge.call(this)||this;return e.ver=2,e.properties={},e}var Be;J(Ve,Be=Xe),Ve.envelopeType="Microsoft.ApplicationInsights.{0}.Message",Ve.dataType="MessageData";function Ve(e,t,n,r){var a=Be.call(this)||this;return a.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||F.NotSpecified,a.message=L.sanitizeMessage(e,t),a.properties=L.sanitizeProperties(e,r),n&&(a.severityLevel=n),a}var Ke,Qe=(J(Je,Ke=Ee),Je);function Je(){var e=Ke.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ye;J($e,Ye=Qe),$e.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",$e.dataType="PageviewPerformanceData";function $e(e,t,n,r,a,i){var o=Ye.call(this)||this;return o.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},o.url=L.sanitizeUrl(e,n),o.name=L.sanitizeString(e,t)||F.NotSpecified,o.properties=L.sanitizeProperties(e,a),o.measurements=L.sanitizeMeasurements(e,i),o}var Ze,et,tt;J(nt,Ze=Z);function nt(e,t){var n=Ze.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(tt=et||(et={}))[tt.Verbose=0]="Verbose",tt[tt.Information=1]="Information",tt[tt.Warning=2]="Warning",tt[tt.Error=3]="Error",tt[tt.Critical=4]="Critical";var rt=(at.getConfig=function(e,t,n,r){var a;return void 0===r&&(r=!1),a=n&&e.extensionConfig&&e.extensionConfig[n]&&!c.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],c.isNullOrUndefined(a)?r:a},at);function at(){}var it=(ot.create=function(e,t,n,r,a,i){if(n=L.sanitizeString(r,n)||F.NotSpecified,c.isNullOrUndefined(e)||c.isNullOrUndefined(t)||c.isNullOrUndefined(n))throw Error("Input doesn't contain all required fields");var o={name:n,time:(new Date).toISOString(),iKey:"",ext:i||{},tags:[],data:{},baseType:t,baseData:e};if(!c.isNullOrUndefined(a))for(var s in a)a.hasOwnProperty(s)&&(o.data[s]=a[s]);return o},ot);function ot(){}var st=function(){this.openDone=!1,this.setRequestHeaderDone=!1,this.sendDone=!1,this.abortDone=!1,this.onreadystatechangeCallbackAttached=!1},ct=(lt.prototype.getAbsoluteUrl=function(){return this.requestUrl?O.getAbsoluteUrl(this.requestUrl):null},lt.prototype.getPathName=function(){return this.requestUrl?L.sanitizeUrl(this._logger,O.getCompleteUrl(this.method,this.requestUrl)):null},lt);function lt(e,t){this.completed=!1,this.requestHeadersSize=null,this.ttfb=null,this.responseReceivingDuration=null,this.callbackDuration=null,this.ajaxTotalDuration=null,this.aborted=null,this.pageUrl=null,this.requestUrl=null,this.requestSize=0,this.method=null,this.status=null,this.requestSentTime=null,this.responseStartedTime=null,this.responseFinishedTime=null,this.callbackFinishedTime=null,this.endTime=null,this.originalOnreadystatechage=null,this.xhrMonitoringState=new st,this.clientFailure=0,this.CalculateMetrics=function(){this.ajaxTotalDuration=Math.round(1e3*B.GetDuration(this.requestSentTime,this.responseFinishedTime))/1e3},this.id=e,this._logger=t}var ut=(dt.AttachEvent=function(e,t,n){var r=!1;return c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.attachEvent)?c.isNullOrUndefined(e.addEventListener)||(e.addEventListener(t,n,!1),r=!0):(e.attachEvent("on"+t,n),r=!0)),r},dt.DetachEvent=function(e,t,n){c.isNullOrUndefined(e)||(c.isNullOrUndefined(e.detachEvent)?c.isNullOrUndefined(e.removeEventListener)||e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n))},dt);function dt(){}var pt=(ht.prototype.isMonitoredInstance=function(e,t,n,r){var a=!1,i=!0,o=!1;return void 0!==n?(o=this._fetchInitialized,a="object"==typeof n&&!0===n[K]||!!r&&!0===r[K]):void 0!==e&&(o=this.initialized,a=!0===e[K],i=!0===t||!c.isNullOrUndefined(e.ajaxData)),o&&i&&!a},ht.prototype.supportsAjaxMonitoring=function(){var e=!0;return(c.isNullOrUndefined(XMLHttpRequest)||c.isNullOrUndefined(XMLHttpRequest.prototype)||c.isNullOrUndefined(XMLHttpRequest.prototype.open)||c.isNullOrUndefined(XMLHttpRequest.prototype.send)||c.isNullOrUndefined(XMLHttpRequest.prototype.abort))&&(e=!1),e},ht.prototype.instrumentOpen=function(){var r=XMLHttpRequest.prototype.open,a=this;XMLHttpRequest.prototype.open=function(e,t,n){try{!a.isMonitoredInstance(this,!0)||this.ajaxData&&this.ajaxData.xhrMonitoringState.openDone||a.openHandler(this,e,t,n)}catch(e){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor XMLHttpRequest.open, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return r.apply(this,arguments)}},ht.prototype.openHandler=function(e,t,n,r){var a;a=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var i=new ct(a,this._core.logger);i.method=t,i.requestUrl=n,i.xhrMonitoringState.openDone=!0,e.ajaxData=i,this.attachToOnReadyStateChange(e)},ht.getFailedAjaxDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||c.isNullOrUndefined(e.ajaxData)||c.isNullOrUndefined(e.ajaxData.requestUrl)||(t+="(url: '"+e.ajaxData.requestUrl+"')")}catch(e){}return t},ht.prototype.instrumentSend=function(){var t=XMLHttpRequest.prototype.send,n=this;XMLHttpRequest.prototype.send=function(e){try{n.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.sendDone&&n.sendHandler(this,e)}catch(e){n._core.logger.throwInternal(i.CRITICAL,D,"Failed to monitor XMLHttpRequest, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return t.apply(this,arguments)}},ht.prototype.sendHandler=function(e,t){e.ajaxData.requestSentTime=B.Now(),(e=this.includeCorrelationHeaders(e.ajaxData,void 0,void 0,e)).ajaxData.xhrMonitoringState.sendDone=!0},ht.prototype.instrumentAbort=function(){var e=XMLHttpRequest.prototype.abort,t=this;XMLHttpRequest.prototype.abort=function(){try{t.isMonitoredInstance(this)&&!this.ajaxData.xhrMonitoringState.abortDone&&(this.ajaxData.aborted=1,this.ajaxData.xhrMonitoringState.abortDone=!0)}catch(e){t._core.logger.throwInternal(i.CRITICAL,m,"Failed to monitor XMLHttpRequest.abort, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(this),exception:F.dump(e)})}return e.apply(this,arguments)}},ht.prototype.attachToOnReadyStateChange=function(n){var r=this;n.ajaxData.xhrMonitoringState.onreadystatechangeCallbackAttached=ut.AttachEvent(n,"readystatechange",function(){try{r.isMonitoredInstance(n)&&4===n.readyState&&r.onAjaxComplete(n)}catch(e){var t=F.dump(e);t&&-1!=t.toLowerCase().indexOf("c00c023f")||r._core.logger.throwInternal(i.CRITICAL,y,"Failed to monitor XMLHttpRequest 'readystatechange' event handler, monitoring data for this ajax call may be incorrect.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(n),exception:F.dump(e)})}})},ht.prototype.onAjaxComplete=function(e){if(e.ajaxData.responseFinishedTime=B.Now(),e.ajaxData.status=e.status,e.ajaxData.CalculateMetrics(),e.ajaxData.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the ajax call, monitoring data for this ajax call won't be sent.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(e),requestSentTime:e.ajaxData.requestSentTime,responseFinishedTime:e.ajaxData.responseFinishedTime});else{var t={id:e.ajaxData.id,target:e.ajaxData.getAbsoluteUrl(),name:e.ajaxData.getPathName(),type:"Ajax",duration:e.ajaxData.ajaxTotalDuration,success:200<=+e.ajaxData.status&&+e.ajaxData.status<400,responseCode:+e.ajaxData.status,method:e.ajaxData.method},n=this.getAjaxCorrelationContext(e);n&&(t.correlationContext=n),this.trackDependencyDataInternal(t),e.ajaxData=null}},ht.prototype.getAjaxCorrelationContext=function(t){try{var e=t.getAllResponseHeaders();if(null!==e&&-1!==e.toLowerCase().indexOf(U.requestContextHeaderLowerCase)){var n=t.getResponseHeader(U.requestContextHeader);return P.getCorrelationContext(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{ajaxDiagnosticsMessage:ht.getFailedAjaxDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.trackDependencyDataInternal=function(e,t,n){if(-1===this._config.maxAjaxCallsPerView||this._trackAjaxAttempts<this._config.maxAjaxCallsPerView){var r=it.create(e,ze.dataType,ze.envelopeType,this._core.logger,t,n);this._core.track(r)}else this._trackAjaxAttempts===this._config.maxAjaxCallsPerView&&this._core.logger.throwInternal(i.CRITICAL,N,"Maximum ajax per page view limit reached, ajax monitoring is paused until the next trackPageView(). In order to increase the limit set the maxAjaxCallsPerView configuration parameter.",!0);++this._trackAjaxAttempts},ht.prototype.trackDependencyData=function(e,t){this.trackDependencyDataInternal(e,t)},ht.prototype.processTelemetry=function(e){this._nextPlugin&&this._nextPlugin.processTelemetry&&this._nextPlugin.processTelemetry(e)},ht.prototype.setNextPlugin=function(e){e&&(this._nextPlugin=e)},ht.prototype.instrumentFetch=function(){if(this.supportsFetch()&&!this._fetchInitialized){var r=window.fetch,a=this;window.fetch=function(t,e){var n;if(a.isFetchInstrumented(t)&&a.isMonitoredInstance(void 0,void 0,t,e))try{n=a.createFetchRecord(t,e),e=a.includeCorrelationHeaders(n,t,e)}catch(e){a._core.logger.throwInternal(i.CRITICAL,x,"Failed to monitor Window.fetch, monitoring data for this fetch call may be incorrect.",{ajaxDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}return r(t,e).then(function(e){return a.onFetchComplete(e,n),e}).catch(function(e){throw a.onFetchFailed(t,n,e),e})},this._fetchInitialized=!0}},ht.prototype.isFetchInstrumented=function(e){return this._fetchInitialized&&!0!==e[K]},ht.prototype.supportsFetch=function(){var e=!0;return(!window||c.isNullOrUndefined(window.Request)||c.isNullOrUndefined(window.Request.prototype)||c.isNullOrUndefined(window.fetch))&&(e=!1),e},ht.prototype.createFetchRecord=function(e,t){var n;n=this._context&&this._context.telemetryTrace&&this._context.telemetryTrace.traceID?"|"+this._context.telemetryTrace.traceID+"."+F.newId():F.newId();var r=new ct(n,this._core.logger);return r.requestSentTime=B.Now(),e instanceof Request?r.requestUrl=e?e.url:"":r.requestUrl=e,t&&t.method?r.method=t.method:e&&e instanceof Request?r.method=e.method:r.method="GET",r},ht.prototype.includeCorrelationHeaders=function(e,t,n,r){if(t){if(P.canIncludeCorrelationHeader(this._config,e.getAbsoluteUrl(),this.currentWindowHost)){n||(n={}),n.headers=new Headers(n.headers||t instanceof Request&&t.headers||{}),n.headers.set(U.requestIdHeader,e.id);var a=this._config.appId||this._context.appId();return a&&n.headers.set(U.requestContextHeader,U.requestContextAppIdFormat+a),n}return n}if(r){if(this.currentWindowHost&&P.canIncludeCorrelationHeader(this._config,r.ajaxData.getAbsoluteUrl(),this.currentWindowHost)){r.setRequestHeader(U.requestIdHeader,r.ajaxData.id);var i=this._config.appId||this._context.appId();i&&r.setRequestHeader(U.requestContextHeader,U.requestContextAppIdFormat+i)}return r}},ht.prototype.getFailedFetchDiagnosticsMessage=function(e){var t="";try{c.isNullOrUndefined(e)||(t+="string"==typeof e?"(url: '"+e+"')":"(url: '"+e.url+"')")}catch(e){this._core.logger.throwInternal(i.CRITICAL,x,"Failed to grab failed fetch diagnostics message",{exception:F.dump(e)})}return t},ht.prototype.onFetchComplete=function(t,e){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var n={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:200<=t.status&&t.status<400,responseCode:t.status,properties:{HttpMethod:e.method}},r=this.getFetchCorrelationContext(t);r&&(n.correlationContext=r),this.trackDependencyDataInternal(n)}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to calculate the duration of the fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.onFetchFailed=function(t,e,n){if(e)try{if(e.responseFinishedTime=B.Now(),e.CalculateMetrics(),e.ajaxTotalDuration<0)this._core.logger.throwInternal(i.WARNING,v,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),requestSentTime:e.requestSentTime,responseFinishedTime:e.responseFinishedTime});else{var r={id:e.id,target:e.getAbsoluteUrl(),name:e.getPathName(),type:"Fetch",duration:e.ajaxTotalDuration,success:!1,responseCode:0,properties:{HttpMethod:e.method}};this.trackDependencyDataInternal(r,{error:n.message})}}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to calculate the duration of the failed fetch call, monitoring data for this fetch call won't be sent.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.getFetchCorrelationContext=function(t){try{var e=t.headers.get(U.requestContextHeader);return P.getCorrelationContext(e)}catch(e){this._core.logger.throwInternal(i.WARNING,S,"Failed to get Request-Context correlation header as it may be not included in the response or not accessible.",{fetchDiagnosticsMessage:this.getFailedFetchDiagnosticsMessage(t),exception:F.dump(e)})}},ht.prototype.instrumentXhr=function(){this.supportsAjaxMonitoring()&&!this.initialized&&(this.instrumentOpen(),this.instrumentSend(),this.instrumentAbort(),this.initialized=!0)},ht.getDefaultConfig=function(){return{maxAjaxCallsPerView:500,disableAjaxTracking:!1,disableFetchTracking:!0,disableCorrelationHeaders:!1,correlationHeaderExcludedDomains:["*.blob.core.windows.net","*.blob.core.chinacloudapi.cn","*.blob.core.cloudapi.de","*.blob.core.usgovcloudapi.net"],appId:void 0,enableCorsCorrelation:!1}},ht.getEmptyConfig=function(){return{maxAjaxCallsPerView:void 0,disableAjaxTracking:void 0,disableFetchTracking:void 0,disableCorrelationHeaders:void 0,correlationHeaderExcludedDomains:void 0,appId:void 0,enableCorsCorrelation:void 0}},ht.prototype.initialize=function(e,t,n){if(!this.initialized&&!this._fetchInitialized){this._core=t;var r=ht.getDefaultConfig();for(var a in this._config=ht.getEmptyConfig(),r)this._config[a]=rt.getConfig(e,a,ht.identifier,r[a]);if(!1===this._config.disableAjaxTracking&&this.instrumentXhr(),!1===this._config.disableFetchTracking&&this.instrumentFetch(),0<n.length&&n){for(var i=void 0,o=0;!i&&o<n.length;)n[o]&&"AppInsightsPropertiesPlugin"===n[o].identifier&&(i=n[o]),o++;i&&(this._context=i.context)}}},ht.identifier="AjaxDependencyPlugin",ht);function ht(){this._trackAjaxAttempts=0,this.identifier=ht.identifier,this.priority=171,this.currentWindowHost=window&&window.location&&window.location.host&&window.location.host.toLowerCase(),this.initialized=!1,this._fetchInitialized=!1}e.AjaxPlugin=pt,e.ajaxRecord=ct,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=applicationinsights-dependencies-js.min.js.map |
{ | ||
"name": "@microsoft/applicationinsights-dependencies-js", | ||
"version": "2.0.0-rc4", | ||
"version": "2.0.0-rc5", | ||
"description": "Microsoft Application Insights XHR dependencies plugin", | ||
@@ -11,3 +11,3 @@ "main": "dist/applicationinsights-dependencies-js.js", | ||
"type": "git", | ||
"url": "https://github.com/Microsoft/ApplicationInsights-JS/tree/master/vNext/extensions/applicationinsights-dependencies-js" | ||
"url": "https://github.com/microsoft/ApplicationInsights-JS/tree/master/vNext/extensions/applicationinsights-dependencies-js" | ||
}, | ||
@@ -32,4 +32,4 @@ "scripts": { | ||
"dependencies": { | ||
"@microsoft/applicationinsights-core-js": "2.0.0-rc4", | ||
"@microsoft/applicationinsights-common": "2.0.0-rc4", | ||
"@microsoft/applicationinsights-core-js": "2.0.0-rc5", | ||
"@microsoft/applicationinsights-common": "2.0.0-rc5", | ||
"tslib": "^1.9.3" | ||
@@ -36,0 +36,0 @@ }, |
# Microsoft Application Insights JavaScript SDK - Dependencies Plugin | ||
[![Build Status](https://travis-ci.org/Microsoft/ApplicationInsights-JS.svg?branch=master)](https://travis-ci.org/Microsoft/ApplicationInsights-JS) | ||
[![Build Status](https://travis-ci.org/microsoft/ApplicationInsights-JS.svg?branch=master)](https://travis-ci.org/microsoft/ApplicationInsights-JS) | ||
[![npm version](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-dependencies-js.svg)](https://badge.fury.io/js/%40microsoft%2Fapplicationinsights-dependencies-js) | ||
@@ -13,3 +13,3 @@ | ||
npm run build --silent | ||
``` | ||
``` | ||
@@ -16,0 +16,0 @@ ## Run unit tests: |
@@ -109,3 +109,3 @@ // Copyright (c) Microsoft Corporation. All rights reserved. | ||
} catch (e) { | ||
this._core.logger.throwInternal( | ||
ajaxMonitorInstance._core.logger.throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -165,3 +165,3 @@ _InternalMessageId.FailedMonitorAjaxOpen, | ||
} catch (e) { | ||
this._core.logger.throwInternal( | ||
ajaxMonitorInstance._core.logger.throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -196,3 +196,3 @@ _InternalMessageId.FailedMonitorAjaxSend, | ||
} catch (e) { | ||
this._core.logger.throwInternal( | ||
ajaxMonitorInstance._core.logger.throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -225,3 +225,3 @@ _InternalMessageId.FailedMonitorAjaxAbort, | ||
if (!exceptionText || exceptionText.toLowerCase().indexOf("c00c023f") == -1) { | ||
this._core.logger.throwInternal( | ||
ajaxMonitorInstance._core.logger.throwInternal( | ||
LoggingSeverity.CRITICAL, | ||
@@ -345,3 +345,3 @@ _InternalMessageId.FailedMonitorAjaxRSC, | ||
priority: number = 161; | ||
priority: number = 171; | ||
@@ -438,3 +438,3 @@ // Fetch Stuff | ||
init.headers.set(RequestHeaders.requestIdHeader, ajaxData.id); | ||
let appId: string = this._config.appId; | ||
let appId: string = this._config.appId || this._context.appId(); | ||
if (appId) { | ||
@@ -451,3 +451,3 @@ init.headers.set(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId); | ||
xhr.setRequestHeader(RequestHeaders.requestIdHeader, xhr.ajaxData.id); | ||
var appId = this._config.appId; // Todo: also, get appId from channel as breeze returns it | ||
var appId = this._config.appId || this._context.appId(); | ||
if (appId) { | ||
@@ -649,5 +649,11 @@ xhr.setRequestHeader(RequestHeaders.requestContextHeader, RequestHeaders.requestContextAppIdFormat + appId); | ||
} | ||
if (extensions.length > 0 && extensions) { | ||
const propExt = <IPropertiesPlugin>extensions[PropertiesPluginIdentifier]; | ||
let propExt, extIx = 0; | ||
while (!propExt && extIx < extensions.length) { | ||
if (extensions[extIx] && extensions[extIx].identifier === PropertiesPluginIdentifier) { | ||
propExt = extensions[extIx] | ||
} | ||
extIx++; | ||
} | ||
if (propExt) { | ||
@@ -654,0 +660,0 @@ this._context = propExt.context; // we could move IPropertiesPlugin to common as well |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1274792
6645
+ Added@microsoft/applicationinsights-common@2.0.0-rc5(transitive)
+ Added@microsoft/applicationinsights-core-js@2.0.0-rc5(transitive)
- Removed@microsoft/applicationinsights-common@2.0.0-rc4(transitive)
- Removed@microsoft/applicationinsights-core-js@2.0.0-rc4(transitive)