1 line
56 KiB
JavaScript
1 line
56 KiB
JavaScript
|
|
function initializeAppInsights(){var i,r;try{if(typeof window!="undefined"&&typeof JSON!="undefined")if(i="appInsights",window[i]===undefined)Microsoft.ApplicationInsights.AppInsights.defaultConfig=Microsoft.ApplicationInsights.Initialization.getDefaultConfig();else{var u=window[i]||{},n=new Microsoft.ApplicationInsights.Initialization(u),t=n.loadAppInsights();for(r in t)u[r]=t[r];n.emptyQueue();n.pollInteralLogs(t);n.addHousekeepingBeforeUnload(t)}}catch(f){Microsoft.ApplicationInsights._InternalLogging.warnToConsole("Failed to initialize AppInsights JS SDK: "+f.message)}}var __extends,AI,Microsoft;(function(n){var t;(function(n){(function(n){n[n.CRITICAL=0]="CRITICAL";n[n.WARNING=1]="WARNING"})(n.LoggingSeverity||(n.LoggingSeverity={}));var i=n.LoggingSeverity,t=function(){function n(){}return n.throwInternalNonUserActionable=function(n,t){if(this.enableDebugExceptions())throw t;else this.warnToConsole(t),this.logInternalMessage(n,this.AiNonUserActionablePrefix+t)},n.throwInternalUserActionable=function(n,t){if(this.enableDebugExceptions())throw t;else this.warnToConsole(t),this.logInternalMessage(n,this.AiUserActionablePrefix+t)},n.warnToConsole=function(n){typeof console=="undefined"||!console||(typeof console.warn=="function"?console.warn(n):typeof console.log=="function"&&console.log(n))},n.resetInternalMessageCount=function(){this._messageCount=0},n.setMaxInternalMessageLimit=function(n){if(!n)throw new Error("limit cannot be undefined.");this.MAX_INTERNAL_MESSAGE_LIMIT=n},n.logInternalMessage=function(n,t){if(!this._areInternalMessagesThrottled()&&((this.verboseLogging()||n===0)&&(this.queue.push(t),this._messageCount++),this._messageCount==this.MAX_INTERNAL_MESSAGE_LIMIT)){var i=this.AiNonUserActionablePrefix+"Internal events throttle limit per PageView reached for this app.";this.queue.push(i);this.warnToConsole(i)}},n._areInternalMessagesThrottled=function(){return this._messageCount>=this.MAX_INTERNAL_MESSAGE_LIMIT},n.AiUserActionablePrefix="AI: ",n.AiNonUserActionablePrefix="AI (Internal): ",n.enableDebugExceptions=function(){return!1},n.verboseLogging=function(){return!1},n.queue=[],n.MAX_INTERNAL_MESSAGE_LIMIT=25,n._messageCount=0,n}();n._InternalLogging=t})(t=n.ApplicationInsights||(n.ApplicationInsights={}))})(Microsoft||(Microsoft={})),function(n){var t;(function(n){var t=function(){function t(){}return t._getStorageObject=function(){try{return window.localStorage?window.localStorage:null}catch(t){return n._InternalLogging.warnToConsole("Failed to get client localStorage: "+t.message),null}},t.canUseLocalStorage=function(){return!!t._getStorageObject()},t.getStorage=function(i){var r=t._getStorageObject();if(r!==null)try{return r.getItem(i)}catch(u){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed read of local storage."+t.dump(u))}return null},t.setStorage=function(i,r){var u=t._getStorageObject();if(u!==null)try{return u.setItem(i,r),!0}catch(f){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed write to local storage."+t.dump(f))}return!1},t.removeStorage=function(i){var r=t._getStorageObject();if(r!==null)try{return r.removeItem(i),!0}catch(u){n._InternalLogging.throwInternalNonUserActionable(1,"Browser failed removal of local storage item."+t.dump(u))}return!1},t._getSessionStorageObject=function(){try{return window.sessionStorage?window.sessionStorage:null}catch(t){return n._InternalLogging.warnToConsole("Failed to get client session storage: "+t.message),null}},t.canUseSessionStorage=function(){return!!t._getSessionStorageObject()},t.getSessionStorage=function(i){var r=t._getSessionStorageObject();if(r!==null)try{return r.getItem(i)}catch(u){n._InternalLogging.throwInternalNonUserActionable(0,"Browser failed read of session storage."+t.dump(u))}return null},t.setSessionStorage=function(i,r){var u=t._getSessionStorageObject();if(u!==null)try{return u.setItem(i,r),!0}catch(f){n._InternalLogging.throwInternalNonUserActionable(0,"Browser failed write to session storage."+t.dump(f))}return!1},t.removeSessionStorage=function(i){var r=t._getSessionStorageObject();if(
|