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.57 KB
/
ng-rollbar.min.js
1
2
3
4
5
6
7
/**
* @license ng-rollbar 1.9.1 (20-04-2016)
* (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","$injector","$window",function(a,b,c){return function(d,e){c.Rollbar&&c.Rollbar.error(d,{cause:e},function(a,c){var e=b.get("$rootScope");e.$emit("rollbar:exception",{exception:d,err:a,data:c.result})}),a(d,e)}}])}]),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=function(b){return a.Rollbar.configure(b)},d.critical=function(b){return a.Rollbar.critical(b)},d.error=function(b){return a.Rollbar.error(b)},d.warning=function(b){return a.Rollbar.warning(b)},d.info=function(b){return a.Rollbar.info(b)},d.debug=function(b){return a.Rollbar.debug(b)},d.scope=function(b){return a.Rollbar.scope(b)},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.9/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(a){return function(){try{return a.apply(this,arguments)}catch(b){try{console.error("[Rollbar]: Internal error",b)}catch(c){}}}}function c(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 d(a){var b=function(){var b=Array.prototype.slice.call(arguments,0);c(a,a._rollbarOldOnError,b)};return b.belongsToShim=!0,b}function e(a){this.shimId=++h,this.notifier=null,this.parentShim=a,this._rollbarOldOnError=null}function f(a){var c=e;return b(function(){if(this.notifier)return this.notifier[a].apply(this.notifier,arguments);var b=this,d="scope"===a;d&&(b=new c(this));var e=Array.prototype.slice.call(arguments,0),f={shim:b,method:a,args:e,ts:new Date};return window._rollbarShimQueue.push(f),d?b: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,c){var f=c.globalAlias||"Rollbar";if("object"==typeof a[f])return a[f];a._rollbarShimQueue=[],a._rollbarWrappedError=null,c=c||{};var h=new e;return b(function(){if(h.configure(c),c.captureUncaught){h._rollbarOldOnError=a.onerror,a.onerror=d(h);var b,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(b=0;b<i.length;++b)e=i[b],a[e]&&a[e].prototype&&g(h,a[e].prototype)}return c.captureUnhandledRejections&&(h._unhandledRejectionHandler=function(a){var b=a.reason,c=a.promise,d=a.detail;!b&&d&&(b=d.reason,c=d.promise),h.unhandledRejection(b,c)},a.addEventListener("unhandledrejection",h._unhandledRejectionHandler)),a[f]=h,h})()},e.prototype.loadFull=function(a,c,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=c.createElement("script"),j=c.getElementsByTagName("script")[0],k=j.parentNode;i.crossOrigin="",i.src=e.rollbarJsUrl,i.async=!d,i.onload=i.onreadystatechange=b(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()}}),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,unhandledRejection".split(","),j=0;j<i.length;++j)e.prototype[i[j]]=f(i[j]);a.exports={Rollbar:e,_rollbarWindowOnError:c}},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