forked from tandibar/ng-rollbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ng-rollbar.min.js
7 lines (7 loc) · 5.07 KB
/
ng-rollbar.min.js
1
2
3
4
5
6
7
/**
* @license ng-rollbar 0.5.0 (14-10-2015)
* (c) 2015 IdentPro GmbH
* License: MIT
*/
!function(a){a.module("tandibar/ng-rollbar",[]),a.module("tandibar/ng-rollbar").config(["$provide",function(a){a.decorator("$exceptionHandler",["$delegate","$window",function(a,b){return function(c,d){b.Rollbar&&b.Rollbar.error(c,{cause:d}),a(c,d)}}])}]),a.module("tandibar/ng-rollbar").provider("Rollbar",function(){function a(a){function c(){console.warn("Rollbar is deactivated")}var d={Rollbar:c,configure:c,critical:c,error:c,warning:c,info:c,debug:c,scope:c,verbose:c,enable:c,disable:c};return b&&(d.Rollbar=a.Rollbar,d.configure=a.Rollbar.configure,d.critical=a.Rollbar.critical,d.error=a.Rollbar.error,d.warning=a.Rollbar.warning,d.info=a.Rollbar.info,d.debug=a.Rollbar.debug,d.scope=a.Rollbar.scope,d.verbose=function(b){void 0===b&&(b=!0),a.Rollbar.configure({verbose:b})},d.enable=function(){a.Rollbar.configure({enabled:!0})},d.disable=function(){a.Rollbar.configure({enabled:!1})}),d}var b=!0;this.init=function(a){var c=a;b&&!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,d){"use strict";var e=d(1).Rollbar,f=d(2);c.rollbarJsUrl=c.rollbarJsUrl||"https://d37gvrvc0wt4s1.cloudfront.net/js/v1.7/rollbar.min.js";var g=e.init(window,c),h=f(g,c);g.loadFull(window,document,!c.async,c,h)},function(a){"use strict";function b(){var a=window.console;a&&"function"==typeof a.log&&a.log.apply(a,arguments)}function c(a,c){return c=c||b,function(){try{return a.apply(this,arguments)}catch(b){c("Rollbar internal error:",b)}}}function d(a,b,c){window._rollbarWrappedError&&(c[4]||(c[4]=window._rollbarWrappedError),c[5]||(c[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),a.uncaughtError.apply(a,c),b&&b.apply(window,c)}function e(a){this.shimId=++h,this.notifier=null,this.parentShim=a,this.logger=b,this._rollbarOldOnError=null}function f(a){var b=e;return c(function(){if(this.notifier)return this.notifier[a].apply(this.notifier,arguments);var c=this,d="scope"===a;d&&(c=new b(this));var e=Array.prototype.slice.call(arguments,0),f={shim:c,method:a,args:e,ts:new Date};return window._rollbarShimQueue.push(f),d?c:void 0})}function g(a,b){if(b.hasOwnProperty&&b.hasOwnProperty("addEventListener")){var c=b.addEventListener;b.addEventListener=function(b,d,e){c.call(this,b,a.wrap(d),e)};var d=b.removeEventListener;b.removeEventListener=function(a,b,c){d.call(this,a,b&&b._wrapped?b._wrapped:b,c)}}}var h=0;e.init=function(a,b){var f=b.globalAlias||"Rollbar";if("object"==typeof a[f])return a[f];a._rollbarShimQueue=[],a._rollbarWrappedError=null,b=b||{};var h=new e;return c(function(){if(h.configure(b),b.captureUncaught){h._rollbarOldOnError=a.onerror,a.onerror=function(){var a=Array.prototype.slice.call(arguments,0);d(h,h._rollbarOldOnError,a)};var c,e,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(c=0;c<i.length;++c)e=i[c],a[e]&&a[e].prototype&&g(h,a[e].prototype)}return a[f]=h,h},h.logger)()},e.prototype.loadFull=function(a,b,d,e,f){var g=function(){var b;if(void 0===a._rollbarPayloadQueue){var c,d,e,g;for(b=new Error("rollbar.js did not load");c=a._rollbarShimQueue.shift();)for(e=c.args,g=0;g<e.length;++g)if(d=e[g],"function"==typeof d){d(b);break}}"function"==typeof f&&f(b)},h=!1,i=b.createElement("script"),j=b.getElementsByTagName("script")[0],k=j.parentNode;i.src=e.rollbarJsUrl,i.async=!d,i.onload=i.onreadystatechange=c(function(){if(!(h||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{k.removeChild(i)}catch(a){}h=!0,g()}},this.logger),k.insertBefore(i,j)},e.prototype.wrap=function(a,b){try{var c;if(c="function"==typeof b?b:function(){return b||{}},"function"!=typeof a)return a;if(a._isWrap)return a;if(!a._wrapped){a._wrapped=function(){try{return a.apply(this,arguments)}catch(b){throw b._rollbarContext=c()||{},b._rollbarContext._wrappedSource=a.toString(),window._rollbarWrappedError=b,b}},a._wrapped._isWrap=!0;for(var d in a)a.hasOwnProperty(d)&&(a._wrapped[d]=a[d])}return a._wrapped}catch(e){return a}};for(var i="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError".split(","),j=0;j<i.length;++j)e.prototype[i[j]]=f(i[j]);a.exports={Rollbar:e,_rollbarWindowOnError:d}},function(a){"use strict";a.exports=function(a,b){return function(c){if(!c&&!window._rollbarInitialized){var d=window.RollbarNotifier,e=b||{},f=e.globalAlias||"Rollbar",g=window.Rollbar.init(e,a);g._processShimQueue(window._rollbarShimQueue||[]),window[f]=g,window._rollbarInitialized=!0,d.processPayloads()}}}}])},this.deinit=function(){b=!1},a.$inject=["$window"],this.$get=a})}(angular);
//# sourceMappingURL=ng-rollbar.min.js.map