UNPKG

ng2-appinsights

Version:
2 lines 7.14 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core")):"function"==typeof define&&define.amd?define(["@angular/core"],e):"object"==typeof exports?exports["ng2-appinsights"]=e(require("@angular/core")):t["ng2-appinsights"]=e(t["@angular/core"])}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);e.AppInsightsErrorHandler=n.AppInsightsErrorHandler;var o=r(6);e.AppInsightsModule=o.AppInsightsModule;var i=r(2);e.AppInsightsService=i.AppInsightsService;var a=r(4);e.SeverityLevel=a.SeverityLevel},function(e,r){e.exports=t},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},i=this&&this.__param||function(t,e){return function(r,n){e(r,n,t)}};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),s=r(5),c=function(){function t(t){this.appInsights=t.getAppInsightsInstance()}return t.prototype.Init=function(t){this.appInsights.downloadAndSetup(t)},t.prototype.trackPageView=function(t,e,r,n,o){this.appInsights.trackPageView(t,e,r,n,o)},t.prototype.trackEvent=function(t,e,r){this.appInsights.trackEvent(t,e,r)},t.prototype.trackMetric=function(t,e,r,n,o,i){this.appInsights.trackMetric(t,e,r,n,o,i)},t.prototype.trackException=function(t,e,r,n,o){this.appInsights.trackException(t,e,r,n,o)},t.prototype.trackTrace=function(t,e,r){this.appInsights.trackTrace(t,e,r)},t.prototype.trackDependency=function(t,e,r,n,o,i,a){this.appInsights.trackDependency(t,e,r,n,o,i,a)},t.prototype.flush=function(){this.appInsights.flush()},t.prototype.setAuthenticatedUserContext=function(t,e){this.appInsights.setAuthenticatedUserContext(t,e)},t.prototype.clearAuthenticatedUserContext=function(){this.appInsights.clearAuthenticatedUserContext()},t.prototype.startTrackPage=function(t){this.appInsights.startTrackPage(t)},t.prototype.stopTrackPage=function(t,e,r,n){this.appInsights.stopTrackPage(t,e,r,n)},t}();c=n([a.Injectable(),i(0,a.Inject(s.AppInsightsLibraryService)),o("design:paramtypes",[s.AppInsightsLibraryService])],c),e.AppInsightsService=c},function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},i=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0});var a=r(1),s=r(4),c=r(2),p=function(t){function e(e){var r=t.call(this,!0)||this;return r.appInsightsService=e,r}return n(e,t),e.prototype.handleError=function(e){this.appInsightsService.trackException(e,"unhandled",null,null,s.SeverityLevel.Error),t.prototype.handleError.call(this,e)},e}(a.ErrorHandler);p=o([a.Injectable(),i("design:paramtypes",[c.AppInsightsService])],p),e.AppInsightsErrorHandler=p},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r;!function(t){t[t.Verbose=0]="Verbose",t[t.Information=1]="Information",t[t.Warning=2]="Warning",t[t.Error=3]="Error",t[t.Critical=4]="Critical"}(r=e.SeverityLevel||(e.SeverityLevel={}))},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(e,"__esModule",{value:!0});var i=r(1),a=function(){function t(){this._appInsightsInitialized=!1,this._appInsightsName="appInsights",this.window=window}return t.prototype._createLazyMethod=function(t){var e=this.window[this._appInsightsName];e[t]=function(){var r=arguments;e.queue?e.queue.push(function(){return e[t].apply(e,r)}):e[t].apply(e,r)}},t.prototype._defineLazyMethods=function(){var t=this.window[this._appInsightsName];try{t.cookie=document.cookie}catch(t){}t.queue=[];for(var e=["clearAuthenticatedUserContext","flush","setAuthenticatedUserContext","startTrackEvent","startTrackPage","stopTrackEvent","stopTrackPage","trackDependency","trackEvent","trackException","trackMetric","trackPageView","trackTrace"];e.length;)this._createLazyMethod(e.pop())},t.prototype._getDownloadAndSetup=function(){var t=this;return function(e){var r=t.window[t._appInsightsName];r.config=e,r.queue||(r.queue=[]);var n=document.createElement("script");if(n.src=e.url||"https://az416426.vo.msecnd.net/scripts/a/ai.0.js",document.head.appendChild(n),!e.disableExceptionTracking){t._createLazyMethod("_onerror");var o=t.window._onerror;t.window._onerror=function(t,e,n,i,a){var s=o&&o(t,e,n,i,a);return s!==!0&&r._onerror(t,e,n,i,a),s}}}},t.prototype.getAppInsightsInstance=function(){return this.window[this._appInsightsName]||(this.window[this._appInsightsName]={downloadAndSetup:this._getDownloadAndSetup(),_defineLazyMethods:this._defineLazyMethods},this._defineLazyMethods()),this.window[this._appInsightsName]},t}();a=n([i.Injectable(),o("design:paramtypes",[])],a),e.AppInsightsLibraryService=a},function(t,e,r){"use strict";var n=this&&this.__decorate||function(t,e,r,n){var o,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,r,n);else for(var s=t.length-1;s>=0;s--)(o=t[s])&&(a=(i<3?o(a):i>3?o(e,r,a):o(e,r))||a);return i>3&&a&&Object.defineProperty(e,r,a),a};Object.defineProperty(e,"__esModule",{value:!0});var o=r(1),i=r(5),a=r(2),s=r(3),c=function(){function t(){}return t}();c=n([o.NgModule({providers:[i.AppInsightsLibraryService,a.AppInsightsService,{provide:o.ErrorHandler,useClass:s.AppInsightsErrorHandler}]})],c),e.AppInsightsModule=c}])}); //# sourceMappingURL=ng2-appinsights.min.js.map