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

@microsoft/applicationinsights-channel-js

Package Overview
Dependencies
Maintainers
5
Versions
577
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 2.2.1 to 2.2.2

4

browser/applicationinsights-channel-js.min.js
/*!
* Application Insights JavaScript SDK - Channel, 2.2.1
* Application Insights JavaScript SDK - Channel, 2.2.2
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,h,a,o,s,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=h=h||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var m=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var v,u,c=/[xy]/g;(u=v=v||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,f=2,g=3,y=4,_=5,I=6,S=7,b=12,w=20,x=22,N=23,E=24,C=26,A=28,D=33,T=40,R=41,L=42,M=43,U=46,O=47,P=48,k=49,z=50,B=52,G=54,F=56,q=57,H=58,X=61,j=64,W=66,V=67,K=68,Y=69,J=70,Z=(Q.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},Q.dataType="MessageData",Q.AiNonUserActionablePrefix="AI (Internal): ",Q.AiUserActionablePrefix="AI: ",Q);function Q(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Q.AiUserActionablePrefix:Q.AiNonUserActionablePrefix)+e;var i=(t?" message:"+Q.sanitizeDiagnosticText(t):"")+(r?" props:"+Q.sanitizeDiagnosticText(JSON.stringify(r)):"");this.message+=i}var $=(ee.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Z(t,n,i,r);if(this.enableDebugExceptions())throw a;if(void 0!==a&&a&&void 0!==a.message){if(i){var o=+a.messageId;(!this._messageLogged[o]||this.consoleLoggingLevel()>=v.WARNING)&&(this.warnToConsole(a.message),this._messageLogged[o]=!0)}else this.consoleLoggingLevel()>=v.WARNING&&this.warnToConsole(a.message);this.logInternalMessage(e,a)}},ee.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},ee.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ee.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,r=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[r]?n=!1:this._messageLogged[r]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount==this.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",a=new Z(N,i,!1);this.queue.push(a),this.warnToConsole(i)}}},ee.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ee);function ee(e){this.AIInternalMessagePrefix="AITR_",this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},this.queue=[],this._messageCount=0,this._messageLogged={},m.isNullOrUndefined(e)||(m.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),m.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),m.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),m.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}te.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(te.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),te.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,i)}),this.channelQueue.push(e)}};function te(){this.identifier="ChannelControllerPlugin",this.priority=500}var ne=(re.requestContextHeader="Request-Context",re.requestContextTargetKey="appId",re.requestContextAppIdFormat="appId=cid-v1:",re.requestIdHeader="Request-Id",re.traceParentHeader="traceparent",re.sdkContextHeader="Sdk-Context",re.sdkContextHeaderAppIdRequest="appId",re.requestContextHeaderLowerCase="request-context",re);function re(){}var ie=(ae.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=ae.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,ae.MAX_NAME_LENGTH-3)+ae.padNumber(a);i=o}return i},ae.sanitizeKey=function(e,t){var n;return t&&(t=ae.trim(t.toString())).length>ae.MAX_NAME_LENGTH&&(n=t.substring(0,ae.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,q,"name is too long. It has been truncated to "+ae.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ae.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=ae.MAX_STRING_LENGTH),t&&(n=n||ae.MAX_STRING_LENGTH,(t=ae.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,X,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},ae.sanitizeUrl=function(e,t){return ae.sanitizeInput(e,t,ae.MAX_URL_LENGTH,W)},ae.sanitizeMessage=function(e,t){var n;return t&&t.length>ae.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ae.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,F,"message is too long, it has been truncated to "+ae.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ae.sanitizeException=function(e,t){var n;return t&&t.length>ae.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ae.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,B,"exception is too long, it has been truncated to "+ae.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ae.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(v.WARNING,k,"custom property is not valid",{exception:e},!0)}i=ae.sanitizeString(t,i,ae.MAX_PROPERTY_LENGTH),n[r=ae.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},ae.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=ae.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},ae.sanitizeId=function(e,t){return t?ae.sanitizeInput(e,t,ae.MAX_ID_LENGTH,Y).toString():t},ae.sanitizeInput=function(e,t,n,r){var i;return t&&(t=ae.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},ae.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ae.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ae.MAX_NAME_LENGTH=150,ae.MAX_ID_LENGTH=128,ae.MAX_PROPERTY_LENGTH=8192,ae.MAX_STRING_LENGTH=1024,ae.MAX_URL_LENGTH=2048,ae.MAX_MESSAGE_LENGTH=32768,ae.MAX_EXCEPTION_LENGTH=32768,ae);function ae(){}var oe=(se.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},se.disableStorage=function(){se._canUseLocalStorage=!1,se._canUseSessionStorage=!1},se._getLocalStorageObject=function(){return se.canUseLocalStorage()?se._getVerifiedStorageObject(i.LocalStorage):null},se._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},se.isInternalApplicationInsightsEndpoint=function(e){return-1!==se._internalEndpoints.indexOf(e.toLowerCase())},se.canUseLocalStorage=function(){return void 0===se._canUseLocalStorage&&(se._canUseLocalStorage=!!se._getVerifiedStorageObject(i.LocalStorage)),se._canUseLocalStorage},se.getStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed read of local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setStorage=function(t,e,n){var r=se._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,g,"Browser failed write to local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,_,"Browser failed removal of local storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se._getSessionStorageObject=function(){return se.canUseSessionStorage()?se._getVerifiedStorageObject(i.SessionStorage):null},se.canUseSessionStorage=function(){return void 0===se._canUseSessionStorage&&(se._canUseSessionStorage=!!se._getVerifiedStorageObject(i.SessionStorage)),se._canUseSessionStorage},se.getSessionStorageKeys=function(){var e=[];if(se.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},se.getSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,f,"Browser failed read of session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setSessionStorage=function(t,e,n){var r=se._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed write to session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,I,"Browser failed removal of session storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.disableCookies=function(){m.disableCookies()},se.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==se.document.cookie}catch(e){t.throwInternal(v.WARNING,K,"Cannot access document.cookie - "+se.getExceptionName(e),{exception:se.dump(e)})}}return m._canUseCookies},se.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),se.document.location&&"https:"===se.document.location.protocol&&(a=";secure"),se.canUseCookies(e)&&(se.document.cookie=t+"="+n+i+";path=/"+a)},se.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},se.getCookie=function(e,t){if(se.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=se.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=se.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},se.deleteCookie=function(e,t){se.canUseCookies(e)&&(se.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},se.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},se.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},se.random32=function(){return 4294967296*Math.random()|0},se.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=se.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},se.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},se.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},se.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},se.toISOStringForIE8=function(e){if(se.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"}},se.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},se.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},se.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},se.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},se.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},se.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},se.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},se.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},se.document="undefined"!=typeof document?document:{},se._canUseLocalStorage=void 0,se._canUseSessionStorage=void 0,se._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],se.NotSpecified="not_specified",se);function se(){}var le=(ue.parseUrl=function(e){return ue.htmlAnchorElement||(ue.htmlAnchorElement=ue.document.createElement?ue.document.createElement("a"):{host:ue.parseHost(e)}),ue.htmlAnchorElement.href=e,ue.htmlAnchorElement},ue.getAbsoluteUrl=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.href),t},ue.getPathName=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.pathname),t},ue.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ue.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},ue.document="undefined"!=typeof document?document:{},ue);function ue(){}var ce=(pe.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=le.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=ie.sanitizeString(e,n?n+" "+l:l)}else a=ie.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},pe);function pe(){}de.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()},de.GetDuration=function(e,t){var n=null;return 0===e||0===t||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n};function de(){}var fe,he="ProcessLegacy",ge="http.method",me=(t(ve,fe=function(){}),ve);function ve(){return fe.call(this)||this}var ye,_e=(t(Ie,ye=function(){this.ver=1,this.sampleRate=100,this.tags={}}),Ie);function Ie(e,t,n){var r=ye.call(this)||this;return r.name=ie.sanitizeString(e,n)||oe.NotSpecified,r.data=t,r.time=oe.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 Se(){}var be,we=(t(xe,be=Se),xe);function xe(){var e=be.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ne,Ee=(t(Ce,Ne=we),Ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Ce.dataType="EventData",Ce);function Ce(e,t,n,r){var i=Ne.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=ie.sanitizeString(e,t)||oe.NotSpecified,i.properties=ie.sanitizeProperties(e,n),i.measurements=ie.sanitizeMeasurements(e,r),i}function Ae(){}var De,Te=(t(Re,De=Se),Re);function Re(){var e=De.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function Le(){this.hasFullStack=!0,this.parsedStack=[]}var Me,Ue=(t(Oe,Me=Te),Oe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ke.CreateFromInterface(t,e)});return new Oe(t,p({},e,{exceptions:n}))},Oe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,l=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:l}},Oe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Oe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Oe.dataType="ExceptionData",Oe);function Oe(e,t,n,r,i,a){var o=Me.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new ke(e,t)],o.properties=ie.sanitizeProperties(e,n),o.measurements=ie.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),m.isNullOrUndefined(t.ver)||(o.ver=t.ver),m.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Pe,ke=(t(ze,Pe=Le),ze.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}},ze.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ge.CreateFromInterface(e)})||t.parsedStack;return new ze(e,p({},t,{parsedStack:n}))},ze.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(Ge.regex.test(o)){var s=new Ge(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},ze);function ze(e,t){var n=Pe.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=ie.sanitizeString(e,t.name)||oe.NotSpecified,n.message=ie.sanitizeMessage(e,t.message)||oe.NotSpecified;var r=t.stack;n.parsedStack=ze.parseStack(r),n.stack=ie.sanitizeException(e,r),n.hasFullStack=oe.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 Be,Ge=(t(Fe,Be=Ae),Fe.CreateFromInterface=function(e){return new Fe(e,null)},Fe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Fe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Fe.baseSize=58,Fe);function Fe(e,t){var n=Be.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=oe.trim(r),n.fileName="",n.line=0;var i=r.match(Fe.regex);i&&5<=i.length&&(n.method=oe.trim(i[2])||n.method,n.fileName=oe.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+=Fe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qe,He,Xe,je=(t(We,qe=Se),We);function We(){var e=qe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Xe=He=He||{})[Xe.Measurement=0]="Measurement",Xe[Xe.Aggregation=1]="Aggregation";var Ve,Ke=(t(Ye,Ve=function(){this.kind=He.Measurement}),Ye);function Ye(){var e=null!==Ve&&Ve.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 Je,Ze=(t(Qe,Je=je),Qe.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Qe.dataType="MetricData",Qe);function Qe(e,t,n,r,i,a,o){var s=Je.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var l=new Ke;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=ie.sanitizeString(e,t)||oe.NotSpecified,l.value=n,s.metrics=[l],s.properties=ie.sanitizeProperties(e,o),s}var $e,et=(t(tt,$e=we),tt);function tt(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var nt,rt=(t(it,nt=et),it.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",it.dataType="PageviewData",it);function it(e,t,n,r,i,a,o){var s=nt.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=ie.sanitizeId(e,o),s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,isNaN(r)||(s.duration=oe.msToTimeSpan(r)),s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),s}var at,ot=(t(st,at=Se),st);function st(){var e=at.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var lt,ut=(t(ct,lt=ot),ct.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ct.dataType="RemoteDependencyData",ct);function ct(e,t,n,r,i,a,o,s,l,u,c,p){void 0===l&&(l="Ajax");var d=lt.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=oe.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=ie.sanitizeString(e,l);var f=ce.ParseDependencyPath(e,n,s,r);return d.data=ie.sanitizeUrl(e,r)||f.data,d.target=ie.sanitizeString(e,f.target),u&&(d.target=d.target+"| "+u),d.name=ie.sanitizeString(e,f.name),d.properties=ie.sanitizeProperties(e,c),d.measurements=ie.sanitizeMeasurements(e,p),d}var pt,dt=(t(ft,pt=Se),ft);function ft(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e}var ht,gt=(t(mt,ht=dt),mt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mt.dataType="MessageData",mt);function mt(e,t,n,r){var i=ht.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||oe.NotSpecified,i.message=ie.sanitizeMessage(e,t),i.properties=ie.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var vt,yt=(t(_t,vt=et),_t);function _t(){var e=vt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var It,St=(t(bt,It=yt),bt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",bt.dataType="PageviewPerformanceData",bt);function bt(e,t,n,r,i,a,o){var s=It.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var wt,xt,Nt,Et=(t(Ct,wt=me),Ct);function Ct(e,t){var n=wt.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(Nt=xt=xt||{})[Nt.Verbose=0]="Verbose",Nt[Nt.Information=1]="Information",Nt[Nt.Warning=2]="Warning",Nt[Nt.Error=3]="Error",Nt[Nt.Critical=4]="Critical";var At=(Dt.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},Dt);function Dt(){}var Tt=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},Rt=new Tt,Lt=(Mt.prototype.enqueue=function(e){this._buffer.push(e)},Mt.prototype.count=function(){return this._buffer.length},Mt.prototype.clear=function(){this._buffer.length=0},Mt.prototype.getItems=function(){return this._buffer.slice(0)},Mt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Mt.prototype.markAsSent=function(e){this.clear()},Mt.prototype.clearSent=function(e){},Mt);function Mt(e){this._config=e,this._buffer=[]}var Ut=(Ot.prototype.enqueue=function(e){this._buffer.length>=Ot.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Ot.BUFFER_KEY,this._buffer))},Ot.prototype.count=function(){return this._buffer.length},Ot.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Ot.BUFFER_KEY,[]),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Ot.prototype.getItems=function(){return this._buffer.slice(0)},Ot.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Ot.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Ot.BUFFER_KEY,this._buffer);var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Ot.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,t))},Ot.prototype.clearSent=function(e){var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Ot.SENT_BUFFER_KEY,t)},Ot.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Ot.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=oe.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,L," storage key: "+t+", "+oe.getExceptionName(e),{exception:oe.dump(e)})}return[]},Ot.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);oe.setSessionStorage(this._logger,n,r)}catch(e){oe.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,R," storage key: "+n+", "+oe.getExceptionName(e)+". Buffer cleared",{exception:oe.dump(e)})}},Ot.BUFFER_KEY="AI_buffer",Ot.SENT_BUFFER_KEY="AI_sentBuffer",Ot.MAX_BUFFER_SIZE=2e3,Ot);function Ot(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Ot.BUFFER_KEY),r=this.getBuffer(Ot.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Ot.MAX_BUFFER_SIZE&&(this._buffer.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this.setBuffer(Ot.BUFFER_KEY,this._buffer)}var Pt=(kt.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&((t=t||{})[n]=r)}return t},kt.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},kt.createEnvelope=function(e,t,n,r){var i=new _e(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),kt.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},kt.extractPartAExtensions=function(n,e){if(e.tags||(e.tags={}),n.ext||(n.ext={}),n.tags||(n.tags=[]),n.ext.user){n.ext.user.authId&&(e.tags[Rt.userAuthUserId]=n.ext.user.authId);var t=n.ext.user.id||n.ext.user.localId;t&&(e.tags[Rt.userId]=t)}if(n.ext.app&&n.ext.app.sesId&&(e.tags[Rt.sessionId]=n.ext.app.sesId),n.ext.device&&((n.ext.device.id||n.ext.device.localId)&&(e.tags[Rt.deviceId]=n.ext.device.id||n.ext.device.localId),n.ext.device.deviceClass&&(e.tags[Rt.deviceType]=n.ext.device.deviceClass),n.ext.device.ip&&(e.tags[Rt.deviceIp]=n.ext.device.ip)),n.ext.web){var r=n.ext.web;r.browserLang&&(e.tags[Rt.deviceLanguage]=r.browserLang),r.browserVer&&(e.tags[Rt.deviceBrowserVersion]=r.browserVer),r.browser&&(e.tags[Rt.deviceBrowser]=r.browser),e.data=e.data||{},e.data.baseData=e.data.baseData||{},e.data.baseData.properties=e.data.baseData.properties||{},r.domain&&(e.data.baseData.properties.domain=r.domain),r.isManual&&(e.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(e.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(e.data.baseData.properties.userConsent=r.userConsent.toString())}n.ext.device&&n.ext.device.model&&(e.tags[Rt.deviceModel]=n.ext.device.model),n.ext.os&&n.ext.os.name&&(e.tags[Rt.deviceOS]=n.ext.os.name),n.ext.device&&n.ext.device.deviceType&&(e.tags[Rt.deviceType]=n.ext.device.deviceType),n.ext.trace&&(n.ext.trace.parentID&&(e.tags[Rt.operationParentId]=n.ext.trace.parentID),n.ext.trace.name&&(e.tags[Rt.operationName]=n.ext.trace.name),n.ext.trace.traceID&&(e.tags[Rt.operationId]=n.ext.trace.traceID));for(var i={},a=function(e){var t=n.tags[e];Object.keys(t).forEach(function(e){i[e]=t[e]}),n.tags.splice(e,1)},o=n.tags.length-1;0<=o;o--)a(o);for(var s in n.tags)i[s]=n.tags[s];e.tags=p({},e.tags,i),e.tags[Rt.internalSdkVersion]||(e.tags[Rt.internalSdkVersion]="javascript:"+kt.Version)},kt.Version="2.2.1",kt);function kt(){}var zt,Bt=(t(Gt,zt=Pt),Gt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Pt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.correlationContext,f=i.properties&&i.properties[ge]?i.properties[ge]:"GET",h=new ut(e,a,o,s,l,u,c,f,p,d,r,n),g=new Et(ut.dataType,h);return Pt.createEnvelope(e,ut.envelopeType,t,g)},Gt.DependencyEnvelopeCreator=new Gt,Gt);function Gt(){return null!==zt&&zt.apply(this,arguments)||this}var Ft,qt=(t(Ht,Ft=Pt),Ht.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==Ee.dataType&&(n.baseTypeSource=t.baseType),t.baseType===Ee.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Pt.extractPropsAndMeasurements(t.baseData,n,r),Pt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new Ee(e,i,n,r),o=new Et(Ee.dataType,a);return Pt.createEnvelope(e,Ee.envelopeType,t,o)},Ht.EventEnvelopeCreator=new Ht,Ht);function Ht(){return null!==Ft&&Ft.apply(this,arguments)||this}var Xt,jt=(t(Wt,Xt=Pt),Wt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ue.CreateFromInterface(e,n),i=new Et(Ue.dataType,r);return Pt.createEnvelope(e,Ue.envelopeType,t,i)},Wt.ExceptionEnvelopeCreator=new Wt,Wt);function Wt(){return null!==Xt&&Xt.apply(this,arguments)||this}var Vt,Kt=(t(Yt,Vt=Pt),Yt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Pt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new Ze(e,i,a,o,s,l,r),c=new Et(Ze.dataType,u);return Pt.createEnvelope(e,Ze.envelopeType,t,c)},Yt.MetricEnvelopeCreator=new Yt,Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}var Jt,Zt=(t(Qt,Jt=Pt),Qt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r,i=t.baseData;t.ext&&t.ext.trace&&t.ext.trace.traceID&&(r=t.ext.trace.traceID);var a=i.id||r,o=i.name,s=i.uri,l=i.properties||{},u=i.measurements||{};if(m.isNullOrUndefined(i.refUri)||(l.refUri=i.refUri),m.isNullOrUndefined(i.pageType)||(l.pageType=i.pageType),m.isNullOrUndefined(i.isLoggedIn)||(l.isLoggedIn=i.isLoggedIn.toString()),!m.isNullOrUndefined(i.properties)){var c=i.properties;for(var p in c)c.hasOwnProperty(p)&&(l[p]=c[p])}Pt.extractPropsAndMeasurements(t.data,l,u);var d=new rt(e,o,s,n,l,u,a),f=new Et(rt.dataType,d);return Pt.createEnvelope(e,rt.envelopeType,t,f)},Qt.PageViewEnvelopeCreator=new Qt,Qt);function Qt(){return null!==Jt&&Jt.apply(this,arguments)||this}var $t,en=(t(tn,$t=Pt),tn.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri||n.url,a=n.properties||{},o=n.measurements||{};Pt.extractPropsAndMeasurements(t.data,a,o);var s=new St(e,r,i,void 0,a,o,n),l=new Et(St.dataType,s);return Pt.createEnvelope(e,St.envelopeType,t,l)},tn.PageViewPerformanceEnvelopeCreator=new tn,tn);function tn(){return null!==$t&&$t.apply(this,arguments)||this}var nn,rn=(t(an,nn=Pt),an.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Pt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new gt(e,n,r,a),s=new Et(gt.dataType,o);return Pt.createEnvelope(e,gt.envelopeType,t,s)},an.TraceEnvelopeCreator=new an,an);function an(){return null!==nn&&nn.apply(this,arguments)||this}var on=(sn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},sn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,P,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,z,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(oe.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,k,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,P,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,l="function"==typeof o?o()&h.Hidden:o&h.Hidden,u=o&h.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,E,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},sn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(oe.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,G,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},sn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},sn);function sn(e){this._logger=e}function ln(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var un=(ln.prototype._setOnline=function(){this._onlineStatus=!0},ln.prototype._setOffline=function(){this._onlineStatus=!1},ln.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},ln.prototype.isOffline=function(){return!this.isOnline()},ln.Offline=new ln,ln).Offline,cn=(pn.prototype.getHashCodeScore=function(e){return this.getHashCode(e)/pn.INT_MAX_VALUE*100},pn.prototype.getHashCode=function(e){if(""==e)return 0;for(;e.length<pn.MIN_INPUT_LENGTH;)e=e.concat(e);for(var t=5381,n=0;n<e.length;++n)t=(t<<5)+t+e.charCodeAt(n),t&=t;return Math.abs(t)},pn.INT_MAX_VALUE=2147483647,pn.MIN_INPUT_LENGTH=8,pn);function pn(){}var dn=(fn.prototype.getSamplingScore=function(e){return e.tags&&e.tags[this.keys.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.userId]):e.ext&&e.ext.user&&e.ext.user.id?this.hashCodeGeneragor.getHashCodeScore(e.ext.user.id):e.tags&&e.tags[this.keys.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.operationId]):e.ext&&e.ext.telemetryTrace&&e.ext.telemetryTrace.traceID?this.hashCodeGeneragor.getHashCodeScore(e.ext.telemetryTrace.traceID):100*Math.random()},fn);function fn(){this.hashCodeGeneragor=new cn,this.keys=new Tt}var hn=(gn.prototype.isSampledIn=function(e){var t=this.sampleRate;return null==t||100<=t||e.baseType===Ze.dataType||this.samplingScoreGenerator.getSamplingScore(e)<t},gn);function gn(e,t){this.INT_MAX_VALUE=2147483647,m.isNullOrUndefined(t)?this._logger=new $:this._logger=t,(100<e||e<0)&&(this._logger.throwInternal(v.WARNING,H,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new dn}var mn=(vn.prototype.pause=function(){throw new Error("Method not implemented.")},vn.prototype.resume=function(){throw new Error("Method not implemented.")},vn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,x,"flush failed, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.onunloadFlush=function(){if(!1!==this._config.onunloadDisableBeacon()&&!1!==this._config.isBeaconApiDisabled()||!oe.IsBeaconApiSupported())this.flush();else try{this.triggerSend(!0,this._beaconSender)}catch(e){this._logger.throwInternal(v.CRITICAL,w,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.teardown=function(){throw new Error("Method not implemented.")},vn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new on(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=vn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return At.getConfig(t,e,r.identifier,i[e]())}}this._config=vn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&oe.canUseSessionStorage()?new Ut(this._logger,this._config):new Lt(this._config),this._sample=new hn(this._config.samplingPercentage(),this._logger),!this._config.isBeaconApiDisabled()&&oe.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},vn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,S,"Cannot send empty telemetry");if(e.baseData&&!e.baseType)return void this._logger.throwInternal(v.CRITICAL,J,"Cannot send telemetry without baseData and baseType");if(e.baseType||(e.baseType="EventData"),!this._sender)return void this._logger.throwInternal(v.CRITICAL,A,"Sender was not initialized");if(!this._isSampledIn(e))return void this._logger.throwInternal(v.WARNING,D,"Telemetry item was sampled out and not sent",{SampleRate:this._sample.sampleRate});e.tags=e.tags||{},e.tags.sampleRate=this._sample.sampleRate;var n=vn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,O,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[he]&&(e.tags[he].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+oe.getExceptionName(e),{exception:oe.dump(e)},!0)}}),delete e.tags[he]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,b,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},vn.prototype.setNextPlugin=function(e){this._nextPlugin=e},vn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,T,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):un.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,T,". Offline - Response Code: "+e.status+". Offline status: "+un.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r=r||this._parseResponse(e.responseText||e.response))&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e)):(this._consecutiveErrors=0,this._onSuccess(t,n))}},vn.prototype.triggerSend=function(e,t){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var n=this._buffer.getItems();t?t.call(this,n,e):this._sender(n,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!oe.getIEVersion()||9<oe.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,T,"Telemetry transmission failed, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,C,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},vn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,T,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},vn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},vn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},vn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case Ee.dataType:return qt.EventEnvelopeCreator.Create(n,r);case gt.dataType:return rn.TraceEnvelopeCreator.Create(n,r);case rt.dataType:return Zt.PageViewEnvelopeCreator.Create(n,r);case St.dataType:return en.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ue.dataType:return jt.ExceptionEnvelopeCreator.Create(n,r);case Ze.dataType:return Kt.MetricEnvelopeCreator.Create(n,r);case ut.dataType:return Bt.DependencyEnvelopeCreator.Create(n,r);default:return qt.EventEnvelopeCreator.Create(n,r)}},vn._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100}}},vn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,onunloadDisableBeacon:void 0,instrumentationKey:void 0,namePrefix:void 0,samplingPercentage:void 0}},vn.prototype._isSampledIn=function(e){return this._sample.isSampledIn(e)},vn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?(this._buffer.markAsSent(e),this._onSuccess(e,e.length)):(this._xhrSender(e,!0),this._logger.throwInternal(v.WARNING,T,". Failed to send telemetry with Beacon API, retried with xhrSender."))},vn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),oe.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(ne.sdkContextHeader,ne.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},vn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,M,"Cannot parse the response. "+oe.getExceptionName(e),{response:t})}return null},vn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},vn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},vn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},vn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},vn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},vn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,T,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},vn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},vn);function vn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=mn,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,h,a,o,s,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=h=h||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var m=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var v,u,c=/[xy]/g;(u=v=v||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,f=2,g=3,y=4,_=5,I=6,S=7,b=12,w=20,x=22,N=23,E=24,C=26,A=28,D=33,T=40,R=41,L=42,M=43,U=46,O=47,P=48,k=49,z=50,B=52,G=54,F=56,q=57,H=58,X=61,j=64,W=66,V=67,K=68,Y=69,J=70,Z=(Q.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},Q.dataType="MessageData",Q.AiNonUserActionablePrefix="AI (Internal): ",Q.AiUserActionablePrefix="AI: ",Q);function Q(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Q.AiUserActionablePrefix:Q.AiNonUserActionablePrefix)+e;var i=(t?" message:"+Q.sanitizeDiagnosticText(t):"")+(r?" props:"+Q.sanitizeDiagnosticText(JSON.stringify(r)):"");this.message+=i}var $=(ee.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Z(t,n,i,r);if(this.enableDebugExceptions())throw a;if(void 0!==a&&a&&void 0!==a.message){if(i){var o=+a.messageId;(!this._messageLogged[o]||this.consoleLoggingLevel()>=v.WARNING)&&(this.warnToConsole(a.message),this._messageLogged[o]=!0)}else this.consoleLoggingLevel()>=v.WARNING&&this.warnToConsole(a.message);this.logInternalMessage(e,a)}},ee.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},ee.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ee.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,r=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[r]?n=!1:this._messageLogged[r]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount==this.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",a=new Z(N,i,!1);this.queue.push(a),this.warnToConsole(i)}}},ee.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ee);function ee(e){this.AIInternalMessagePrefix="AITR_",this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},this.queue=[],this._messageCount=0,this._messageLogged={},m.isNullOrUndefined(e)||(m.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),m.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),m.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),m.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}te.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(te.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),te.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,i)}),this.channelQueue.push(e)}};function te(){this.identifier="ChannelControllerPlugin",this.priority=500}var ne=(re.requestContextHeader="Request-Context",re.requestContextTargetKey="appId",re.requestContextAppIdFormat="appId=cid-v1:",re.requestIdHeader="Request-Id",re.traceParentHeader="traceparent",re.sdkContextHeader="Sdk-Context",re.sdkContextHeaderAppIdRequest="appId",re.requestContextHeaderLowerCase="request-context",re);function re(){}var ie=(ae.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=ae.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,ae.MAX_NAME_LENGTH-3)+ae.padNumber(a);i=o}return i},ae.sanitizeKey=function(e,t){var n;return t&&(t=ae.trim(t.toString())).length>ae.MAX_NAME_LENGTH&&(n=t.substring(0,ae.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,q,"name is too long. It has been truncated to "+ae.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ae.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=ae.MAX_STRING_LENGTH),t&&(n=n||ae.MAX_STRING_LENGTH,(t=ae.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,X,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},ae.sanitizeUrl=function(e,t){return ae.sanitizeInput(e,t,ae.MAX_URL_LENGTH,W)},ae.sanitizeMessage=function(e,t){var n;return t&&t.length>ae.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ae.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,F,"message is too long, it has been truncated to "+ae.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ae.sanitizeException=function(e,t){var n;return t&&t.length>ae.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ae.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,B,"exception is too long, it has been truncated to "+ae.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ae.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(v.WARNING,k,"custom property is not valid",{exception:e},!0)}i=ae.sanitizeString(t,i,ae.MAX_PROPERTY_LENGTH),n[r=ae.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},ae.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=ae.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},ae.sanitizeId=function(e,t){return t?ae.sanitizeInput(e,t,ae.MAX_ID_LENGTH,Y).toString():t},ae.sanitizeInput=function(e,t,n,r){var i;return t&&(t=ae.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},ae.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ae.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ae.MAX_NAME_LENGTH=150,ae.MAX_ID_LENGTH=128,ae.MAX_PROPERTY_LENGTH=8192,ae.MAX_STRING_LENGTH=1024,ae.MAX_URL_LENGTH=2048,ae.MAX_MESSAGE_LENGTH=32768,ae.MAX_EXCEPTION_LENGTH=32768,ae);function ae(){}var oe=(se.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},se.disableStorage=function(){se._canUseLocalStorage=!1,se._canUseSessionStorage=!1},se._getLocalStorageObject=function(){return se.canUseLocalStorage()?se._getVerifiedStorageObject(i.LocalStorage):null},se._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},se.isInternalApplicationInsightsEndpoint=function(e){return-1!==se._internalEndpoints.indexOf(e.toLowerCase())},se.canUseLocalStorage=function(){return void 0===se._canUseLocalStorage&&(se._canUseLocalStorage=!!se._getVerifiedStorageObject(i.LocalStorage)),se._canUseLocalStorage},se.getStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed read of local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setStorage=function(t,e,n){var r=se._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,g,"Browser failed write to local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,_,"Browser failed removal of local storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se._getSessionStorageObject=function(){return se.canUseSessionStorage()?se._getVerifiedStorageObject(i.SessionStorage):null},se.canUseSessionStorage=function(){return void 0===se._canUseSessionStorage&&(se._canUseSessionStorage=!!se._getVerifiedStorageObject(i.SessionStorage)),se._canUseSessionStorage},se.getSessionStorageKeys=function(){var e=[];if(se.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},se.getSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,f,"Browser failed read of session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setSessionStorage=function(t,e,n){var r=se._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed write to session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,I,"Browser failed removal of session storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.disableCookies=function(){m.disableCookies()},se.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==se.document.cookie}catch(e){t.throwInternal(v.WARNING,K,"Cannot access document.cookie - "+se.getExceptionName(e),{exception:se.dump(e)})}}return m._canUseCookies},se.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),se.document.location&&"https:"===se.document.location.protocol&&(a=";secure"),se.canUseCookies(e)&&(se.document.cookie=t+"="+n+i+";path=/"+a)},se.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},se.getCookie=function(e,t){if(se.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=se.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=se.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},se.deleteCookie=function(e,t){se.canUseCookies(e)&&(se.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},se.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},se.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},se.random32=function(){return 4294967296*Math.random()|0},se.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=se.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},se.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},se.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},se.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},se.toISOStringForIE8=function(e){if(se.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"}},se.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},se.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},se.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},se.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},se.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},se.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},se.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},se.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},se.document="undefined"!=typeof document?document:{},se._canUseLocalStorage=void 0,se._canUseSessionStorage=void 0,se._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],se.NotSpecified="not_specified",se);function se(){}var le=(ue.parseUrl=function(e){return ue.htmlAnchorElement||(ue.htmlAnchorElement=ue.document.createElement?ue.document.createElement("a"):{host:ue.parseHost(e)}),ue.htmlAnchorElement.href=e,ue.htmlAnchorElement},ue.getAbsoluteUrl=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.href),t},ue.getPathName=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.pathname),t},ue.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ue.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},ue.document="undefined"!=typeof document?document:{},ue);function ue(){}var ce=(pe.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=le.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=ie.sanitizeString(e,n?n+" "+l:l)}else a=ie.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},pe);function pe(){}de.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()},de.GetDuration=function(e,t){var n=null;return 0===e||0===t||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n};function de(){}var fe,he="ProcessLegacy",ge="http.method",me=(t(ve,fe=function(){}),ve);function ve(){return fe.call(this)||this}var ye,_e=(t(Ie,ye=function(){this.ver=1,this.sampleRate=100,this.tags={}}),Ie);function Ie(e,t,n){var r=ye.call(this)||this;return r.name=ie.sanitizeString(e,n)||oe.NotSpecified,r.data=t,r.time=oe.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 Se(){}var be,we=(t(xe,be=Se),xe);function xe(){var e=be.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ne,Ee=(t(Ce,Ne=we),Ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Ce.dataType="EventData",Ce);function Ce(e,t,n,r){var i=Ne.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=ie.sanitizeString(e,t)||oe.NotSpecified,i.properties=ie.sanitizeProperties(e,n),i.measurements=ie.sanitizeMeasurements(e,r),i}function Ae(){}var De,Te=(t(Re,De=Se),Re);function Re(){var e=De.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function Le(){this.hasFullStack=!0,this.parsedStack=[]}var Me,Ue=(t(Oe,Me=Te),Oe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ke.CreateFromInterface(t,e)});return new Oe(t,p({},e,{exceptions:n}))},Oe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,l=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:l}},Oe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Oe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Oe.dataType="ExceptionData",Oe);function Oe(e,t,n,r,i,a){var o=Me.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new ke(e,t)],o.properties=ie.sanitizeProperties(e,n),o.measurements=ie.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),m.isNullOrUndefined(t.ver)||(o.ver=t.ver),m.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Pe,ke=(t(ze,Pe=Le),ze.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}},ze.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ge.CreateFromInterface(e)})||t.parsedStack;return new ze(e,p({},t,{parsedStack:n}))},ze.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(Ge.regex.test(o)){var s=new Ge(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},ze);function ze(e,t){var n=Pe.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=ie.sanitizeString(e,t.name)||oe.NotSpecified,n.message=ie.sanitizeMessage(e,t.message)||oe.NotSpecified;var r=t.stack;n.parsedStack=ze.parseStack(r),n.stack=ie.sanitizeException(e,r),n.hasFullStack=oe.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 Be,Ge=(t(Fe,Be=Ae),Fe.CreateFromInterface=function(e){return new Fe(e,null)},Fe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Fe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Fe.baseSize=58,Fe);function Fe(e,t){var n=Be.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=oe.trim(r),n.fileName="",n.line=0;var i=r.match(Fe.regex);i&&5<=i.length&&(n.method=oe.trim(i[2])||n.method,n.fileName=oe.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+=Fe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qe,He,Xe,je=(t(We,qe=Se),We);function We(){var e=qe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Xe=He=He||{})[Xe.Measurement=0]="Measurement",Xe[Xe.Aggregation=1]="Aggregation";var Ve,Ke=(t(Ye,Ve=function(){this.kind=He.Measurement}),Ye);function Ye(){var e=null!==Ve&&Ve.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 Je,Ze=(t(Qe,Je=je),Qe.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Qe.dataType="MetricData",Qe);function Qe(e,t,n,r,i,a,o){var s=Je.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var l=new Ke;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=ie.sanitizeString(e,t)||oe.NotSpecified,l.value=n,s.metrics=[l],s.properties=ie.sanitizeProperties(e,o),s}var $e,et=(t(tt,$e=we),tt);function tt(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var nt,rt=(t(it,nt=et),it.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",it.dataType="PageviewData",it);function it(e,t,n,r,i,a,o){var s=nt.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=ie.sanitizeId(e,o),s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,isNaN(r)||(s.duration=oe.msToTimeSpan(r)),s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),s}var at,ot=(t(st,at=Se),st);function st(){var e=at.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var lt,ut=(t(ct,lt=ot),ct.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ct.dataType="RemoteDependencyData",ct);function ct(e,t,n,r,i,a,o,s,l,u,c,p){void 0===l&&(l="Ajax");var d=lt.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=oe.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=ie.sanitizeString(e,l);var f=ce.ParseDependencyPath(e,n,s,r);return d.data=ie.sanitizeUrl(e,r)||f.data,d.target=ie.sanitizeString(e,f.target),u&&(d.target=d.target+" | "+u),d.name=ie.sanitizeString(e,f.name),d.properties=ie.sanitizeProperties(e,c),d.measurements=ie.sanitizeMeasurements(e,p),d}var pt,dt=(t(ft,pt=Se),ft);function ft(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e}var ht,gt=(t(mt,ht=dt),mt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mt.dataType="MessageData",mt);function mt(e,t,n,r){var i=ht.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||oe.NotSpecified,i.message=ie.sanitizeMessage(e,t),i.properties=ie.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var vt,yt=(t(_t,vt=et),_t);function _t(){var e=vt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var It,St=(t(bt,It=yt),bt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",bt.dataType="PageviewPerformanceData",bt);function bt(e,t,n,r,i,a,o){var s=It.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var wt,xt,Nt,Et=(t(Ct,wt=me),Ct);function Ct(e,t){var n=wt.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(Nt=xt=xt||{})[Nt.Verbose=0]="Verbose",Nt[Nt.Information=1]="Information",Nt[Nt.Warning=2]="Warning",Nt[Nt.Error=3]="Error",Nt[Nt.Critical=4]="Critical";var At=(Dt.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},Dt);function Dt(){}var Tt=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},Rt=new Tt,Lt=(Mt.prototype.enqueue=function(e){this._buffer.push(e)},Mt.prototype.count=function(){return this._buffer.length},Mt.prototype.clear=function(){this._buffer.length=0},Mt.prototype.getItems=function(){return this._buffer.slice(0)},Mt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Mt.prototype.markAsSent=function(e){this.clear()},Mt.prototype.clearSent=function(e){},Mt);function Mt(e){this._config=e,this._buffer=[]}var Ut=(Ot.prototype.enqueue=function(e){this._buffer.length>=Ot.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Ot.BUFFER_KEY,this._buffer))},Ot.prototype.count=function(){return this._buffer.length},Ot.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Ot.BUFFER_KEY,[]),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Ot.prototype.getItems=function(){return this._buffer.slice(0)},Ot.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Ot.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Ot.BUFFER_KEY,this._buffer);var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Ot.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,t))},Ot.prototype.clearSent=function(e){var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Ot.SENT_BUFFER_KEY,t)},Ot.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Ot.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=oe.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,L," storage key: "+t+", "+oe.getExceptionName(e),{exception:oe.dump(e)})}return[]},Ot.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);oe.setSessionStorage(this._logger,n,r)}catch(e){oe.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,R," storage key: "+n+", "+oe.getExceptionName(e)+". Buffer cleared",{exception:oe.dump(e)})}},Ot.BUFFER_KEY="AI_buffer",Ot.SENT_BUFFER_KEY="AI_sentBuffer",Ot.MAX_BUFFER_SIZE=2e3,Ot);function Ot(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Ot.BUFFER_KEY),r=this.getBuffer(Ot.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Ot.MAX_BUFFER_SIZE&&(this._buffer.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this.setBuffer(Ot.BUFFER_KEY,this._buffer)}var Pt=(kt.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&((t=t||{})[n]=r)}return t},kt.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},kt.createEnvelope=function(e,t,n,r){var i=new _e(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),kt.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},kt.extractPartAExtensions=function(n,e){if(e.tags||(e.tags={}),n.ext||(n.ext={}),n.tags||(n.tags=[]),n.ext.user){n.ext.user.authId&&(e.tags[Rt.userAuthUserId]=n.ext.user.authId);var t=n.ext.user.id||n.ext.user.localId;t&&(e.tags[Rt.userId]=t)}if(n.ext.app&&n.ext.app.sesId&&(e.tags[Rt.sessionId]=n.ext.app.sesId),n.ext.device&&((n.ext.device.id||n.ext.device.localId)&&(e.tags[Rt.deviceId]=n.ext.device.id||n.ext.device.localId),n.ext.device.deviceClass&&(e.tags[Rt.deviceType]=n.ext.device.deviceClass),n.ext.device.ip&&(e.tags[Rt.deviceIp]=n.ext.device.ip)),n.ext.web){var r=n.ext.web;r.browserLang&&(e.tags[Rt.deviceLanguage]=r.browserLang),r.browserVer&&(e.tags[Rt.deviceBrowserVersion]=r.browserVer),r.browser&&(e.tags[Rt.deviceBrowser]=r.browser),e.data=e.data||{},e.data.baseData=e.data.baseData||{},e.data.baseData.properties=e.data.baseData.properties||{},r.domain&&(e.data.baseData.properties.domain=r.domain),r.isManual&&(e.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(e.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(e.data.baseData.properties.userConsent=r.userConsent.toString())}n.ext.device&&n.ext.device.model&&(e.tags[Rt.deviceModel]=n.ext.device.model),n.ext.os&&n.ext.os.name&&(e.tags[Rt.deviceOS]=n.ext.os.name),n.ext.device&&n.ext.device.deviceType&&(e.tags[Rt.deviceType]=n.ext.device.deviceType),n.ext.trace&&(n.ext.trace.parentID&&(e.tags[Rt.operationParentId]=n.ext.trace.parentID),n.ext.trace.name&&(e.tags[Rt.operationName]=n.ext.trace.name),n.ext.trace.traceID&&(e.tags[Rt.operationId]=n.ext.trace.traceID));for(var i={},a=function(e){var t=n.tags[e];Object.keys(t).forEach(function(e){i[e]=t[e]}),n.tags.splice(e,1)},o=n.tags.length-1;0<=o;o--)a(o);for(var s in n.tags)i[s]=n.tags[s];e.tags=p({},e.tags,i),e.tags[Rt.internalSdkVersion]||(e.tags[Rt.internalSdkVersion]="javascript:"+kt.Version)},kt.Version="2.2.2",kt);function kt(){}var zt,Bt=(t(Gt,zt=Pt),Gt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Pt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.correlationContext,f=i.properties&&i.properties[ge]?i.properties[ge]:"GET",h=new ut(e,a,o,s,l,u,c,f,p,d,r,n),g=new Et(ut.dataType,h);return Pt.createEnvelope(e,ut.envelopeType,t,g)},Gt.DependencyEnvelopeCreator=new Gt,Gt);function Gt(){return null!==zt&&zt.apply(this,arguments)||this}var Ft,qt=(t(Ht,Ft=Pt),Ht.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==Ee.dataType&&(n.baseTypeSource=t.baseType),t.baseType===Ee.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Pt.extractPropsAndMeasurements(t.baseData,n,r),Pt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new Ee(e,i,n,r),o=new Et(Ee.dataType,a);return Pt.createEnvelope(e,Ee.envelopeType,t,o)},Ht.EventEnvelopeCreator=new Ht,Ht);function Ht(){return null!==Ft&&Ft.apply(this,arguments)||this}var Xt,jt=(t(Wt,Xt=Pt),Wt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ue.CreateFromInterface(e,n),i=new Et(Ue.dataType,r);return Pt.createEnvelope(e,Ue.envelopeType,t,i)},Wt.ExceptionEnvelopeCreator=new Wt,Wt);function Wt(){return null!==Xt&&Xt.apply(this,arguments)||this}var Vt,Kt=(t(Yt,Vt=Pt),Yt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Pt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new Ze(e,i,a,o,s,l,r),c=new Et(Ze.dataType,u);return Pt.createEnvelope(e,Ze.envelopeType,t,c)},Yt.MetricEnvelopeCreator=new Yt,Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}var Jt,Zt=(t(Qt,Jt=Pt),Qt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r,i=t.baseData;t.ext&&t.ext.trace&&t.ext.trace.traceID&&(r=t.ext.trace.traceID);var a=i.id||r,o=i.name,s=i.uri,l=i.properties||{},u=i.measurements||{};if(m.isNullOrUndefined(i.refUri)||(l.refUri=i.refUri),m.isNullOrUndefined(i.pageType)||(l.pageType=i.pageType),m.isNullOrUndefined(i.isLoggedIn)||(l.isLoggedIn=i.isLoggedIn.toString()),!m.isNullOrUndefined(i.properties)){var c=i.properties;for(var p in c)c.hasOwnProperty(p)&&(l[p]=c[p])}Pt.extractPropsAndMeasurements(t.data,l,u);var d=new rt(e,o,s,n,l,u,a),f=new Et(rt.dataType,d);return Pt.createEnvelope(e,rt.envelopeType,t,f)},Qt.PageViewEnvelopeCreator=new Qt,Qt);function Qt(){return null!==Jt&&Jt.apply(this,arguments)||this}var $t,en=(t(tn,$t=Pt),tn.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri||n.url,a=n.properties||{},o=n.measurements||{};Pt.extractPropsAndMeasurements(t.data,a,o);var s=new St(e,r,i,void 0,a,o,n),l=new Et(St.dataType,s);return Pt.createEnvelope(e,St.envelopeType,t,l)},tn.PageViewPerformanceEnvelopeCreator=new tn,tn);function tn(){return null!==$t&&$t.apply(this,arguments)||this}var nn,rn=(t(an,nn=Pt),an.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Pt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new gt(e,n,r,a),s=new Et(gt.dataType,o);return Pt.createEnvelope(e,gt.envelopeType,t,s)},an.TraceEnvelopeCreator=new an,an);function an(){return null!==nn&&nn.apply(this,arguments)||this}var on=(sn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},sn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,P,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,z,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(oe.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,k,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,P,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,l="function"==typeof o?o()&h.Hidden:o&h.Hidden,u=o&h.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,E,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},sn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(oe.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,G,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},sn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},sn);function sn(e){this._logger=e}function ln(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var un=(ln.prototype._setOnline=function(){this._onlineStatus=!0},ln.prototype._setOffline=function(){this._onlineStatus=!1},ln.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},ln.prototype.isOffline=function(){return!this.isOnline()},ln.Offline=new ln,ln).Offline,cn=(pn.prototype.getHashCodeScore=function(e){return this.getHashCode(e)/pn.INT_MAX_VALUE*100},pn.prototype.getHashCode=function(e){if(""==e)return 0;for(;e.length<pn.MIN_INPUT_LENGTH;)e=e.concat(e);for(var t=5381,n=0;n<e.length;++n)t=(t<<5)+t+e.charCodeAt(n),t&=t;return Math.abs(t)},pn.INT_MAX_VALUE=2147483647,pn.MIN_INPUT_LENGTH=8,pn);function pn(){}var dn=(fn.prototype.getSamplingScore=function(e){return e.tags&&e.tags[this.keys.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.userId]):e.ext&&e.ext.user&&e.ext.user.id?this.hashCodeGeneragor.getHashCodeScore(e.ext.user.id):e.tags&&e.tags[this.keys.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.operationId]):e.ext&&e.ext.telemetryTrace&&e.ext.telemetryTrace.traceID?this.hashCodeGeneragor.getHashCodeScore(e.ext.telemetryTrace.traceID):100*Math.random()},fn);function fn(){this.hashCodeGeneragor=new cn,this.keys=new Tt}var hn=(gn.prototype.isSampledIn=function(e){var t=this.sampleRate;return null==t||100<=t||e.baseType===Ze.dataType||this.samplingScoreGenerator.getSamplingScore(e)<t},gn);function gn(e,t){this.INT_MAX_VALUE=2147483647,m.isNullOrUndefined(t)?this._logger=new $:this._logger=t,(100<e||e<0)&&(this._logger.throwInternal(v.WARNING,H,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new dn}var mn=(vn.prototype.pause=function(){throw new Error("Method not implemented.")},vn.prototype.resume=function(){throw new Error("Method not implemented.")},vn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,x,"flush failed, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.onunloadFlush=function(){if(!1!==this._config.onunloadDisableBeacon()&&!1!==this._config.isBeaconApiDisabled()||!oe.IsBeaconApiSupported())this.flush();else try{this.triggerSend(!0,this._beaconSender)}catch(e){this._logger.throwInternal(v.CRITICAL,w,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.teardown=function(){throw new Error("Method not implemented.")},vn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new on(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=vn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return At.getConfig(t,e,r.identifier,i[e]())}}this._config=vn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&oe.canUseSessionStorage()?new Ut(this._logger,this._config):new Lt(this._config),this._sample=new hn(this._config.samplingPercentage(),this._logger),!this._config.isBeaconApiDisabled()&&oe.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},vn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,S,"Cannot send empty telemetry");if(e.baseData&&!e.baseType)return void this._logger.throwInternal(v.CRITICAL,J,"Cannot send telemetry without baseData and baseType");if(e.baseType||(e.baseType="EventData"),!this._sender)return void this._logger.throwInternal(v.CRITICAL,A,"Sender was not initialized");if(!this._isSampledIn(e))return void this._logger.throwInternal(v.WARNING,D,"Telemetry item was sampled out and not sent",{SampleRate:this._sample.sampleRate});e.tags=e.tags||{},e.tags.sampleRate=this._sample.sampleRate;var n=vn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,O,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[he]&&(e.tags[he].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+oe.getExceptionName(e),{exception:oe.dump(e)},!0)}}),delete e.tags[he]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,b,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},vn.prototype.setNextPlugin=function(e){this._nextPlugin=e},vn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,T,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):un.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,T,". Offline - Response Code: "+e.status+". Offline status: "+un.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r=r||this._parseResponse(e.responseText||e.response))&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e)):(this._consecutiveErrors=0,this._onSuccess(t,n))}},vn.prototype.triggerSend=function(e,t){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var n=this._buffer.getItems();t?t.call(this,n,e):this._sender(n,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!oe.getIEVersion()||9<oe.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,T,"Telemetry transmission failed, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,C,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},vn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,T,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},vn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},vn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},vn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case Ee.dataType:return qt.EventEnvelopeCreator.Create(n,r);case gt.dataType:return rn.TraceEnvelopeCreator.Create(n,r);case rt.dataType:return Zt.PageViewEnvelopeCreator.Create(n,r);case St.dataType:return en.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ue.dataType:return jt.ExceptionEnvelopeCreator.Create(n,r);case Ze.dataType:return Kt.MetricEnvelopeCreator.Create(n,r);case ut.dataType:return Bt.DependencyEnvelopeCreator.Create(n,r);default:return qt.EventEnvelopeCreator.Create(n,r)}},vn._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100}}},vn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,onunloadDisableBeacon:void 0,instrumentationKey:void 0,namePrefix:void 0,samplingPercentage:void 0}},vn.prototype._isSampledIn=function(e){return this._sample.isSampledIn(e)},vn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?(this._buffer.markAsSent(e),this._onSuccess(e,e.length)):(this._xhrSender(e,!0),this._logger.throwInternal(v.WARNING,T,". Failed to send telemetry with Beacon API, retried with xhrSender."))},vn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),oe.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(ne.sdkContextHeader,ne.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},vn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,M,"Cannot parse the response. "+oe.getExceptionName(e),{response:t})}return null},vn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},vn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},vn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},vn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},vn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},vn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,T,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},vn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},vn);function vn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=mn,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-channel-js.min.js.map

@@ -186,3 +186,3 @@ import * as tslib_1 from "tslib";

};
EnvelopeCreator.Version = "2.2.1";
EnvelopeCreator.Version = "2.2.2";
return EnvelopeCreator;

@@ -189,0 +189,0 @@ }());

/*!
* Application Insights JavaScript SDK - Channel, 2.2.1
* Application Insights JavaScript SDK - Channel, 2.2.2
* Copyright (c) Microsoft and contributors. All rights reserved.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,h,a,o,s,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=h=h||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var m=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var v,u,c=/[xy]/g;(u=v=v||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,f=2,g=3,y=4,_=5,I=6,S=7,b=12,w=20,x=22,N=23,E=24,C=26,A=28,D=33,T=40,R=41,L=42,M=43,U=46,O=47,P=48,k=49,z=50,B=52,G=54,F=56,q=57,H=58,X=61,j=64,W=66,V=67,K=68,Y=69,J=70,Z=(Q.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},Q.dataType="MessageData",Q.AiNonUserActionablePrefix="AI (Internal): ",Q.AiUserActionablePrefix="AI: ",Q);function Q(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Q.AiUserActionablePrefix:Q.AiNonUserActionablePrefix)+e;var i=(t?" message:"+Q.sanitizeDiagnosticText(t):"")+(r?" props:"+Q.sanitizeDiagnosticText(JSON.stringify(r)):"");this.message+=i}var $=(ee.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Z(t,n,i,r);if(this.enableDebugExceptions())throw a;if(void 0!==a&&a&&void 0!==a.message){if(i){var o=+a.messageId;(!this._messageLogged[o]||this.consoleLoggingLevel()>=v.WARNING)&&(this.warnToConsole(a.message),this._messageLogged[o]=!0)}else this.consoleLoggingLevel()>=v.WARNING&&this.warnToConsole(a.message);this.logInternalMessage(e,a)}},ee.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},ee.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ee.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,r=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[r]?n=!1:this._messageLogged[r]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount==this.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",a=new Z(N,i,!1);this.queue.push(a),this.warnToConsole(i)}}},ee.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ee);function ee(e){this.AIInternalMessagePrefix="AITR_",this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},this.queue=[],this._messageCount=0,this._messageLogged={},m.isNullOrUndefined(e)||(m.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),m.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),m.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),m.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}te.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(te.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),te.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,i)}),this.channelQueue.push(e)}};function te(){this.identifier="ChannelControllerPlugin",this.priority=500}var ne=(re.requestContextHeader="Request-Context",re.requestContextTargetKey="appId",re.requestContextAppIdFormat="appId=cid-v1:",re.requestIdHeader="Request-Id",re.traceParentHeader="traceparent",re.sdkContextHeader="Sdk-Context",re.sdkContextHeaderAppIdRequest="appId",re.requestContextHeaderLowerCase="request-context",re);function re(){}var ie=(ae.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=ae.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,ae.MAX_NAME_LENGTH-3)+ae.padNumber(a);i=o}return i},ae.sanitizeKey=function(e,t){var n;return t&&(t=ae.trim(t.toString())).length>ae.MAX_NAME_LENGTH&&(n=t.substring(0,ae.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,q,"name is too long. It has been truncated to "+ae.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ae.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=ae.MAX_STRING_LENGTH),t&&(n=n||ae.MAX_STRING_LENGTH,(t=ae.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,X,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},ae.sanitizeUrl=function(e,t){return ae.sanitizeInput(e,t,ae.MAX_URL_LENGTH,W)},ae.sanitizeMessage=function(e,t){var n;return t&&t.length>ae.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ae.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,F,"message is too long, it has been truncated to "+ae.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ae.sanitizeException=function(e,t){var n;return t&&t.length>ae.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ae.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,B,"exception is too long, it has been truncated to "+ae.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ae.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(v.WARNING,k,"custom property is not valid",{exception:e},!0)}i=ae.sanitizeString(t,i,ae.MAX_PROPERTY_LENGTH),n[r=ae.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},ae.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=ae.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},ae.sanitizeId=function(e,t){return t?ae.sanitizeInput(e,t,ae.MAX_ID_LENGTH,Y).toString():t},ae.sanitizeInput=function(e,t,n,r){var i;return t&&(t=ae.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},ae.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ae.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ae.MAX_NAME_LENGTH=150,ae.MAX_ID_LENGTH=128,ae.MAX_PROPERTY_LENGTH=8192,ae.MAX_STRING_LENGTH=1024,ae.MAX_URL_LENGTH=2048,ae.MAX_MESSAGE_LENGTH=32768,ae.MAX_EXCEPTION_LENGTH=32768,ae);function ae(){}var oe=(se.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},se.disableStorage=function(){se._canUseLocalStorage=!1,se._canUseSessionStorage=!1},se._getLocalStorageObject=function(){return se.canUseLocalStorage()?se._getVerifiedStorageObject(i.LocalStorage):null},se._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},se.isInternalApplicationInsightsEndpoint=function(e){return-1!==se._internalEndpoints.indexOf(e.toLowerCase())},se.canUseLocalStorage=function(){return void 0===se._canUseLocalStorage&&(se._canUseLocalStorage=!!se._getVerifiedStorageObject(i.LocalStorage)),se._canUseLocalStorage},se.getStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed read of local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setStorage=function(t,e,n){var r=se._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,g,"Browser failed write to local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,_,"Browser failed removal of local storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se._getSessionStorageObject=function(){return se.canUseSessionStorage()?se._getVerifiedStorageObject(i.SessionStorage):null},se.canUseSessionStorage=function(){return void 0===se._canUseSessionStorage&&(se._canUseSessionStorage=!!se._getVerifiedStorageObject(i.SessionStorage)),se._canUseSessionStorage},se.getSessionStorageKeys=function(){var e=[];if(se.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},se.getSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,f,"Browser failed read of session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setSessionStorage=function(t,e,n){var r=se._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed write to session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,I,"Browser failed removal of session storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.disableCookies=function(){m.disableCookies()},se.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==se.document.cookie}catch(e){t.throwInternal(v.WARNING,K,"Cannot access document.cookie - "+se.getExceptionName(e),{exception:se.dump(e)})}}return m._canUseCookies},se.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),se.document.location&&"https:"===se.document.location.protocol&&(a=";secure"),se.canUseCookies(e)&&(se.document.cookie=t+"="+n+i+";path=/"+a)},se.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},se.getCookie=function(e,t){if(se.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=se.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=se.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},se.deleteCookie=function(e,t){se.canUseCookies(e)&&(se.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},se.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},se.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},se.random32=function(){return 4294967296*Math.random()|0},se.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=se.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},se.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},se.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},se.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},se.toISOStringForIE8=function(e){if(se.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"}},se.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},se.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},se.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},se.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},se.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},se.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},se.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},se.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},se.document="undefined"!=typeof document?document:{},se._canUseLocalStorage=void 0,se._canUseSessionStorage=void 0,se._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],se.NotSpecified="not_specified",se);function se(){}var le=(ue.parseUrl=function(e){return ue.htmlAnchorElement||(ue.htmlAnchorElement=ue.document.createElement?ue.document.createElement("a"):{host:ue.parseHost(e)}),ue.htmlAnchorElement.href=e,ue.htmlAnchorElement},ue.getAbsoluteUrl=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.href),t},ue.getPathName=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.pathname),t},ue.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ue.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},ue.document="undefined"!=typeof document?document:{},ue);function ue(){}var ce=(pe.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=le.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=ie.sanitizeString(e,n?n+" "+l:l)}else a=ie.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},pe);function pe(){}de.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()},de.GetDuration=function(e,t){var n=null;return 0===e||0===t||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n};function de(){}var fe,he="ProcessLegacy",ge="http.method",me=(t(ve,fe=function(){}),ve);function ve(){return fe.call(this)||this}var ye,_e=(t(Ie,ye=function(){this.ver=1,this.sampleRate=100,this.tags={}}),Ie);function Ie(e,t,n){var r=ye.call(this)||this;return r.name=ie.sanitizeString(e,n)||oe.NotSpecified,r.data=t,r.time=oe.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 Se(){}var be,we=(t(xe,be=Se),xe);function xe(){var e=be.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ne,Ee=(t(Ce,Ne=we),Ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Ce.dataType="EventData",Ce);function Ce(e,t,n,r){var i=Ne.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=ie.sanitizeString(e,t)||oe.NotSpecified,i.properties=ie.sanitizeProperties(e,n),i.measurements=ie.sanitizeMeasurements(e,r),i}function Ae(){}var De,Te=(t(Re,De=Se),Re);function Re(){var e=De.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function Le(){this.hasFullStack=!0,this.parsedStack=[]}var Me,Ue=(t(Oe,Me=Te),Oe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ke.CreateFromInterface(t,e)});return new Oe(t,p({},e,{exceptions:n}))},Oe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,l=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:l}},Oe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Oe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Oe.dataType="ExceptionData",Oe);function Oe(e,t,n,r,i,a){var o=Me.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new ke(e,t)],o.properties=ie.sanitizeProperties(e,n),o.measurements=ie.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),m.isNullOrUndefined(t.ver)||(o.ver=t.ver),m.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Pe,ke=(t(ze,Pe=Le),ze.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}},ze.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ge.CreateFromInterface(e)})||t.parsedStack;return new ze(e,p({},t,{parsedStack:n}))},ze.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(Ge.regex.test(o)){var s=new Ge(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},ze);function ze(e,t){var n=Pe.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=ie.sanitizeString(e,t.name)||oe.NotSpecified,n.message=ie.sanitizeMessage(e,t.message)||oe.NotSpecified;var r=t.stack;n.parsedStack=ze.parseStack(r),n.stack=ie.sanitizeException(e,r),n.hasFullStack=oe.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 Be,Ge=(t(Fe,Be=Ae),Fe.CreateFromInterface=function(e){return new Fe(e,null)},Fe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Fe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Fe.baseSize=58,Fe);function Fe(e,t){var n=Be.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=oe.trim(r),n.fileName="",n.line=0;var i=r.match(Fe.regex);i&&5<=i.length&&(n.method=oe.trim(i[2])||n.method,n.fileName=oe.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+=Fe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qe,He,Xe,je=(t(We,qe=Se),We);function We(){var e=qe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Xe=He=He||{})[Xe.Measurement=0]="Measurement",Xe[Xe.Aggregation=1]="Aggregation";var Ve,Ke=(t(Ye,Ve=function(){this.kind=He.Measurement}),Ye);function Ye(){var e=null!==Ve&&Ve.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 Je,Ze=(t(Qe,Je=je),Qe.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Qe.dataType="MetricData",Qe);function Qe(e,t,n,r,i,a,o){var s=Je.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var l=new Ke;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=ie.sanitizeString(e,t)||oe.NotSpecified,l.value=n,s.metrics=[l],s.properties=ie.sanitizeProperties(e,o),s}var $e,et=(t(tt,$e=we),tt);function tt(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var nt,rt=(t(it,nt=et),it.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",it.dataType="PageviewData",it);function it(e,t,n,r,i,a,o){var s=nt.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=ie.sanitizeId(e,o),s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,isNaN(r)||(s.duration=oe.msToTimeSpan(r)),s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),s}var at,ot=(t(st,at=Se),st);function st(){var e=at.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var lt,ut=(t(ct,lt=ot),ct.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ct.dataType="RemoteDependencyData",ct);function ct(e,t,n,r,i,a,o,s,l,u,c,p){void 0===l&&(l="Ajax");var d=lt.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=oe.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=ie.sanitizeString(e,l);var f=ce.ParseDependencyPath(e,n,s,r);return d.data=ie.sanitizeUrl(e,r)||f.data,d.target=ie.sanitizeString(e,f.target),u&&(d.target=d.target+"| "+u),d.name=ie.sanitizeString(e,f.name),d.properties=ie.sanitizeProperties(e,c),d.measurements=ie.sanitizeMeasurements(e,p),d}var pt,dt=(t(ft,pt=Se),ft);function ft(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e}var ht,gt=(t(mt,ht=dt),mt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mt.dataType="MessageData",mt);function mt(e,t,n,r){var i=ht.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||oe.NotSpecified,i.message=ie.sanitizeMessage(e,t),i.properties=ie.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var vt,yt=(t(_t,vt=et),_t);function _t(){var e=vt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var It,St=(t(bt,It=yt),bt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",bt.dataType="PageviewPerformanceData",bt);function bt(e,t,n,r,i,a,o){var s=It.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var wt,xt,Nt,Et=(t(Ct,wt=me),Ct);function Ct(e,t){var n=wt.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(Nt=xt=xt||{})[Nt.Verbose=0]="Verbose",Nt[Nt.Information=1]="Information",Nt[Nt.Warning=2]="Warning",Nt[Nt.Error=3]="Error",Nt[Nt.Critical=4]="Critical";var At=(Dt.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},Dt);function Dt(){}var Tt=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},Rt=new Tt,Lt=(Mt.prototype.enqueue=function(e){this._buffer.push(e)},Mt.prototype.count=function(){return this._buffer.length},Mt.prototype.clear=function(){this._buffer.length=0},Mt.prototype.getItems=function(){return this._buffer.slice(0)},Mt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Mt.prototype.markAsSent=function(e){this.clear()},Mt.prototype.clearSent=function(e){},Mt);function Mt(e){this._config=e,this._buffer=[]}var Ut=(Ot.prototype.enqueue=function(e){this._buffer.length>=Ot.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Ot.BUFFER_KEY,this._buffer))},Ot.prototype.count=function(){return this._buffer.length},Ot.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Ot.BUFFER_KEY,[]),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Ot.prototype.getItems=function(){return this._buffer.slice(0)},Ot.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Ot.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Ot.BUFFER_KEY,this._buffer);var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Ot.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,t))},Ot.prototype.clearSent=function(e){var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Ot.SENT_BUFFER_KEY,t)},Ot.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Ot.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=oe.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,L," storage key: "+t+", "+oe.getExceptionName(e),{exception:oe.dump(e)})}return[]},Ot.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);oe.setSessionStorage(this._logger,n,r)}catch(e){oe.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,R," storage key: "+n+", "+oe.getExceptionName(e)+". Buffer cleared",{exception:oe.dump(e)})}},Ot.BUFFER_KEY="AI_buffer",Ot.SENT_BUFFER_KEY="AI_sentBuffer",Ot.MAX_BUFFER_SIZE=2e3,Ot);function Ot(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Ot.BUFFER_KEY),r=this.getBuffer(Ot.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Ot.MAX_BUFFER_SIZE&&(this._buffer.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this.setBuffer(Ot.BUFFER_KEY,this._buffer)}var Pt=(kt.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&((t=t||{})[n]=r)}return t},kt.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},kt.createEnvelope=function(e,t,n,r){var i=new _e(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),kt.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},kt.extractPartAExtensions=function(n,e){if(e.tags||(e.tags={}),n.ext||(n.ext={}),n.tags||(n.tags=[]),n.ext.user){n.ext.user.authId&&(e.tags[Rt.userAuthUserId]=n.ext.user.authId);var t=n.ext.user.id||n.ext.user.localId;t&&(e.tags[Rt.userId]=t)}if(n.ext.app&&n.ext.app.sesId&&(e.tags[Rt.sessionId]=n.ext.app.sesId),n.ext.device&&((n.ext.device.id||n.ext.device.localId)&&(e.tags[Rt.deviceId]=n.ext.device.id||n.ext.device.localId),n.ext.device.deviceClass&&(e.tags[Rt.deviceType]=n.ext.device.deviceClass),n.ext.device.ip&&(e.tags[Rt.deviceIp]=n.ext.device.ip)),n.ext.web){var r=n.ext.web;r.browserLang&&(e.tags[Rt.deviceLanguage]=r.browserLang),r.browserVer&&(e.tags[Rt.deviceBrowserVersion]=r.browserVer),r.browser&&(e.tags[Rt.deviceBrowser]=r.browser),e.data=e.data||{},e.data.baseData=e.data.baseData||{},e.data.baseData.properties=e.data.baseData.properties||{},r.domain&&(e.data.baseData.properties.domain=r.domain),r.isManual&&(e.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(e.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(e.data.baseData.properties.userConsent=r.userConsent.toString())}n.ext.device&&n.ext.device.model&&(e.tags[Rt.deviceModel]=n.ext.device.model),n.ext.os&&n.ext.os.name&&(e.tags[Rt.deviceOS]=n.ext.os.name),n.ext.device&&n.ext.device.deviceType&&(e.tags[Rt.deviceType]=n.ext.device.deviceType),n.ext.trace&&(n.ext.trace.parentID&&(e.tags[Rt.operationParentId]=n.ext.trace.parentID),n.ext.trace.name&&(e.tags[Rt.operationName]=n.ext.trace.name),n.ext.trace.traceID&&(e.tags[Rt.operationId]=n.ext.trace.traceID));for(var i={},a=function(e){var t=n.tags[e];Object.keys(t).forEach(function(e){i[e]=t[e]}),n.tags.splice(e,1)},o=n.tags.length-1;0<=o;o--)a(o);for(var s in n.tags)i[s]=n.tags[s];e.tags=p({},e.tags,i),e.tags[Rt.internalSdkVersion]||(e.tags[Rt.internalSdkVersion]="javascript:"+kt.Version)},kt.Version="2.2.1",kt);function kt(){}var zt,Bt=(t(Gt,zt=Pt),Gt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Pt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.correlationContext,f=i.properties&&i.properties[ge]?i.properties[ge]:"GET",h=new ut(e,a,o,s,l,u,c,f,p,d,r,n),g=new Et(ut.dataType,h);return Pt.createEnvelope(e,ut.envelopeType,t,g)},Gt.DependencyEnvelopeCreator=new Gt,Gt);function Gt(){return null!==zt&&zt.apply(this,arguments)||this}var Ft,qt=(t(Ht,Ft=Pt),Ht.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==Ee.dataType&&(n.baseTypeSource=t.baseType),t.baseType===Ee.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Pt.extractPropsAndMeasurements(t.baseData,n,r),Pt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new Ee(e,i,n,r),o=new Et(Ee.dataType,a);return Pt.createEnvelope(e,Ee.envelopeType,t,o)},Ht.EventEnvelopeCreator=new Ht,Ht);function Ht(){return null!==Ft&&Ft.apply(this,arguments)||this}var Xt,jt=(t(Wt,Xt=Pt),Wt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ue.CreateFromInterface(e,n),i=new Et(Ue.dataType,r);return Pt.createEnvelope(e,Ue.envelopeType,t,i)},Wt.ExceptionEnvelopeCreator=new Wt,Wt);function Wt(){return null!==Xt&&Xt.apply(this,arguments)||this}var Vt,Kt=(t(Yt,Vt=Pt),Yt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Pt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new Ze(e,i,a,o,s,l,r),c=new Et(Ze.dataType,u);return Pt.createEnvelope(e,Ze.envelopeType,t,c)},Yt.MetricEnvelopeCreator=new Yt,Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}var Jt,Zt=(t(Qt,Jt=Pt),Qt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r,i=t.baseData;t.ext&&t.ext.trace&&t.ext.trace.traceID&&(r=t.ext.trace.traceID);var a=i.id||r,o=i.name,s=i.uri,l=i.properties||{},u=i.measurements||{};if(m.isNullOrUndefined(i.refUri)||(l.refUri=i.refUri),m.isNullOrUndefined(i.pageType)||(l.pageType=i.pageType),m.isNullOrUndefined(i.isLoggedIn)||(l.isLoggedIn=i.isLoggedIn.toString()),!m.isNullOrUndefined(i.properties)){var c=i.properties;for(var p in c)c.hasOwnProperty(p)&&(l[p]=c[p])}Pt.extractPropsAndMeasurements(t.data,l,u);var d=new rt(e,o,s,n,l,u,a),f=new Et(rt.dataType,d);return Pt.createEnvelope(e,rt.envelopeType,t,f)},Qt.PageViewEnvelopeCreator=new Qt,Qt);function Qt(){return null!==Jt&&Jt.apply(this,arguments)||this}var $t,en=(t(tn,$t=Pt),tn.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri||n.url,a=n.properties||{},o=n.measurements||{};Pt.extractPropsAndMeasurements(t.data,a,o);var s=new St(e,r,i,void 0,a,o,n),l=new Et(St.dataType,s);return Pt.createEnvelope(e,St.envelopeType,t,l)},tn.PageViewPerformanceEnvelopeCreator=new tn,tn);function tn(){return null!==$t&&$t.apply(this,arguments)||this}var nn,rn=(t(an,nn=Pt),an.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Pt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new gt(e,n,r,a),s=new Et(gt.dataType,o);return Pt.createEnvelope(e,gt.envelopeType,t,s)},an.TraceEnvelopeCreator=new an,an);function an(){return null!==nn&&nn.apply(this,arguments)||this}var on=(sn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},sn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,P,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,z,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(oe.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,k,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,P,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,l="function"==typeof o?o()&h.Hidden:o&h.Hidden,u=o&h.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,E,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},sn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(oe.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,G,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},sn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},sn);function sn(e){this._logger=e}function ln(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var un=(ln.prototype._setOnline=function(){this._onlineStatus=!0},ln.prototype._setOffline=function(){this._onlineStatus=!1},ln.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},ln.prototype.isOffline=function(){return!this.isOnline()},ln.Offline=new ln,ln).Offline,cn=(pn.prototype.getHashCodeScore=function(e){return this.getHashCode(e)/pn.INT_MAX_VALUE*100},pn.prototype.getHashCode=function(e){if(""==e)return 0;for(;e.length<pn.MIN_INPUT_LENGTH;)e=e.concat(e);for(var t=5381,n=0;n<e.length;++n)t=(t<<5)+t+e.charCodeAt(n),t&=t;return Math.abs(t)},pn.INT_MAX_VALUE=2147483647,pn.MIN_INPUT_LENGTH=8,pn);function pn(){}var dn=(fn.prototype.getSamplingScore=function(e){return e.tags&&e.tags[this.keys.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.userId]):e.ext&&e.ext.user&&e.ext.user.id?this.hashCodeGeneragor.getHashCodeScore(e.ext.user.id):e.tags&&e.tags[this.keys.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.operationId]):e.ext&&e.ext.telemetryTrace&&e.ext.telemetryTrace.traceID?this.hashCodeGeneragor.getHashCodeScore(e.ext.telemetryTrace.traceID):100*Math.random()},fn);function fn(){this.hashCodeGeneragor=new cn,this.keys=new Tt}var hn=(gn.prototype.isSampledIn=function(e){var t=this.sampleRate;return null==t||100<=t||e.baseType===Ze.dataType||this.samplingScoreGenerator.getSamplingScore(e)<t},gn);function gn(e,t){this.INT_MAX_VALUE=2147483647,m.isNullOrUndefined(t)?this._logger=new $:this._logger=t,(100<e||e<0)&&(this._logger.throwInternal(v.WARNING,H,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new dn}var mn=(vn.prototype.pause=function(){throw new Error("Method not implemented.")},vn.prototype.resume=function(){throw new Error("Method not implemented.")},vn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,x,"flush failed, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.onunloadFlush=function(){if(!1!==this._config.onunloadDisableBeacon()&&!1!==this._config.isBeaconApiDisabled()||!oe.IsBeaconApiSupported())this.flush();else try{this.triggerSend(!0,this._beaconSender)}catch(e){this._logger.throwInternal(v.CRITICAL,w,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.teardown=function(){throw new Error("Method not implemented.")},vn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new on(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=vn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return At.getConfig(t,e,r.identifier,i[e]())}}this._config=vn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&oe.canUseSessionStorage()?new Ut(this._logger,this._config):new Lt(this._config),this._sample=new hn(this._config.samplingPercentage(),this._logger),!this._config.isBeaconApiDisabled()&&oe.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},vn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,S,"Cannot send empty telemetry");if(e.baseData&&!e.baseType)return void this._logger.throwInternal(v.CRITICAL,J,"Cannot send telemetry without baseData and baseType");if(e.baseType||(e.baseType="EventData"),!this._sender)return void this._logger.throwInternal(v.CRITICAL,A,"Sender was not initialized");if(!this._isSampledIn(e))return void this._logger.throwInternal(v.WARNING,D,"Telemetry item was sampled out and not sent",{SampleRate:this._sample.sampleRate});e.tags=e.tags||{},e.tags.sampleRate=this._sample.sampleRate;var n=vn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,O,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[he]&&(e.tags[he].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+oe.getExceptionName(e),{exception:oe.dump(e)},!0)}}),delete e.tags[he]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,b,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},vn.prototype.setNextPlugin=function(e){this._nextPlugin=e},vn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,T,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):un.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,T,". Offline - Response Code: "+e.status+". Offline status: "+un.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r=r||this._parseResponse(e.responseText||e.response))&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e)):(this._consecutiveErrors=0,this._onSuccess(t,n))}},vn.prototype.triggerSend=function(e,t){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var n=this._buffer.getItems();t?t.call(this,n,e):this._sender(n,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!oe.getIEVersion()||9<oe.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,T,"Telemetry transmission failed, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,C,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},vn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,T,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},vn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},vn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},vn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case Ee.dataType:return qt.EventEnvelopeCreator.Create(n,r);case gt.dataType:return rn.TraceEnvelopeCreator.Create(n,r);case rt.dataType:return Zt.PageViewEnvelopeCreator.Create(n,r);case St.dataType:return en.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ue.dataType:return jt.ExceptionEnvelopeCreator.Create(n,r);case Ze.dataType:return Kt.MetricEnvelopeCreator.Create(n,r);case ut.dataType:return Bt.DependencyEnvelopeCreator.Create(n,r);default:return qt.EventEnvelopeCreator.Create(n,r)}},vn._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100}}},vn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,onunloadDisableBeacon:void 0,instrumentationKey:void 0,namePrefix:void 0,samplingPercentage:void 0}},vn.prototype._isSampledIn=function(e){return this._sample.isSampledIn(e)},vn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?(this._buffer.markAsSent(e),this._onSuccess(e,e.length)):(this._xhrSender(e,!0),this._logger.throwInternal(v.WARNING,T,". Failed to send telemetry with Beacon API, retried with xhrSender."))},vn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),oe.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(ne.sdkContextHeader,ne.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},vn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,M,"Cannot parse the response. "+oe.getExceptionName(e),{response:t})}return null},vn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},vn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},vn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},vn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},vn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},vn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,T,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},vn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},vn);function vn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=mn,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Microsoft=e.Microsoft||{},e.Microsoft.ApplicationInsights={}))}(this,function(e){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function t(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var i,n,h,a,o,s,p=function(){return(p=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};(n=i=i||{})[n.LocalStorage=0]="LocalStorage",n[n.SessionStorage=1]="SessionStorage",(a=h=h||{})[a.Default=0]="Default",a[a.Required=1]="Required",a[a.Array=2]="Array",a[a.Hidden=4]="Hidden",(s=o=o||{})[s.AI=0]="AI",s[s.AI_AND_W3C=1]="AI_AND_W3C",s[s.W3C=2]="W3C";var m=(l.isNullOrUndefined=function(e){return null==e},l.disableCookies=function(){l._canUseCookies=!1},l.newGuid=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(c,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},l);function l(){}var v,u,c=/[xy]/g;(u=v=v||{})[u.CRITICAL=1]="CRITICAL",u[u.WARNING=2]="WARNING";var d=1,f=2,g=3,y=4,_=5,I=6,S=7,b=12,w=20,x=22,N=23,E=24,C=26,A=28,D=33,T=40,R=41,L=42,M=43,U=46,O=47,P=48,k=49,z=50,B=52,G=54,F=56,q=57,H=58,X=61,j=64,W=66,V=67,K=68,Y=69,J=70,Z=(Q.sanitizeDiagnosticText=function(e){return'"'+e.replace(/\"/g,"")+'"'},Q.dataType="MessageData",Q.AiNonUserActionablePrefix="AI (Internal): ",Q.AiUserActionablePrefix="AI: ",Q);function Q(e,t,n,r){void 0===n&&(n=!1),this.messageId=e,this.message=(n?Q.AiUserActionablePrefix:Q.AiNonUserActionablePrefix)+e;var i=(t?" message:"+Q.sanitizeDiagnosticText(t):"")+(r?" props:"+Q.sanitizeDiagnosticText(JSON.stringify(r)):"");this.message+=i}var $=(ee.prototype.throwInternal=function(e,t,n,r,i){void 0===i&&(i=!1);var a=new Z(t,n,i,r);if(this.enableDebugExceptions())throw a;if(void 0!==a&&a&&void 0!==a.message){if(i){var o=+a.messageId;(!this._messageLogged[o]||this.consoleLoggingLevel()>=v.WARNING)&&(this.warnToConsole(a.message),this._messageLogged[o]=!0)}else this.consoleLoggingLevel()>=v.WARNING&&this.warnToConsole(a.message);this.logInternalMessage(e,a)}},ee.prototype.warnToConsole=function(e){"undefined"!=typeof console&&console&&("function"==typeof console.warn?console.warn(e):"function"==typeof console.log&&console.log(e))},ee.prototype.resetInternalMessageCount=function(){this._messageCount=0,this._messageLogged={}},ee.prototype.logInternalMessage=function(e,t){if(!this._areInternalMessagesThrottled()){var n=!0,r=this.AIInternalMessagePrefix+t.messageId;if(this._messageLogged[r]?n=!1:this._messageLogged[r]=!0,n&&(e<=this.telemetryLoggingLevel()&&(this.queue.push(t),this._messageCount++),this._messageCount==this.maxInternalMessageLimit())){var i="Internal events throttle limit per PageView reached for this app.",a=new Z(N,i,!1);this.queue.push(a),this.warnToConsole(i)}}},ee.prototype._areInternalMessagesThrottled=function(){return this._messageCount>=this.maxInternalMessageLimit()},ee);function ee(e){this.AIInternalMessagePrefix="AITR_",this.enableDebugExceptions=function(){return!1},this.consoleLoggingLevel=function(){return 0},this.telemetryLoggingLevel=function(){return 1},this.maxInternalMessageLimit=function(){return 25},this.queue=[],this._messageCount=0,this._messageLogged={},m.isNullOrUndefined(e)||(m.isNullOrUndefined(e.loggingLevelConsole)||(this.consoleLoggingLevel=function(){return e.loggingLevelConsole}),m.isNullOrUndefined(e.loggingLevelTelemetry)||(this.telemetryLoggingLevel=function(){return e.loggingLevelTelemetry}),m.isNullOrUndefined(e.maxMessageLimit)||(this.maxInternalMessageLimit=function(){return e.maxMessageLimit}),m.isNullOrUndefined(e.enableDebugExceptions)||(this.enableDebugExceptions=function(){return e.enableDebugExceptions}))}te.prototype.processTelemetry=function(t){this.channelQueue.forEach(function(e){0<e.length&&e[0].processTelemetry(t)})},Object.defineProperty(te.prototype,"ChannelControls",{get:function(){return this.channelQueue},enumerable:!0,configurable:!0}),te.prototype.initialize=function(n,r,i){var a=this;if(n.isCookieUseDisabled&&m.disableCookies(),this.channelQueue=new Array,n.channels){var o=void 0;n.channels.forEach(function(e){if(e&&0<e.length){e=e.sort(function(e,t){return e.priority-t.priority});for(var t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);if(e.forEach(function(e){e.priority<500&&(o=e.identifier),e.initialize(n,r,i)}),o)throw Error("Channel has invalid priority"+o);a.channelQueue.push(e)}})}for(var e=new Array,t=0;t<i.length;t++){var s=i[t];500<s.priority&&e.push(s)}if(0<e.length){for(e=e.sort(function(e,t){return e.priority-t.priority}),t=1;t<e.length;t++)e[t-1].setNextPlugin(e[t]);e.forEach(function(e){return e.initialize(n,r,i)}),this.channelQueue.push(e)}};function te(){this.identifier="ChannelControllerPlugin",this.priority=500}var ne=(re.requestContextHeader="Request-Context",re.requestContextTargetKey="appId",re.requestContextAppIdFormat="appId=cid-v1:",re.requestIdHeader="Request-Id",re.traceParentHeader="traceparent",re.sdkContextHeader="Sdk-Context",re.sdkContextHeaderAppIdRequest="appId",re.requestContextHeaderLowerCase="request-context",re);function re(){}var ie=(ae.sanitizeKeyAndAddUniqueness=function(e,t,n){var r=t.length,i=ae.sanitizeKey(e,t);if(i.length!==r){for(var a=0,o=i;void 0!==n[o];)a++,o=i.substring(0,ae.MAX_NAME_LENGTH-3)+ae.padNumber(a);i=o}return i},ae.sanitizeKey=function(e,t){var n;return t&&(t=ae.trim(t.toString())).length>ae.MAX_NAME_LENGTH&&(n=t.substring(0,ae.MAX_NAME_LENGTH),e.throwInternal(v.WARNING,q,"name is too long. It has been truncated to "+ae.MAX_NAME_LENGTH+" characters.",{name:t},!0)),n||t},ae.sanitizeString=function(e,t,n){var r;return void 0===n&&(n=ae.MAX_STRING_LENGTH),t&&(n=n||ae.MAX_STRING_LENGTH,(t=ae.trim(t)).toString().length>n&&(r=t.toString().substring(0,n),e.throwInternal(v.WARNING,X,"string value is too long. It has been truncated to "+n+" characters.",{value:t},!0))),r||t},ae.sanitizeUrl=function(e,t){return ae.sanitizeInput(e,t,ae.MAX_URL_LENGTH,W)},ae.sanitizeMessage=function(e,t){var n;return t&&t.length>ae.MAX_MESSAGE_LENGTH&&(n=t.substring(0,ae.MAX_MESSAGE_LENGTH),e.throwInternal(v.WARNING,F,"message is too long, it has been truncated to "+ae.MAX_MESSAGE_LENGTH+" characters.",{message:t},!0)),n||t},ae.sanitizeException=function(e,t){var n;return t&&t.length>ae.MAX_EXCEPTION_LENGTH&&(n=t.substring(0,ae.MAX_EXCEPTION_LENGTH),e.throwInternal(v.WARNING,B,"exception is too long, it has been truncated to "+ae.MAX_EXCEPTION_LENGTH+" characters.",{exception:t},!0)),n||t},ae.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(v.WARNING,k,"custom property is not valid",{exception:e},!0)}i=ae.sanitizeString(t,i,ae.MAX_PROPERTY_LENGTH),n[r=ae.sanitizeKeyAndAddUniqueness(t,r,n)]=i}e=n}return e},ae.sanitizeMeasurements=function(e,t){if(t){var n={};for(var r in t){var i=t[r];n[r=ae.sanitizeKeyAndAddUniqueness(e,r,n)]=i}t=n}return t},ae.sanitizeId=function(e,t){return t?ae.sanitizeInput(e,t,ae.MAX_ID_LENGTH,Y).toString():t},ae.sanitizeInput=function(e,t,n,r){var i;return t&&(t=ae.trim(t)).length>n&&(i=t.substring(0,n),e.throwInternal(v.WARNING,r,"input is too long, it has been truncated to "+n+" characters.",{data:t},!0)),i||t},ae.padNumber=function(e){var t="00"+e;return t.substr(t.length-3)},ae.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},ae.MAX_NAME_LENGTH=150,ae.MAX_ID_LENGTH=128,ae.MAX_PROPERTY_LENGTH=8192,ae.MAX_STRING_LENGTH=1024,ae.MAX_URL_LENGTH=2048,ae.MAX_MESSAGE_LENGTH=32768,ae.MAX_EXCEPTION_LENGTH=32768,ae);function ae(){}var oe=(se.createDomEvent=function(e){var t=null;return"function"==typeof Event?t=new Event(e):(t=document.createEvent("Event")).initEvent(e,!0,!0),t},se.disableStorage=function(){se._canUseLocalStorage=!1,se._canUseSessionStorage=!1},se._getLocalStorageObject=function(){return se.canUseLocalStorage()?se._getVerifiedStorageObject(i.LocalStorage):null},se._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},se.isInternalApplicationInsightsEndpoint=function(e){return-1!==se._internalEndpoints.indexOf(e.toLowerCase())},se.canUseLocalStorage=function(){return void 0===se._canUseLocalStorage&&(se._canUseLocalStorage=!!se._getVerifiedStorageObject(i.LocalStorage)),se._canUseLocalStorage},se.getStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,d,"Browser failed read of local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setStorage=function(t,e,n){var r=se._getLocalStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,g,"Browser failed write to local storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeStorage=function(t,e){var n=se._getLocalStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseLocalStorage=!1,t.throwInternal(v.WARNING,_,"Browser failed removal of local storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se._getSessionStorageObject=function(){return se.canUseSessionStorage()?se._getVerifiedStorageObject(i.SessionStorage):null},se.canUseSessionStorage=function(){return void 0===se._canUseSessionStorage&&(se._canUseSessionStorage=!!se._getVerifiedStorageObject(i.SessionStorage)),se._canUseSessionStorage},se.getSessionStorageKeys=function(){var e=[];if(se.canUseSessionStorage())for(var t in window.sessionStorage)e.push(t);return e},se.getSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.getItem(e)}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,f,"Browser failed read of session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return null},se.setSessionStorage=function(t,e,n){var r=se._getSessionStorageObject();if(null!==r)try{return r.setItem(e,n),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,y,"Browser failed write to session storage. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.removeSessionStorage=function(t,e){var n=se._getSessionStorageObject();if(null!==n)try{return n.removeItem(e),!0}catch(e){se._canUseSessionStorage=!1,t.throwInternal(v.WARNING,I,"Browser failed removal of session storage item. "+se.getExceptionName(e),{exception:se.dump(e)})}return!1},se.disableCookies=function(){m.disableCookies()},se.canUseCookies=function(t){if(void 0===m._canUseCookies){m._canUseCookies=!1;try{m._canUseCookies=void 0!==se.document.cookie}catch(e){t.throwInternal(v.WARNING,K,"Cannot access document.cookie - "+se.getExceptionName(e),{exception:se.dump(e)})}}return m._canUseCookies},se.setCookie=function(e,t,n,r){var i="",a="";r&&(i=";domain="+r),se.document.location&&"https:"===se.document.location.protocol&&(a=";secure"),se.canUseCookies(e)&&(se.document.cookie=t+"="+n+i+";path=/"+a)},se.stringToBoolOrDefault=function(e,t){return void 0===t&&(t=!1),null==e?t:"true"===e.toString().toLowerCase()},se.getCookie=function(e,t){if(se.canUseCookies(e)){var n="";if(t&&t.length)for(var r=t+"=",i=se.document.cookie.split(";"),a=0;a<i.length;a++){var o=i[a];if((o=se.trim(o))&&0===o.indexOf(r)){n=o.substring(r.length,i[a].length);break}}return n}},se.deleteCookie=function(e,t){se.canUseCookies(e)&&(se.document.cookie=t+"=;path=/;expires=Thu, 01 Jan 1970 00:00:01 GMT;")},se.trim=function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"")},se.newId=function(){for(var e="",t=1073741824*Math.random();0<t;)e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t%64),t=Math.floor(t/64);return e},se.random32=function(){return 4294967296*Math.random()|0},se.generateW3CId=function(){for(var e,t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"],n="",r=0;r<4;r++)n+=t[15&(e=se.random32())]+t[e>>4&15]+t[e>>8&15]+t[e>>12&15]+t[e>>16&15]+t[e>>20&15]+t[e>>24&15]+t[e>>28&15];var i=t[8+4*Math.random()|0];return n.substr(0,8)+n.substr(9,4)+"4"+n.substr(13,3)+i+n.substr(16,3)+n.substr(19,12)},se.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)},se.isError=function(e){return"[object Error]"===Object.prototype.toString.call(e)},se.isDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)},se.toISOStringForIE8=function(e){if(se.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"}},se.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},se.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},se.isCrossOriginError=function(e,t,n,r,i){return("Script error."===e||"Script error"===e)&&!i},se.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},se.getExceptionName=function(e){return"[object Error]"===Object.prototype.toString.call(e)?e.name:""},se.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},se.IsBeaconApiSupported=function(){return"sendBeacon"in navigator&&navigator.sendBeacon},se.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},se.document="undefined"!=typeof document?document:{},se._canUseLocalStorage=void 0,se._canUseSessionStorage=void 0,se._internalEndpoints=["https://dc.services.visualstudio.com/v2/track","https://breeze.aimon.applicationinsights.io/v2/track","https://dc-int.services.visualstudio.com/v2/track"],se.NotSpecified="not_specified",se);function se(){}var le=(ue.parseUrl=function(e){return ue.htmlAnchorElement||(ue.htmlAnchorElement=ue.document.createElement?ue.document.createElement("a"):{host:ue.parseHost(e)}),ue.htmlAnchorElement.href=e,ue.htmlAnchorElement},ue.getAbsoluteUrl=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.href),t},ue.getPathName=function(e){var t,n=ue.parseUrl(e);return n&&(t=n.pathname),t},ue.getCompleteUrl=function(e,t){return e?e.toUpperCase()+" "+t:t},ue.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},ue.document="undefined"!=typeof document?document:{},ue);function ue(){}var ce=(pe.ParseDependencyPath=function(e,t,n,r){var i,a=r,o=r;if(t&&0<t.length){var s=le.parseUrl(t);if(i=s.host,!a)if(null!=s.pathname){var l=0===s.pathname.length?"/":s.pathname;"/"!==l.charAt(0)&&(l="/"+l),o=s.pathname,a=ie.sanitizeString(e,n?n+" "+l:l)}else a=ie.sanitizeString(e,t)}else a=i=r;return{target:i,name:a,data:o}},pe);function pe(){}de.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()},de.GetDuration=function(e,t){var n=null;return 0===e||0===t||m.isNullOrUndefined(e)||m.isNullOrUndefined(t)||(n=t-e),n};function de(){}var fe,he="ProcessLegacy",ge="http.method",me=(t(ve,fe=function(){}),ve);function ve(){return fe.call(this)||this}var ye,_e=(t(Ie,ye=function(){this.ver=1,this.sampleRate=100,this.tags={}}),Ie);function Ie(e,t,n){var r=ye.call(this)||this;return r.name=ie.sanitizeString(e,n)||oe.NotSpecified,r.data=t,r.time=oe.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 Se(){}var be,we=(t(xe,be=Se),xe);function xe(){var e=be.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var Ne,Ee=(t(Ce,Ne=we),Ce.envelopeType="Microsoft.ApplicationInsights.{0}.Event",Ce.dataType="EventData",Ce);function Ce(e,t,n,r){var i=Ne.call(this)||this;return i.aiDataContract={ver:h.Required,name:h.Required,properties:h.Default,measurements:h.Default},i.name=ie.sanitizeString(e,t)||oe.NotSpecified,i.properties=ie.sanitizeProperties(e,n),i.measurements=ie.sanitizeMeasurements(e,r),i}function Ae(){}var De,Te=(t(Re,De=Se),Re);function Re(){var e=De.call(this)||this;return e.ver=2,e.exceptions=[],e.properties={},e.measurements={},e}function Le(){this.hasFullStack=!0,this.parsedStack=[]}var Me,Ue=(t(Oe,Me=Te),Oe.CreateFromInterface=function(t,e){var n=e.exceptions&&e.exceptions.map(function(e){return ke.CreateFromInterface(t,e)});return new Oe(t,p({},e,{exceptions:n}))},Oe.prototype.toInterface=function(){var e=this,t=e.exceptions,n=e.properties,r=e.measurements,i=e.severityLevel,a=e.ver,o=e.problemGroup,s=e.id,l=e.isManual;return{ver:a,exceptions:t instanceof Array&&t.map(function(e){return e.toInterface()})||void 0,severityLevel:i,properties:n,measurements:r,problemGroup:o,id:s,isManual:l}},Oe.CreateSimpleException=function(e,t,n,r,i,a){return{exceptions:[{hasFullStack:!0,message:e,stack:i,typeName:t}]}},Oe.envelopeType="Microsoft.ApplicationInsights.{0}.Exception",Oe.dataType="ExceptionData",Oe);function Oe(e,t,n,r,i,a){var o=Me.call(this)||this;return o.aiDataContract={ver:h.Required,exceptions:h.Required,severityLevel:h.Default,properties:h.Default,measurements:h.Default},t instanceof Error?(o.exceptions=[new ke(e,t)],o.properties=ie.sanitizeProperties(e,n),o.measurements=ie.sanitizeMeasurements(e,r),i&&(o.severityLevel=i),a&&(o.id=a)):(o.exceptions=t.exceptions,o.properties=t.properties,o.measurements=t.measurements,t.severityLevel&&(o.severityLevel=t.severityLevel),t.id&&(o.id=t.id),t.problemGroup&&(o.problemGroup=t.problemGroup),m.isNullOrUndefined(t.ver)||(o.ver=t.ver),m.isNullOrUndefined(t.isManual)||(o.isManual=t.isManual)),o}var Pe,ke=(t(ze,Pe=Le),ze.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}},ze.CreateFromInterface=function(e,t){var n=t.parsedStack instanceof Array&&t.parsedStack.map(function(e){return Ge.CreateFromInterface(e)})||t.parsedStack;return new ze(e,p({},t,{parsedStack:n}))},ze.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(Ge.regex.test(o)){var s=new Ge(n[a],r++);i+=s.sizeInBytes,t.push(s)}}if(32768<i)for(var l=0,u=t.length-1,c=0,p=l,d=u;l<u;){if(32768<(c+=t[l].sizeInBytes+t[u].sizeInBytes)){var f=d-p+1;t.splice(p,f);break}p=l,d=u,l++,u--}}return t},ze);function ze(e,t){var n=Pe.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=ie.sanitizeString(e,t.name)||oe.NotSpecified,n.message=ie.sanitizeMessage(e,t.message)||oe.NotSpecified;var r=t.stack;n.parsedStack=ze.parseStack(r),n.stack=ie.sanitizeException(e,r),n.hasFullStack=oe.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 Be,Ge=(t(Fe,Be=Ae),Fe.CreateFromInterface=function(e){return new Fe(e,null)},Fe.prototype.toInterface=function(){return{level:this.level,method:this.method,assembly:this.assembly,fileName:this.fileName,line:this.line}},Fe.regex=/^([\s]+at)?(.*?)(\@|\s\(|\s)([^\(\@\n]+):([0-9]+):([0-9]+)(\)?)$/,Fe.baseSize=58,Fe);function Fe(e,t){var n=Be.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=oe.trim(r),n.fileName="",n.line=0;var i=r.match(Fe.regex);i&&5<=i.length&&(n.method=oe.trim(i[2])||n.method,n.fileName=oe.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+=Fe.baseSize,n.sizeInBytes+=n.level.toString().length,n.sizeInBytes+=n.line.toString().length,n}var qe,He,Xe,je=(t(We,qe=Se),We);function We(){var e=qe.call(this)||this;return e.ver=2,e.metrics=[],e.properties={},e}(Xe=He=He||{})[Xe.Measurement=0]="Measurement",Xe[Xe.Aggregation=1]="Aggregation";var Ve,Ke=(t(Ye,Ve=function(){this.kind=He.Measurement}),Ye);function Ye(){var e=null!==Ve&&Ve.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 Je,Ze=(t(Qe,Je=je),Qe.envelopeType="Microsoft.ApplicationInsights.{0}.Metric",Qe.dataType="MetricData",Qe);function Qe(e,t,n,r,i,a,o){var s=Je.call(this)||this;s.aiDataContract={ver:h.Required,metrics:h.Required,properties:h.Default};var l=new Ke;return l.count=0<r?r:void 0,l.max=isNaN(a)||null===a?void 0:a,l.min=isNaN(i)||null===i?void 0:i,l.name=ie.sanitizeString(e,t)||oe.NotSpecified,l.value=n,s.metrics=[l],s.properties=ie.sanitizeProperties(e,o),s}var $e,et=(t(tt,$e=we),tt);function tt(){var e=$e.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var nt,rt=(t(it,nt=et),it.envelopeType="Microsoft.ApplicationInsights.{0}.Pageview",it.dataType="PageviewData",it);function it(e,t,n,r,i,a,o){var s=nt.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=ie.sanitizeId(e,o),s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,isNaN(r)||(s.duration=oe.msToTimeSpan(r)),s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),s}var at,ot=(t(st,at=Se),st);function st(){var e=at.call(this)||this;return e.ver=2,e.success=!0,e.properties={},e.measurements={},e}var lt,ut=(t(ct,lt=ot),ct.envelopeType="Microsoft.ApplicationInsights.{0}.RemoteDependency",ct.dataType="RemoteDependencyData",ct);function ct(e,t,n,r,i,a,o,s,l,u,c,p){void 0===l&&(l="Ajax");var d=lt.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=oe.msToTimeSpan(i),d.success=a,d.resultCode=o+"",d.type=ie.sanitizeString(e,l);var f=ce.ParseDependencyPath(e,n,s,r);return d.data=ie.sanitizeUrl(e,r)||f.data,d.target=ie.sanitizeString(e,f.target),u&&(d.target=d.target+" | "+u),d.name=ie.sanitizeString(e,f.name),d.properties=ie.sanitizeProperties(e,c),d.measurements=ie.sanitizeMeasurements(e,p),d}var pt,dt=(t(ft,pt=Se),ft);function ft(){var e=pt.call(this)||this;return e.ver=2,e.properties={},e}var ht,gt=(t(mt,ht=dt),mt.envelopeType="Microsoft.ApplicationInsights.{0}.Message",mt.dataType="MessageData",mt);function mt(e,t,n,r){var i=ht.call(this)||this;return i.aiDataContract={ver:h.Required,message:h.Required,severityLevel:h.Default,properties:h.Default},t=t||oe.NotSpecified,i.message=ie.sanitizeMessage(e,t),i.properties=ie.sanitizeProperties(e,r),n&&(i.severityLevel=n),i}var vt,yt=(t(_t,vt=et),_t);function _t(){var e=vt.call(this)||this;return e.ver=2,e.properties={},e.measurements={},e}var It,St=(t(bt,It=yt),bt.envelopeType="Microsoft.ApplicationInsights.{0}.PageviewPerformance",bt.dataType="PageviewPerformanceData",bt);function bt(e,t,n,r,i,a,o){var s=It.call(this)||this;return s.aiDataContract={ver:h.Required,name:h.Default,url:h.Default,duration:h.Default,perfTotal:h.Default,networkConnect:h.Default,sentRequest:h.Default,receivedResponse:h.Default,domProcessing:h.Default,properties:h.Default,measurements:h.Default},s.url=ie.sanitizeUrl(e,n),s.name=ie.sanitizeString(e,t)||oe.NotSpecified,s.properties=ie.sanitizeProperties(e,i),s.measurements=ie.sanitizeMeasurements(e,a),o&&(s.domProcessing=o.domProcessing,s.duration=o.duration,s.networkConnect=o.networkConnect,s.perfTotal=o.perfTotal,s.receivedResponse=o.receivedResponse,s.sentRequest=o.sentRequest),s}var wt,xt,Nt,Et=(t(Ct,wt=me),Ct);function Ct(e,t){var n=wt.call(this)||this;return n.aiDataContract={baseType:h.Required,baseData:h.Required},n.baseType=e,n.baseData=t,n}(Nt=xt=xt||{})[Nt.Verbose=0]="Verbose",Nt[Nt.Information=1]="Information",Nt[Nt.Warning=2]="Warning",Nt[Nt.Error=3]="Error",Nt[Nt.Critical=4]="Critical";var At=(Dt.getConfig=function(e,t,n,r){var i;return void 0===r&&(r=!1),i=n&&e.extensionConfig&&e.extensionConfig[n]&&!m.isNullOrUndefined(e.extensionConfig[n][t])?e.extensionConfig[n][t]:e[t],m.isNullOrUndefined(i)?r:i},Dt);function Dt(){}var Tt=function(){this.applicationVersion="ai.application.ver",this.applicationBuild="ai.application.build",this.applicationTypeId="ai.application.typeId",this.applicationId="ai.application.applicationId",this.applicationLayer="ai.application.layer",this.deviceId="ai.device.id",this.deviceIp="ai.device.ip",this.deviceLanguage="ai.device.language",this.deviceLocale="ai.device.locale",this.deviceModel="ai.device.model",this.deviceFriendlyName="ai.device.friendlyName",this.deviceNetwork="ai.device.network",this.deviceNetworkName="ai.device.networkName",this.deviceOEMName="ai.device.oemName",this.deviceOS="ai.device.os",this.deviceOSVersion="ai.device.osVersion",this.deviceRoleInstance="ai.device.roleInstance",this.deviceRoleName="ai.device.roleName",this.deviceScreenResolution="ai.device.screenResolution",this.deviceType="ai.device.type",this.deviceMachineName="ai.device.machineName",this.deviceVMName="ai.device.vmName",this.deviceBrowser="ai.device.browser",this.deviceBrowserVersion="ai.device.browserVersion",this.locationIp="ai.location.ip",this.locationCountry="ai.location.country",this.locationProvince="ai.location.province",this.locationCity="ai.location.city",this.operationId="ai.operation.id",this.operationName="ai.operation.name",this.operationParentId="ai.operation.parentId",this.operationRootId="ai.operation.rootId",this.operationSyntheticSource="ai.operation.syntheticSource",this.operationCorrelationVector="ai.operation.correlationVector",this.sessionId="ai.session.id",this.sessionIsFirst="ai.session.isFirst",this.sessionIsNew="ai.session.isNew",this.userAccountAcquisitionDate="ai.user.accountAcquisitionDate",this.userAccountId="ai.user.accountId",this.userAgent="ai.user.userAgent",this.userId="ai.user.id",this.userStoreRegion="ai.user.storeRegion",this.userAuthUserId="ai.user.authUserId",this.userAnonymousUserAcquisitionDate="ai.user.anonUserAcquisitionDate",this.userAuthenticatedUserAcquisitionDate="ai.user.authUserAcquisitionDate",this.cloudName="ai.cloud.name",this.cloudRole="ai.cloud.role",this.cloudRoleVer="ai.cloud.roleVer",this.cloudRoleInstance="ai.cloud.roleInstance",this.cloudEnvironment="ai.cloud.environment",this.cloudLocation="ai.cloud.location",this.cloudDeploymentUnit="ai.cloud.deploymentUnit",this.internalNodeName="ai.internal.nodeName",this.internalSdkVersion="ai.internal.sdkVersion",this.internalAgentVersion="ai.internal.agentVersion"},Rt=new Tt,Lt=(Mt.prototype.enqueue=function(e){this._buffer.push(e)},Mt.prototype.count=function(){return this._buffer.length},Mt.prototype.clear=function(){this._buffer.length=0},Mt.prototype.getItems=function(){return this._buffer.slice(0)},Mt.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Mt.prototype.markAsSent=function(e){this.clear()},Mt.prototype.clearSent=function(e){},Mt);function Mt(e){this._config=e,this._buffer=[]}var Ut=(Ot.prototype.enqueue=function(e){this._buffer.length>=Ot.MAX_BUFFER_SIZE?this._bufferFullMessageSent||(this._logger.throwInternal(v.WARNING,V,"Maximum buffer size reached: "+this._buffer.length,!0),this._bufferFullMessageSent=!0):(this._buffer.push(e),this.setBuffer(Ot.BUFFER_KEY,this._buffer))},Ot.prototype.count=function(){return this._buffer.length},Ot.prototype.clear=function(){this._buffer.length=0,this.setBuffer(Ot.BUFFER_KEY,[]),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this._bufferFullMessageSent=!1},Ot.prototype.getItems=function(){return this._buffer.slice(0)},Ot.prototype.batchPayloads=function(e){return e&&0<e.length?this._config.emitLineDelimitedJson()?e.join("\n"):"["+e.join(",")+"]":null},Ot.prototype.markAsSent=function(e){this._buffer=this.removePayloadsFromBuffer(e,this._buffer),this.setBuffer(Ot.BUFFER_KEY,this._buffer);var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t instanceof Array&&e instanceof Array&&((t=t.concat(e)).length>Ot.MAX_BUFFER_SIZE&&(this._logger.throwInternal(v.CRITICAL,V,"Sent buffer reached its maximum size: "+t.length,!0),t.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,t))},Ot.prototype.clearSent=function(e){var t=this.getBuffer(Ot.SENT_BUFFER_KEY);t=this.removePayloadsFromBuffer(e,t),this.setBuffer(Ot.SENT_BUFFER_KEY,t)},Ot.prototype.removePayloadsFromBuffer=function(e,t){var n=[];for(var r in t){var i=!1;for(var a in e)if(e[a]===t[r]){i=!0;break}i||n.push(t[r])}return n},Ot.prototype.getBuffer=function(e){var t=e;try{t=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+t:t;var n=oe.getSessionStorage(this._logger,t);if(n){var r=JSON.parse(n);if(r)return r}}catch(e){this._logger.throwInternal(v.CRITICAL,L," storage key: "+t+", "+oe.getExceptionName(e),{exception:oe.dump(e)})}return[]},Ot.prototype.setBuffer=function(e,t){var n=e;try{n=this._config.namePrefix&&this._config.namePrefix()?this._config.namePrefix()+"_"+n:n;var r=JSON.stringify(t);oe.setSessionStorage(this._logger,n,r)}catch(e){oe.setSessionStorage(this._logger,n,JSON.stringify([])),this._logger.throwInternal(v.WARNING,R," storage key: "+n+", "+oe.getExceptionName(e)+". Buffer cleared",{exception:oe.dump(e)})}},Ot.BUFFER_KEY="AI_buffer",Ot.SENT_BUFFER_KEY="AI_sentBuffer",Ot.MAX_BUFFER_SIZE=2e3,Ot);function Ot(e,t){this._bufferFullMessageSent=!1,this._logger=e,this._config=t;var n=this.getBuffer(Ot.BUFFER_KEY),r=this.getBuffer(Ot.SENT_BUFFER_KEY);this._buffer=n.concat(r),this._buffer.length>Ot.MAX_BUFFER_SIZE&&(this._buffer.length=Ot.MAX_BUFFER_SIZE),this.setBuffer(Ot.SENT_BUFFER_KEY,[]),this.setBuffer(Ot.BUFFER_KEY,this._buffer)}var Pt=(kt.extractProperties=function(e){var t=null;for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];"number"!=typeof r&&((t=t||{})[n]=r)}return t},kt.extractPropsAndMeasurements=function(e,t,n){if(!m.isNullOrUndefined(e))for(var r in e)if(e.hasOwnProperty(r)){var i=e[r];"number"==typeof i?n[r]=i:t[r]="string"==typeof i?i:JSON.stringify(i)}},kt.createEnvelope=function(e,t,n,r){var i=new _e(e,r,t);i.iKey=n.iKey;var a=n.iKey.replace(/-/g,"");return i.name=i.name.replace("{0}",a),kt.extractPartAExtensions(n,i),n.tags||(n.tags=[]),i},kt.extractPartAExtensions=function(n,e){if(e.tags||(e.tags={}),n.ext||(n.ext={}),n.tags||(n.tags=[]),n.ext.user){n.ext.user.authId&&(e.tags[Rt.userAuthUserId]=n.ext.user.authId);var t=n.ext.user.id||n.ext.user.localId;t&&(e.tags[Rt.userId]=t)}if(n.ext.app&&n.ext.app.sesId&&(e.tags[Rt.sessionId]=n.ext.app.sesId),n.ext.device&&((n.ext.device.id||n.ext.device.localId)&&(e.tags[Rt.deviceId]=n.ext.device.id||n.ext.device.localId),n.ext.device.deviceClass&&(e.tags[Rt.deviceType]=n.ext.device.deviceClass),n.ext.device.ip&&(e.tags[Rt.deviceIp]=n.ext.device.ip)),n.ext.web){var r=n.ext.web;r.browserLang&&(e.tags[Rt.deviceLanguage]=r.browserLang),r.browserVer&&(e.tags[Rt.deviceBrowserVersion]=r.browserVer),r.browser&&(e.tags[Rt.deviceBrowser]=r.browser),e.data=e.data||{},e.data.baseData=e.data.baseData||{},e.data.baseData.properties=e.data.baseData.properties||{},r.domain&&(e.data.baseData.properties.domain=r.domain),r.isManual&&(e.data.baseData.properties.isManual=r.isManual.toString()),r.screenRes&&(e.data.baseData.properties.screenRes=r.screenRes),r.userConsent&&(e.data.baseData.properties.userConsent=r.userConsent.toString())}n.ext.device&&n.ext.device.model&&(e.tags[Rt.deviceModel]=n.ext.device.model),n.ext.os&&n.ext.os.name&&(e.tags[Rt.deviceOS]=n.ext.os.name),n.ext.device&&n.ext.device.deviceType&&(e.tags[Rt.deviceType]=n.ext.device.deviceType),n.ext.trace&&(n.ext.trace.parentID&&(e.tags[Rt.operationParentId]=n.ext.trace.parentID),n.ext.trace.name&&(e.tags[Rt.operationName]=n.ext.trace.name),n.ext.trace.traceID&&(e.tags[Rt.operationId]=n.ext.trace.traceID));for(var i={},a=function(e){var t=n.tags[e];Object.keys(t).forEach(function(e){i[e]=t[e]}),n.tags.splice(e,1)},o=n.tags.length-1;0<=o;o--)a(o);for(var s in n.tags)i[s]=n.tags[s];e.tags=p({},e.tags,i),e.tags[Rt.internalSdkVersion]||(e.tags[Rt.internalSdkVersion]="javascript:"+kt.Version)},kt.Version="2.2.2",kt);function kt(){}var zt,Bt=(t(Gt,zt=Pt),Gt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.measurements||{},r=t.baseData.properties||{};Pt.extractPropsAndMeasurements(t.data,r,n);var i=t.baseData;if(m.isNullOrUndefined(i))return e.warnToConsole("Invalid input for dependency data"),null;var a=i.id,o=i.target,s=i.name,l=i.duration,u=i.success,c=i.responseCode,p=i.type,d=i.correlationContext,f=i.properties&&i.properties[ge]?i.properties[ge]:"GET",h=new ut(e,a,o,s,l,u,c,f,p,d,r,n),g=new Et(ut.dataType,h);return Pt.createEnvelope(e,ut.envelopeType,t,g)},Gt.DependencyEnvelopeCreator=new Gt,Gt);function Gt(){return null!==zt&&zt.apply(this,arguments)||this}var Ft,qt=(t(Ht,Ft=Pt),Ht.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n={},r={};t.baseType!==Ee.dataType&&(n.baseTypeSource=t.baseType),t.baseType===Ee.dataType?(n=t.baseData.properties||{},r=t.baseData.measurements||{}):t.baseData&&Pt.extractPropsAndMeasurements(t.baseData,n,r),Pt.extractPropsAndMeasurements(t.data,n,r);var i=t.baseData.name,a=new Ee(e,i,n,r),o=new Et(Ee.dataType,a);return Pt.createEnvelope(e,Ee.envelopeType,t,o)},Ht.EventEnvelopeCreator=new Ht,Ht);function Ht(){return null!==Ft&&Ft.apply(this,arguments)||this}var Xt,jt=(t(Wt,Xt=Pt),Wt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=Ue.CreateFromInterface(e,n),i=new Et(Ue.dataType,r);return Pt.createEnvelope(e,Ue.envelopeType,t,i)},Wt.ExceptionEnvelopeCreator=new Wt,Wt);function Wt(){return null!==Xt&&Xt.apply(this,arguments)||this}var Vt,Kt=(t(Yt,Vt=Pt),Yt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.properties||{},r=Pt.extractProperties(t.data);r=p({},n,r);var i=t.baseData.name,a=t.baseData.average,o=t.baseData.sampleCount,s=t.baseData.min,l=t.baseData.max,u=new Ze(e,i,a,o,s,l,r),c=new Et(Ze.dataType,u);return Pt.createEnvelope(e,Ze.envelopeType,t,c)},Yt.MetricEnvelopeCreator=new Yt,Yt);function Yt(){return null!==Vt&&Vt.apply(this,arguments)||this}var Jt,Zt=(t(Qt,Jt=Pt),Qt.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=void 0;m.isNullOrUndefined(t.baseData)||m.isNullOrUndefined(t.baseData.properties)||m.isNullOrUndefined(t.baseData.properties.duration)?m.isNullOrUndefined(t.data)||m.isNullOrUndefined(t.data.duration)||(n=t.data.duration,delete t.data.duration):(n=t.baseData.properties.duration,delete t.baseData.properties.duration);var r,i=t.baseData;t.ext&&t.ext.trace&&t.ext.trace.traceID&&(r=t.ext.trace.traceID);var a=i.id||r,o=i.name,s=i.uri,l=i.properties||{},u=i.measurements||{};if(m.isNullOrUndefined(i.refUri)||(l.refUri=i.refUri),m.isNullOrUndefined(i.pageType)||(l.pageType=i.pageType),m.isNullOrUndefined(i.isLoggedIn)||(l.isLoggedIn=i.isLoggedIn.toString()),!m.isNullOrUndefined(i.properties)){var c=i.properties;for(var p in c)c.hasOwnProperty(p)&&(l[p]=c[p])}Pt.extractPropsAndMeasurements(t.data,l,u);var d=new rt(e,o,s,n,l,u,a),f=new Et(rt.dataType,d);return Pt.createEnvelope(e,rt.envelopeType,t,f)},Qt.PageViewEnvelopeCreator=new Qt,Qt);function Qt(){return null!==Jt&&Jt.apply(this,arguments)||this}var $t,en=(t(tn,$t=Pt),tn.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData,r=n.name,i=n.uri||n.url,a=n.properties||{},o=n.measurements||{};Pt.extractPropsAndMeasurements(t.data,a,o);var s=new St(e,r,i,void 0,a,o,n),l=new Et(St.dataType,s);return Pt.createEnvelope(e,St.envelopeType,t,l)},tn.PageViewPerformanceEnvelopeCreator=new tn,tn);function tn(){return null!==$t&&$t.apply(this,arguments)||this}var nn,rn=(t(an,nn=Pt),an.prototype.Create=function(e,t){this._logger=e,m.isNullOrUndefined(t.baseData)&&this._logger.throwInternal(v.CRITICAL,U,"telemetryItem.baseData cannot be null.");var n=t.baseData.message,r=t.baseData.severityLevel,i=Pt.extractProperties(t.data),a=p({},i,t.baseData.properties),o=new gt(e,n,r,a),s=new Et(gt.dataType,o);return Pt.createEnvelope(e,gt.envelopeType,t,s)},an.TraceEnvelopeCreator=new an,an);function an(){return null!==nn&&nn.apply(this,arguments)||this}var on=(sn.prototype.serialize=function(e){var t=this._serializeObject(e,"root");return JSON.stringify(t)},sn.prototype._serializeObject=function(e,t){var n="__aiCircularRefCheck",r={};if(!e)return this._logger.throwInternal(v.CRITICAL,P,"cannot serialize object because it is null or undefined",{name:t},!0),r;if(e[n])return this._logger.throwInternal(v.WARNING,z,"Circular reference detected while serializing object",{name:t},!0),r;if(!e.aiDataContract){if("measurements"===t)r=this._serializeStringMap(e,"number",t);else if("properties"===t)r=this._serializeStringMap(e,"string",t);else if("tags"===t)r=this._serializeStringMap(e,"string",t);else if(oe.isArray(e))r=this._serializeArray(e,t);else{this._logger.throwInternal(v.WARNING,k,"Attempting to serialize an object which does not implement ISerializable",{name:t},!0);try{JSON.stringify(e),r=e}catch(e){this._logger.throwInternal(v.CRITICAL,P,e&&"function"==typeof e.toString?e.toString():"Error serializing object",null,!0)}}return r}for(var i in e[n]=!0,e.aiDataContract){var a,o=e.aiDataContract[i],s="function"==typeof o?o()&h.Required:o&h.Required,l="function"==typeof o?o()&h.Hidden:o&h.Hidden,u=o&h.Array,c=void 0!==e[i],p="object"==typeof e[i]&&null!==e[i];!s||c||u?l||void 0!==(a=p?u?this._serializeArray(e[i],i):this._serializeObject(e[i],i):e[i])&&(r[i]=a):this._logger.throwInternal(v.CRITICAL,E,"Missing required field specification. The field is required but not present on source",{field:i,name:t})}return delete e[n],r},sn.prototype._serializeArray=function(e,t){var n=void 0;if(e)if(oe.isArray(e)){n=[];for(var r=0;r<e.length;r++){var i=e[r],a=this._serializeObject(i,t+"["+r+"]");n.push(a)}}else this._logger.throwInternal(v.CRITICAL,G,"This field was specified as an array in the contract but the item is not an array.\r\n",{name:t},!0);return n},sn.prototype._serializeStringMap=function(e,t,n){var r=void 0;if(e)for(var i in r={},e){var a=e[i];if("string"===t)void 0===a?r[i]="undefined":null===a?r[i]="null":a.toString?r[i]=a.toString():r[i]="invalid field: toString() is not defined.";else if("number"===t)if(void 0===a)r[i]="undefined";else if(null===a)r[i]="null";else{var o=parseFloat(a);isNaN(o)?r[i]="NaN":r[i]=o}else r[i]="invalid field: "+n+" is of unknown type.",this._logger.throwInternal(v.CRITICAL,r[i],null,!0)}return r},sn);function sn(e){this._logger=e}function ln(){this._onlineStatus=!0;try{"undefined"==typeof window?this.isListening=!1:window&&window.addEventListener?(window.addEventListener("online",this._setOnline.bind(this),!1),window.addEventListener("offline",this._setOffline.bind(this),!1),this.isListening=!0):document&&document.body?(document.body.ononline=this._setOnline.bind(this),document.body.onoffline=this._setOffline.bind(this),this.isListening=!0):document?(document.ononline=this._setOnline.bind(this),document.onoffline=this._setOffline.bind(this),this.isListening=!0):this.isListening=!1}catch(e){this.isListening=!1}}var un=(ln.prototype._setOnline=function(){this._onlineStatus=!0},ln.prototype._setOffline=function(){this._onlineStatus=!1},ln.prototype.isOnline=function(){return this.isListening?this._onlineStatus:!(navigator&&!m.isNullOrUndefined(navigator.onLine))||navigator.onLine},ln.prototype.isOffline=function(){return!this.isOnline()},ln.Offline=new ln,ln).Offline,cn=(pn.prototype.getHashCodeScore=function(e){return this.getHashCode(e)/pn.INT_MAX_VALUE*100},pn.prototype.getHashCode=function(e){if(""==e)return 0;for(;e.length<pn.MIN_INPUT_LENGTH;)e=e.concat(e);for(var t=5381,n=0;n<e.length;++n)t=(t<<5)+t+e.charCodeAt(n),t&=t;return Math.abs(t)},pn.INT_MAX_VALUE=2147483647,pn.MIN_INPUT_LENGTH=8,pn);function pn(){}var dn=(fn.prototype.getSamplingScore=function(e){return e.tags&&e.tags[this.keys.userId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.userId]):e.ext&&e.ext.user&&e.ext.user.id?this.hashCodeGeneragor.getHashCodeScore(e.ext.user.id):e.tags&&e.tags[this.keys.operationId]?this.hashCodeGeneragor.getHashCodeScore(e.tags[this.keys.operationId]):e.ext&&e.ext.telemetryTrace&&e.ext.telemetryTrace.traceID?this.hashCodeGeneragor.getHashCodeScore(e.ext.telemetryTrace.traceID):100*Math.random()},fn);function fn(){this.hashCodeGeneragor=new cn,this.keys=new Tt}var hn=(gn.prototype.isSampledIn=function(e){var t=this.sampleRate;return null==t||100<=t||e.baseType===Ze.dataType||this.samplingScoreGenerator.getSamplingScore(e)<t},gn);function gn(e,t){this.INT_MAX_VALUE=2147483647,m.isNullOrUndefined(t)?this._logger=new $:this._logger=t,(100<e||e<0)&&(this._logger.throwInternal(v.WARNING,H,"Sampling rate is out of range (0..100). Sampling will be disabled, you may be sending too much data which may affect your AI service level.",{samplingRate:e},!0),this.sampleRate=100),this.sampleRate=e,this.samplingScoreGenerator=new dn}var mn=(vn.prototype.pause=function(){throw new Error("Method not implemented.")},vn.prototype.resume=function(){throw new Error("Method not implemented.")},vn.prototype.flush=function(){try{this.triggerSend()}catch(e){this._logger.throwInternal(v.CRITICAL,x,"flush failed, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.onunloadFlush=function(){if(!1!==this._config.onunloadDisableBeacon()&&!1!==this._config.isBeaconApiDisabled()||!oe.IsBeaconApiSupported())this.flush();else try{this.triggerSend(!0,this._beaconSender)}catch(e){this._logger.throwInternal(v.CRITICAL,w,"failed to flush with beacon sender on page unload, telemetry will not be collected: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype.teardown=function(){throw new Error("Method not implemented.")},vn.prototype.initialize=function(t,e,n){var r=this;this._logger=e.logger,this._serializer=new on(e.logger),this._consecutiveErrors=0,this._retryAt=null,this._lastSend=0,this._sender=null;var i=vn._getDefaultAppInsightsChannelConfig();function a(e){o._config[e]=function(){return At.getConfig(t,e,r.identifier,i[e]())}}this._config=vn._getEmptyAppInsightsChannelConfig();var o=this;for(var s in i)a(s);this._buffer=this._config.enableSessionStorageBuffer&&oe.canUseSessionStorage()?new Ut(this._logger,this._config):new Lt(this._config),this._sample=new hn(this._config.samplingPercentage(),this._logger),!this._config.isBeaconApiDisabled()&&oe.IsBeaconApiSupported()?this._sender=this._beaconSender:"undefined"!=typeof XMLHttpRequest&&("withCredentials"in new XMLHttpRequest?(this._sender=this._xhrSender,this._XMLHttpRequestSupported=!0):"undefined"!=typeof XDomainRequest&&(this._sender=this._xdrSender))},vn.prototype.processTelemetry=function(e){var t=this;try{if(this._config.disableTelemetry())return;if(!e)return void this._logger.throwInternal(v.CRITICAL,S,"Cannot send empty telemetry");if(e.baseData&&!e.baseType)return void this._logger.throwInternal(v.CRITICAL,J,"Cannot send telemetry without baseData and baseType");if(e.baseType||(e.baseType="EventData"),!this._sender)return void this._logger.throwInternal(v.CRITICAL,A,"Sender was not initialized");if(!this._isSampledIn(e))return void this._logger.throwInternal(v.WARNING,D,"Telemetry item was sampled out and not sent",{SampleRate:this._sample.sampleRate});e.tags=e.tags||{},e.tags.sampleRate=this._sample.sampleRate;var n=vn.constructEnvelope(e,this._config.instrumentationKey(),this._logger);if(!n)return void this._logger.throwInternal(v.CRITICAL,O,"Unable to create an AppInsights envelope");var r=!1;if(e.tags&&e.tags[he]&&(e.tags[he].forEach(function(e){try{e&&!1===e(n)&&(r=!0,t._logger.warnToConsole("Telemetry processor check returns false"))}catch(e){t._logger.throwInternal(v.CRITICAL,j,"One of telemetry initializers failed, telemetry item will not be sent: "+oe.getExceptionName(e),{exception:oe.dump(e)},!0)}}),delete e.tags[he]),r)return;var i=this._serializer.serialize(n),a=this._buffer.getItems(),o=this._buffer.batchPayloads(a);o&&o.length+i.length>this._config.maxBatchSizeInBytes()&&this.triggerSend(),this._buffer.enqueue(i),this._setupTimer()}catch(e){this._logger.throwInternal(v.WARNING,b,"Failed adding telemetry to the sender's buffer, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}m.isNullOrUndefined(this._nextPlugin)||this._nextPlugin.processTelemetry(e)},vn.prototype.setNextPlugin=function(e){this._nextPlugin=e},vn.prototype._xhrReadyStateChange=function(e,t,n){if(4===e.readyState){var r=null;this._appId||(r=this._parseResponse(e.responseText||e.response))&&r.appId&&(this._appId=r.appId),(e.status<200||300<=e.status)&&0!==e.status?!this._config.isRetryDisabled()&&this._isRetriable(e.status)?(this._resendPayload(t),this._logger.throwInternal(v.WARNING,T,". Response code "+e.status+". Will retry to send "+t.length+" items.")):this._onError(t,this._formatErrorMessageXhr(e)):un.isOffline()?this._config.isRetryDisabled()||(this._resendPayload(t,10),this._logger.throwInternal(v.WARNING,T,". Offline - Response Code: "+e.status+". Offline status: "+un.isOffline()+". Will retry to send "+t.length+" items.")):206===e.status?(r=r||this._parseResponse(e.responseText||e.response))&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,r):this._onError(t,this._formatErrorMessageXhr(e)):(this._consecutiveErrors=0,this._onSuccess(t,n))}},vn.prototype.triggerSend=function(e,t){void 0===e&&(e=!0);try{if(this._config.disableTelemetry())this._buffer.clear();else{if(0<this._buffer.count()){var n=this._buffer.getItems();t?t.call(this,n,e):this._sender(n,e)}this._lastSend=+new Date}clearTimeout(this._timeoutHandle),this._timeoutHandle=null,this._retryAt=null}catch(e){(!oe.getIEVersion()||9<oe.getIEVersion())&&this._logger.throwInternal(v.CRITICAL,T,"Telemetry transmission failed, some telemetry will be lost: "+oe.getExceptionName(e),{exception:oe.dump(e)})}},vn.prototype._onError=function(e,t,n){this._logger.throwInternal(v.WARNING,C,"Failed to send telemetry.",{message:t}),this._buffer.clearSent(e)},vn.prototype._onPartialSuccess=function(e,t){for(var n=[],r=[],i=0,a=t.errors.reverse();i<a.length;i++){var o=a[i],s=e.splice(o.index,1)[0];this._isRetriable(o.statusCode)?r.push(s):n.push(s)}0<e.length&&this._onSuccess(e,t.itemsAccepted),0<n.length&&this._onError(n,this._formatErrorMessageXhr(null,["partial success",t.itemsAccepted,"of",t.itemsReceived].join(" "))),0<r.length&&(this._resendPayload(r),this._logger.throwInternal(v.WARNING,T,"Partial success. Delivered: "+e.length+", Failed: "+n.length+". Will retry to send "+r.length+" our of "+t.itemsReceived+" items"))},vn.prototype._onSuccess=function(e,t){this._buffer.clearSent(e)},vn.prototype._xdrOnLoad=function(e,t){if(!e||e.responseText+""!="200"&&""!==e.responseText){var n=this._parseResponse(e.responseText);n&&n.itemsReceived&&n.itemsReceived>n.itemsAccepted&&!this._config.isRetryDisabled()?this._onPartialSuccess(t,n):this._onError(t,this._formatErrorMessageXdr(e))}else this._consecutiveErrors=0,this._onSuccess(t,0)},vn.constructEnvelope=function(e,t,n){var r;switch((r=t===e.iKey||m.isNullOrUndefined(t)?e:p({},e,{iKey:t})).baseType){case Ee.dataType:return qt.EventEnvelopeCreator.Create(n,r);case gt.dataType:return rn.TraceEnvelopeCreator.Create(n,r);case rt.dataType:return Zt.PageViewEnvelopeCreator.Create(n,r);case St.dataType:return en.PageViewPerformanceEnvelopeCreator.Create(n,r);case Ue.dataType:return jt.ExceptionEnvelopeCreator.Create(n,r);case Ze.dataType:return Kt.MetricEnvelopeCreator.Create(n,r);case ut.dataType:return Bt.DependencyEnvelopeCreator.Create(n,r);default:return qt.EventEnvelopeCreator.Create(n,r)}},vn._getDefaultAppInsightsChannelConfig=function(){return{endpointUrl:function(){return"https://dc.services.visualstudio.com/v2/track"},emitLineDelimitedJson:function(){return!1},maxBatchInterval:function(){return 15e3},maxBatchSizeInBytes:function(){return 102400},disableTelemetry:function(){return!1},enableSessionStorageBuffer:function(){return!0},isRetryDisabled:function(){return!1},isBeaconApiDisabled:function(){return!0},onunloadDisableBeacon:function(){return!1},instrumentationKey:function(){},namePrefix:function(){},samplingPercentage:function(){return 100}}},vn._getEmptyAppInsightsChannelConfig=function(){return{endpointUrl:void 0,emitLineDelimitedJson:void 0,maxBatchInterval:void 0,maxBatchSizeInBytes:void 0,disableTelemetry:void 0,enableSessionStorageBuffer:void 0,isRetryDisabled:void 0,isBeaconApiDisabled:void 0,onunloadDisableBeacon:void 0,instrumentationKey:void 0,namePrefix:void 0,samplingPercentage:void 0}},vn.prototype._isSampledIn=function(e){return this._sample.isSampledIn(e)},vn.prototype._beaconSender=function(e,t){var n=this._config.endpointUrl(),r=this._buffer.batchPayloads(e),i=new Blob([r],{type:"text/plain;charset=UTF-8"});navigator.sendBeacon(n,i)?(this._buffer.markAsSent(e),this._onSuccess(e,e.length)):(this._xhrSender(e,!0),this._logger.throwInternal(v.WARNING,T,". Failed to send telemetry with Beacon API, retried with xhrSender."))},vn.prototype._xhrSender=function(t,e){var n=this,r=new XMLHttpRequest;r.Microsoft_ApplicationInsights_BypassAjaxInstrumentation=!0,r.open("POST",this._config.endpointUrl(),e),r.setRequestHeader("Content-type","application/json"),oe.isInternalApplicationInsightsEndpoint(this._config.endpointUrl())&&r.setRequestHeader(ne.sdkContextHeader,ne.sdkContextHeaderAppIdRequest),r.onreadystatechange=function(){return n._xhrReadyStateChange(r,t,t.length)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXhr(r),e)};var i=this._buffer.batchPayloads(t);r.send(i),this._buffer.markAsSent(t)},vn.prototype._parseResponse=function(t){try{if(t&&""!==t){var e=JSON.parse(t);if(e&&e.itemsReceived&&e.itemsReceived>=e.itemsAccepted&&e.itemsReceived-e.itemsAccepted==e.errors.length)return e}}catch(e){this._logger.throwInternal(v.CRITICAL,M,"Cannot parse the response. "+oe.getExceptionName(e),{response:t})}return null},vn.prototype._resendPayload=function(e,t){if(void 0===t&&(t=1),e&&0!==e.length){this._buffer.clearSent(e),this._consecutiveErrors++;for(var n=0,r=e;n<r.length;n++){var i=r[n];this._buffer.enqueue(i)}this._setRetryTime(t),this._setupTimer()}},vn.prototype._setRetryTime=function(e){var t;if(this._consecutiveErrors<=1)t=10;else{var n=(Math.pow(2,this._consecutiveErrors)-1)/2,r=Math.floor(Math.random()*n*10)+1;r*=e,t=Math.max(Math.min(r,3600),10)}var i=Date.now()+1e3*t;this._retryAt=i},vn.prototype._setupTimer=function(){var e=this;if(!this._timeoutHandle){var t=this._retryAt?Math.max(0,this._retryAt-Date.now()):0,n=Math.max(this._config.maxBatchInterval(),t);this._timeoutHandle=setTimeout(function(){e.triggerSend()},n)}},vn.prototype._isRetriable=function(e){return 408==e||429==e||500==e||503==e},vn.prototype._formatErrorMessageXhr=function(e,t){return e?"XMLHttpRequest,Status:"+e.status+",Response:"+e.responseText||e.response||"":t},vn.prototype._xdrSender=function(t,e){var n=this,r=new XDomainRequest;r.onload=function(){return n._xdrOnLoad(r,t)},r.onerror=function(e){return n._onError(t,n._formatErrorMessageXdr(r),e)};var i=window.location&&window.location.protocol;if(0!==this._config.endpointUrl().lastIndexOf(i,0))return this._logger.throwInternal(v.WARNING,T,". Cannot send XDomain request. The endpoint URL protocol doesn't match the hosting page protocol."),void this._buffer.clear();var a=this._config.endpointUrl().replace(/^(https?:)/,"");r.open("POST",a);var o=this._buffer.batchPayloads(t);r.send(o),this._buffer.markAsSent(t)},vn.prototype._formatErrorMessageXdr=function(e,t){return e?"XDomainRequest,Response:"+e.responseText||"":t},vn);function vn(){this.priority=1001,this.identifier="AppInsightsChannelPlugin",this._XMLHttpRequestSupported=!1}e.Sender=mn,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=applicationinsights-channel-js.min.js.map
{
"name": "@microsoft/applicationinsights-channel-js",
"version": "2.2.1",
"version": "2.2.2",
"description": "Microsoft Application Insights JavaScript SDK Channel",

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

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

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

@@ -21,3 +21,3 @@ import {

export abstract class EnvelopeCreator {
public static Version = "2.2.1";
public static Version = "2.2.2";
protected _logger: IDiagnosticLogger;

@@ -24,0 +24,0 @@

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc