diff --git a/README.md b/README.md index df234f142..00d372275 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rollbar.js -[![Build Status](https://api.travis-ci.org/rollbar/rollbar.js.png?branch=v2.12.1)](https://travis-ci.org/rollbar/rollbar.js) +[![Build Status](https://api.travis-ci.org/rollbar/rollbar.js.png?branch=v2.12.2)](https://travis-ci.org/rollbar/rollbar.js) [![Code Quality: Javascript](https://img.shields.io/lgtm/grade/javascript/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/context:javascript) [![Total Alerts](https://img.shields.io/lgtm/alerts/g/rollbar/rollbar.js.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/rollbar/rollbar.js/alerts) diff --git a/dist/rollbar.js b/dist/rollbar.js index 49abccf25..1c0a0622e 100644 --- a/dist/rollbar.js +++ b/dist/rollbar.js @@ -1567,9 +1567,7 @@ Rollbar.prototype.handleAnonymousErrors = function() { } // Workaround to ensure stack is preserved for normal errors. - error.stack; - - return error.toString(); + return error.stack; } // https://v8.dev/docs/stack-trace-api @@ -1770,7 +1768,7 @@ function _gWindow() { /* global __DEFAULT_ENDPOINT__:false */ var defaultOptions = { - version: "2.12.1", + version: "2.12.2", scrubFields: ["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","secret_key","secretKey","secretToken","cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"], logLevel: "debug", reportLevel: "debug", diff --git a/dist/rollbar.js.map b/dist/rollbar.js.map index 98ae11b9d..026435dfb 100644 --- a/dist/rollbar.js.map +++ b/dist/rollbar.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/utility.js","webpack:///./src/browser/logger.js","webpack:///./src/truncation.js","webpack:///./src/browser/url.js","webpack:///./src/browser/errorParser.js","webpack:///./src/browser/bundles/rollbar.js","webpack:///./src/browser/rollbar.js","webpack:///./src/rollbar.js","webpack:///./src/rateLimiter.js","webpack:///./src/merge.js","webpack:///./vendor/JSON-js/json3.js","webpack:///./src/queue.js","webpack:///./src/notifier.js","webpack:///./src/telemetry.js","webpack:///./src/api.js","webpack:///./src/apiUtility.js","webpack:///./node_modules/console-polyfill/index.js","webpack:///./src/browser/detection.js","webpack:///./src/browser/globalSetup.js","webpack:///./src/browser/transport.js","webpack:///./src/browser/transforms.js","webpack:///./node_modules/error-stack-parser/error-stack-parser.js","webpack:///./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack:///./src/transforms.js","webpack:///./src/browser/predicates.js","webpack:///./src/predicates.js","webpack:///./src/browser/telemetry.js","webpack:///./src/browser/domUtility.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AC9EA,uBAAuB,mBAAO,CAAC,EAAoB;;AAEnD;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvHA,cAAc,mBAAO,CAAC,CAAY;;AAElC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;;;;;;ACrBA,aAAa,mBAAO,CAAC,CAAY;AACjC,QAAQ,mBAAO,CAAC,CAAY;AAC5B,UAAU,mBAAO,CAAC,EAAQ;AAC1B,aAAa,mBAAO,CAAC,CAAU;AAC/B,cAAc,mBAAO,CAAC,EAAe;;AAErC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,aAAa,mBAAO,CAAC,CAAO;;AAE5B,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,kBAAkB,mBAAO,CAAC,CAAe;AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChiBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/utility.js","webpack:///./src/browser/logger.js","webpack:///./src/truncation.js","webpack:///./src/browser/url.js","webpack:///./src/browser/errorParser.js","webpack:///./src/browser/bundles/rollbar.js","webpack:///./src/browser/rollbar.js","webpack:///./src/rollbar.js","webpack:///./src/rateLimiter.js","webpack:///./src/merge.js","webpack:///./vendor/JSON-js/json3.js","webpack:///./src/queue.js","webpack:///./src/notifier.js","webpack:///./src/telemetry.js","webpack:///./src/api.js","webpack:///./src/apiUtility.js","webpack:///./node_modules/console-polyfill/index.js","webpack:///./src/browser/detection.js","webpack:///./src/browser/globalSetup.js","webpack:///./src/browser/transport.js","webpack:///./src/browser/transforms.js","webpack:///./node_modules/error-stack-parser/error-stack-parser.js","webpack:///./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack:///./src/transforms.js","webpack:///./src/browser/predicates.js","webpack:///./src/predicates.js","webpack:///./src/browser/telemetry.js","webpack:///./src/browser/domUtility.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,CAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AC9EA,uBAAuB,mBAAO,CAAC,EAAoB;;AAEnD;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvHA,cAAc,mBAAO,CAAC,CAAY;;AAElC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;;;;;;ACrBA,aAAa,mBAAO,CAAC,CAAY;AACjC,QAAQ,mBAAO,CAAC,CAAY;AAC5B,UAAU,mBAAO,CAAC,EAAQ;AAC1B,aAAa,mBAAO,CAAC,CAAU;AAC/B,cAAc,mBAAO,CAAC,EAAe;;AAErC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,aAAa,mBAAO,CAAC,CAAO;;AAE5B,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,kBAAkB,mBAAO,CAAC,CAAe;AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC9hBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.min.js b/dist/rollbar.min.js index c901ace7f..36a19240e 100644 --- a/dist/rollbar.min.js +++ b/dist/rollbar.min.js @@ -1 +1 @@ -!function(n){var r={};function o(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}o.m=n,o.c=r,o.d=function(t,e,n){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="",o(o.s=5)}([function(t,e,n){var y=n(9),i={},r=!1;function p(t,e){return e===b(t)}function b(t){var e=typeof t;return"object"!=e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function a(t){return p(t,"function")}function o(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),n=RegExp("^"+e+"$");return s(t)&&n.test(t)}function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function u(t,e,n){var r,o,i,a=p(t,"object"),s=p(t,"array"),u=[];if(a&&-1!==n.indexOf(t))return t;if(n.push(t),a)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&u.push(r);else if(s)for(i=0;it?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(21),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(15),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;rt?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(21),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(15),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;r qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/utility.js","webpack:///./src/browser/logger.js","webpack:///./src/truncation.js","webpack:///./src/browser/url.js","webpack:///./src/browser/errorParser.js","webpack:///./src/browser/bundles/rollbar.js","webpack:///./src/browser/rollbar.js","webpack:///./src/rollbar.js","webpack:///./src/rateLimiter.js","webpack:///./src/merge.js","webpack:///./vendor/JSON-js/json3.js","webpack:///./src/queue.js","webpack:///./src/notifier.js","webpack:///./src/telemetry.js","webpack:///./src/api.js","webpack:///./src/apiUtility.js","webpack:///./node_modules/console-polyfill/index.js","webpack:///./src/browser/detection.js","webpack:///./src/browser/globalSetup.js","webpack:///./src/browser/transport.js","webpack:///./src/browser/transforms.js","webpack:///./node_modules/error-stack-parser/error-stack-parser.js","webpack:///./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack:///./src/transforms.js","webpack:///./src/browser/predicates.js","webpack:///./src/predicates.js","webpack:///./src/browser/telemetry.js","webpack:///./src/browser/domUtility.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","merge","RollbarJSON","__initRollbarJSON","isType","x","typeName","Error","toString","match","toLowerCase","isFunction","f","isNativeFunction","funcMatchString","Function","replace","reIsNative","RegExp","isObject","test","type","traverse","obj","func","seen","k","v","isObj","isArray","keys","indexOf","push","length","result","same","redact","uuid4","now","Math","random","floor","JSON","stringify","parse","setupCustomJSON","parseUriOptions","strictMode","q","parser","strict","loose","backup","error","jsonError","backupError","wrapCallback","logger","err","resp","e","TELEMETRY_TYPES","TELEMETRY_LEVELS","arrayIncludes","arr","val","Date","addParamsAndAccessTokenToPath","accessToken","options","params","access_token","paramsArray","join","query","sort","path","qs","h","substring","createItem","args","notifier","requestKeys","lambdaContext","message","custom","callback","request","arg","extraArgs","typ","DOMException","j","len","undefined","item","timestamp","uuid","level","_originalArgs","createTelemetryEvent","metadata","filterIp","requestData","captureIp","newIp","parts","split","pop","beginning","slice","slashIdx","concat","formatArgsAsString","substr","formatUrl","u","protocol","port","hostname","handleOptions","current","input","payload","overwriteScrubFields","scrubFields","isError","isIterable","isString","String","jsonParse","LEVELS","debug","info","warning","critical","makeUnhandledStackInfo","url","lineno","colno","backupMessage","errorParser","location","line","column","guessFunctionName","context","gatherContext","href","document","useragent","window","navigator","userAgent","stack","sanitizeUrl","baseUrlParts","str","exec","uri","$0","$1","$2","parseUri","anchor","source","scrub","data","paramRes","pat","ret","_getScrubFieldRegexs","queryRes","_getScrubQueryParamRegexs","redactQueryParam","dummy0","paramPart","scrubber","tmpV","valScrubber","paramScrubber","set","temp","replacement","detection","_","Array","arguments","unshift","ieVersion","console","apply","log","raw","jsonBackup","selectFrames","frames","range","truncateFrames","body","trace_chain","chain","trace","maybeTruncateValue","truncateStrings","truncator","truncateTraceData","traceData","exception","description","minBody","truncate","maxSize","strategy","results","strategies","shift","last","auth","host","hash","pathname","search","parseInt","pathParts","ErrorStackParser","ERR_CLASS_REGEXP","Frame","stackFrame","_stackFrame","fileName","lineNumber","functionName","columnNumber","Stack","constructor","exc","parserStack","getStack","rawStack","rawException","guessErrorClass","errMsg","errClassMatch","errClass","nested","traceChain","rollbar","_rollbarConfig","alias","globalAlias","shimRunning","shimId","_rollbarStartTime","getTime","Rollbar","_rollbarDidLoad","self","Client","API","globals","transport","urllib","transforms","sharedTransforms","predicates","sharedPredicates","Instrumenter","client","this","defaultOptions","_configuredOptions","api","gWindow","_gWindow","gDocument","isChrome","chrome","runtime","anonymousErrorsPending","addTransform","handleDomException","handleItemWithError","ensureItemHasSomethingToSay","addBaseInfo","addRequestInfo","addClientInfo","addPluginInfo","addBody","addMessageWithError","addTelemetryData","addConfigToPayload","scrubPayload","userTransform","addConfiguredOptions","addDiagnosticKeys","itemToPayload","addTransformsToNotifier","queue","addPredicate","checkLevel","checkIgnore","userCheckIgnore","urlIsNotBlacklisted","urlIsWhitelisted","messageIsIgnored","addPredicatesToQueue","setupUnhandledCapture","instrumenter","telemeter","instrument","_instance","handleUninitialized","maybeCallback","_getFirstFunction","init","global","configure","payloadData","oldOptions","lastError","_createItem","warn","buildJsonPayload","sendJsonPayload","jsonPayload","unhandledExceptionsInitialized","captureUncaught","handleUncaughtExceptions","captureUncaughtExceptions","wrapGlobalEventHandlers","wrapGlobals","unhandledRejectionsInitialized","captureUnhandledRejections","handleUnhandledRejections","handleUncaughtException","inspectAnonymousErrors","stackInfo","_unhandledStackInfo","uncaughtErrorLevel","_isUncaught","handleAnonymousErrors","prepareStackTrace","_stack","_isAnonymous","handleUnhandledRejection","reason","promise","reasonResult","_rollbarContext","wrap","_before","ctxFn","_isWrap","_rollbar_wrapped","_rollbarWrappedError","_wrappedSource","prop","captureEvent","event","captureDomContentLoaded","ts","captureLoad","version","logLevel","reportLevel","endpoint","verbose","enabled","transmit","sendConfig","includeItemsInTelemetry","ignoreDuplicateErrors","RateLimiter","Queue","Notifier","Telemeter","platform","rateLimiter","configureGlobal","setPlatformOptions","lastErrorHash","maxItems","itemsPerMinute","_defaultLogLevel","_log","wait","postJsonPayload","defaultLevel","_sameAsLastError","_captureRollbarItem","telemetryEvents","copyEvents","itemHash","generateItemHash","startTime","counter","perMinCounter","platformOptions","checkRate","limit","ignoreRateLimit","shouldSendValue","shouldSend","globalRateLimit","limitPerMin","perMinute","msg","environment","extra","language","framework","rateLimitPayload","globalSettings","elapsedTime","globalRateLimitPerMin","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copy","clone","gap","indent","meta","rep","state","container","escapes","string","number","action","rx_escapable","this_value","valueOf","quote","lastIndex","a","charCodeAt","toJSON","isFinite","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Boolean","Number","\b","\t","\n","\f","\r","\"","\\","replacer","space","holder","partial","mind","","/","b","go","firstokey","okey","ovalue","firstavalue","avalue","{","}","ocomma","[","]","acomma",":","colon","SyntaxError",",","true","false","null","reviver","text","tx","ignore","fromCharCode","walk","pendingItems","pendingRequests","retryQueue","retryHandle","waitCallback","waitIntervalID","predicate","addPendingItem","removePendingItem","idx","splice","addItem","originalError","originalItem","predicateResult","_applyPredicates","stop","_maybeLog","_makeApiRequest","_dequeuePendingRequest","_maybeCallWait","clearInterval","setInterval","rateLimitResponse","postItem","_maybeRetry","RETRIABLE_ERRORS","shouldRetry","retryInterval","code","_retryApiRequest","retryObject","transform","_applyTransforms","transformIndex","transformsLength","cb","maxTelemetryEvents","maxQueueSize","max","min","newMaxEvents","deleteCount","events","filterTelemetry","capture","rollbarUUID","manual","getLevel","timestamp_ms","captureError","captureLog","captureNetwork","subtype","levelFromStatus","status_code","statusCode","captureDom","element","checked","captureNavigation","from","to","captureConnectivityChange","change","helpers","truncation","Api","transportOptions","_getTransport","getTransportFromOptions","buildPayload","post","stringifyResult","contextResult","defaults","proxy","opts","method","appendPathToPath","base","baseTrailingSlash","pathBeginningSlash","con","dummy","properties","methods","Detection","div","createElement","all","getElementsByTagName","innerHTML","undef","_extendListenerPrototype","handler","shim","oldAddEventListener","addEventListener","_rollbarOldAdd","belongsToShim","addFn","bubble","oldRemoveEventListener","removeEventListener","_rollbarOldRemove","removeFn","oldOnError","_rollbarOldOnError","onerror","fn","old","_rollbarWindowOnError","rejectionHandler","evt","detail","_rollbarURH","_makeZoneRequest","requestFactory","currentZone","Zone","_name","_parent","run","_makeRequest","RollbarProxy","json","_msg","_proxyRequest","xmlhttp","factories","XMLHttpRequest","ActiveXObject","numFactories","_createXMLHTTPObject","onreadystatechange","readyState","parseResponse","responseText","status","_isSuccess","_isNormalFailure","_newRetriableError","ex","open","setRequestHeader","send","e1","XDomainRequest","xdomainrequest","onprogress","ontimeout","onload","e2","writeData","addBodyMessage","stackFromItem","buildTrace","guess","class","frame","pre","contextLength","mid","filename","sendFrameUrl","endsWith","reverse","_savedStackTrace","server","remoteString","query_string","user_ip","nav","scr","screen","runtime_ms","round","javascript","browser","cookie_enabled","cookieEnabled","width","height","cur","plugins","navPlugins","traces","traceChainLength","addBodyTraceChain","className","addBodyTrace","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","root","factory","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","_map","array","thisArg","map","output","_filter","filter","stacktrace","parseOpera","parseV8OrIE","parseFFOrSafari","extractLocation","urlLike","locationParts","lastNumber","possibleNumber","isNaN","parseFloat","filtered","tokens","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","argsRaw","functionCall","_isNumber","setFunctionName","setArgs","setFileName","setLineNumber","setColumnNumber","setSource","getFunctionName","getArgs","TypeError","getFileName","getLineNumber","getColumnNumber","getSource","payloadOptions","tracePath","newExtra","newItem","configured_options","diagnostic","is_anonymous","raw_error","constructor_name","failed","settings","matchFrames","list","black","listLength","frameLength","urlIsOnAList","whiteOrBlack","hostBlackList","hostWhiteList","tracesLength","listName","levelVal","isUncaught","onSendCallback","exceptionMessage","ignoredMessages","traceMessage","bodyMessage","urlparser","domUtil","network","networkResponseHeaders","networkResponseBody","networkRequestBody","dom","navigation","connectivity","replacements","orig","restore","_window","_document","autoInstrument","scrubTelemetryInputs","telemetryScrubber","defaultValueScrubber","patterns","attributes","attrs","nameFromDescription","eventRemovers","_location","_lastHref","oldSettings","deinstrumentNetwork","instrumentNetwork","deinstrumentConsole","instrumentConsole","deinstrumentDom","instrumentDom","deinstrumentNavigation","instrumentNavigation","deinstrumentConnectivity","instrumentConnectivity","wrapProp","xhr","xhrp","__rollbar_xhr","start_time_ms","end_time_ms","onreadystatechangeHandler","__rollbar_event","headers","headersConfig","header","allHeaders","getAllResponseHeaders","trim","getResponseHeader","response","then","wrapConsole","origConsole","removeListeners","clickHandler","handleClick","blurHandler","handleBlur","addListener","getElementFromEvent","hasTag","tagName","anchorOrButton","isDescribedElement","captureDomEvent","handleSelectInputChanged","elem","multiple","selected","selectedIndex","isChecked","getElementType","describeElement","elementString","elementArrayToString","treeToArray","app","history","pushState","handleUrlChange","parsedHref","parsedTo","parsedFrom","section","altType","attachEvent","detachEvent","getAttribute","descriptionToString","desc","out","id","classes","attr","nextStr","totalLength","separatorLength","MAX_LENGTH","nextDescription","parentNode","doc","target","elementFromPoint","clientX","clientY","subtypes"],"mappings":"aACA,IAAAA,EAAA,GAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,GAAA,CACAG,EAAAH,EACAI,GAAA,EACAH,QAAA,IAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QAKAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,EAAA,CAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,YAAA,CAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAA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A,IAEAma,EAAAC,EADAC,EAAA,MAAA5zB,OACAszB,EAAA,GAAAzvB,EAAA,EAEA7H,EAAAud,EAAAvZ,OAAA,EAA4B,GAAAhE,EAAQA,IAAA,CAGpC,GAFA03B,EAAAN,EAAA7Z,EAAAvd,IACA23B,EAAA9vB,EAAAyvB,EAAAtzB,OAAA4zB,EAAAF,EAAA1zB,OACAhE,EAAAud,EAAAvZ,OAAA,GAAA6zB,IAAAF,EAAA,CACAL,EAAA1pB,QAAA,OACA,MAEA0pB,EAAA1pB,QAAA8pB,GACA7vB,GAAA6vB,EAAA1zB,OAEA,OAAAszB,EAAA9wB,KAbA,QA8EA+vB,YA/FA,SAAAT,GAIA,IAHA,IAEAgC,EADAR,EAAA,GAEApL,EAAA,EAAsB4J,GAAA5J,EAHtB,GAKA,UADA4L,EAAA1B,EAAAN,IACAL,QAFmDvJ,IAKnDoL,EAAA1pB,QAAAkqB,GACAhC,IAAAiC,WAEA,OAAAT,GAoFA/B,oBA1GA,SAAA1N,EAAAmQ,GACA,OAAAnQ,EAAAoQ,OACApQ,EAAAoQ,OAEAD,KAAAE,iBACAF,EAAAE,iBAAArQ,EAAAsQ,QAAAtQ,EAAAuQ,cADA,GAuGAzC,mBA3HA,SAAAtR,EAAAjhB,EAAAi1B,GACA,GAAAhU,EAAAoR,QAAAhzB,gBAAAW,EAAAX,cACA,SAEA,IAAA41B,EACA,SAEAhU,EAAA8R,EAAA9R,GACA,QAAArkB,EAAA,EAAiBA,EAAAq4B,EAAAr0B,OAAqBhE,IACtC,GAAAq4B,EAAAr4B,KAAAqkB,EACA,SAGA,UA+GA8R","file":"rollbar.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.named-amd.js b/dist/rollbar.named-amd.js index fa0c6dc49..b92bb4ad7 100644 --- a/dist/rollbar.named-amd.js +++ b/dist/rollbar.named-amd.js @@ -1574,9 +1574,7 @@ Rollbar.prototype.handleAnonymousErrors = function() { } // Workaround to ensure stack is preserved for normal errors. - error.stack; - - return error.toString(); + return error.stack; } // https://v8.dev/docs/stack-trace-api @@ -1777,7 +1775,7 @@ function _gWindow() { /* global __DEFAULT_ENDPOINT__:false */ var defaultOptions = { - version: "2.12.1", + version: "2.12.2", scrubFields: ["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","secret_key","secretKey","secretToken","cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"], logLevel: "debug", reportLevel: "debug", diff --git a/dist/rollbar.named-amd.js.map b/dist/rollbar.named-amd.js.map index c67c70092..197d81faa 100644 --- a/dist/rollbar.named-amd.js.map +++ b/dist/rollbar.named-amd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,EAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;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C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChiBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.named-amd.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":[],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,EAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AC9EA,uBAAuB,mBAAO,CAAC,EAAoB;;AAEnD;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACvHA,cAAc,mBAAO,CAAC,CAAY;;AAElC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;;;;;;ACrBA,aAAa,mBAAO,CAAC,CAAY;AACjC,QAAQ,mBAAO,CAAC,CAAY;AAC5B,UAAU,mBAAO,CAAC,EAAQ;AAC1B,aAAa,mBAAO,CAAC,CAAU;AAC/B,cAAc,mBAAO,CAAC,EAAe;;AAErC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,aAAa,mBAAO,CAAC,CAAO;;AAE5B,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,kBAAkB,mBAAO,CAAC,CAAe;AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC9hBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.named-amd.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.named-amd.min.js b/dist/rollbar.named-amd.min.js index 71dbe52ae..7e41d426e 100644 --- a/dist/rollbar.named-amd.min.js +++ b/dist/rollbar.named-amd.min.js @@ -1,2 +1,2 @@ -define("rollbar",[],function(){return r={},o.m=n=[function(t,e,n){var y=n(10),i={},r=!1;function p(t,e){return e===b(t)}function b(t){var e=typeof t;return"object"!=e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function a(t){return p(t,"function")}function o(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),n=RegExp("^"+e+"$");return s(t)&&n.test(t)}function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function u(t,e,n){var r,o,i,a=p(t,"object"),s=p(t,"array"),u=[];if(a&&-1!==n.indexOf(t))return t;if(n.push(t),a)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&u.push(r);else if(s)for(i=0;it?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;rt?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;r qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":["installedModules","__webpack_require__","m","merge","RollbarJSON","__initRollbarJSON","isType","x","t","typeName","name","Error","toString","call","match","toLowerCase","isFunction","f","isNativeFunction","funcMatchString","Function","prototype","Object","hasOwnProperty","replace","reIsNative","RegExp","isObject","test","value","type","traverse","obj","func","seen","k","v","i","isObj","isArray","keys","indexOf","push","length","result","same","redact","uuid4","d","now","c","r","Math","random","floor","JSON","stringify","parse","setupCustomJSON","parseUriOptions","strictMode","key","q","parser","strict","loose","backup","error","jsonError","backupError","wrapCallback","logger","err","resp","e","TELEMETRY_TYPES","TELEMETRY_LEVELS","arrayIncludes","arr","val","Date","module","exports","addParamsAndAccessTokenToPath","accessToken","options","params","access_token","paramsArray","join","query","sort","path","p","qs","h","substring","createItem","args","notifier","requestKeys","lambdaContext","message","custom","callback","request","arg","extraArgs","l","typ","DOMException","j","len","undefined","item","timestamp","uuid","level","_originalArgs","createTelemetryEvent","metadata","filterIp","requestData","captureIp","newIp","parts","split","pop","beginning","slice","slashIdx","concat","formatArgsAsString","substr","formatUrl","u","protocol","port","hostname","get","handleOptions","current","input","payload","overwriteScrubFields","scrubFields","isError","isIterable","isString","String","jsonParse","s","LEVELS","debug","info","warning","critical","makeUnhandledStackInfo","url","lineno","colno","mode","backupMessage","errorParser","location","line","column","guessFunctionName","context","gatherContext","href","document","useragent","window","navigator","userAgent","stack","sanitizeUrl","baseUrlParts","str","o","exec","uri","$0","$1","$2","parseUri","anchor","source","scrub","data","paramRes","pat","ret","_getScrubFieldRegexs","queryRes","_getScrubQueryParamRegexs","redactQueryParam","dummy0","paramPart","scrubber","tmpV","valScrubber","paramScrubber","set","temp","replacement","detection","_","Array","arguments","unshift","ieVersion","console","apply","log","raw","jsonBackup","selectFrames","frames","range","truncateFrames","body","trace_chain","chain","trace","maybeTruncateValue","truncateStrings","truncator","truncateTraceData","traceData","exception","description","minBody","truncate","maxSize","strategy","results","strategies","bind","shift","last","auth","host","hash","pathname","search","parseInt","pathParts","ErrorStackParser","ERR_CLASS_REGEXP","Frame","stackFrame","_stackFrame","fileName","lineNumber","functionName","columnNumber","Stack","constructor","exc","parserStack","getStack","rawStack","rawException","guessErrorClass","errMsg","errClassMatch","errClass","nested","traceChain","rollbar","_rollbarConfig","alias","globalAlias","shimRunning","shimId","_rollbarStartTime","getTime","Rollbar","_rollbarDidLoad","self","Client","API","globals","transport","urllib","transforms","sharedTransforms","predicates","sharedPredicates","Instrumenter","client","this","defaultOptions","_configuredOptions","api","gWindow","_gWindow","gDocument","isChrome","chrome","runtime","anonymousErrorsPending","addTransform","handleDomException","handleItemWithError","ensureItemHasSomethingToSay","addBaseInfo","addRequestInfo","addClientInfo","addPluginInfo","addBody","addMessageWithError","addTelemetryData","addConfigToPayload","scrubPayload","userTransform","addConfiguredOptions","addDiagnosticKeys","itemToPayload","addTransformsToNotifier","queue","addPredicate","checkLevel","checkIgnore","userCheckIgnore","urlIsNotBlacklisted","urlIsWhitelisted","messageIsIgnored","addPredicatesToQueue","setupUnhandledCapture","instrumenter","telemeter","instrument","_instance","handleUninitialized","maybeCallback","_getFirstFunction","init","global","configure","payloadData","oldOptions","lastError","_createItem","warn","buildJsonPayload","sendJsonPayload","jsonPayload","unhandledExceptionsInitialized","captureUncaught","handleUncaughtExceptions","captureUncaughtExceptions","wrapGlobalEventHandlers","wrapGlobals","unhandledRejectionsInitialized","captureUnhandledRejections","handleUnhandledRejections","handleUncaughtException","inspectAnonymousErrors","stackInfo","_unhandledStackInfo","uncaughtErrorLevel","_isUncaught","handleAnonymousErrors","prepareStackTrace","_stack","_isAnonymous","handleUnhandledRejection","reason","promise","reasonResult","_rollbarContext","wrap","_before","ctxFn","_isWrap","_rollbar_wrapped","_rollbarWrappedError","_wrappedSource","prop","captureEvent","event","captureDomContentLoaded","ts","captureLoad","version","logLevel","reportLevel","endpoint","verbose","enabled","transmit","sendConfig","includeItemsInTelemetry","ignoreDuplicateErrors","RateLimiter","Queue","Notifier","Telemeter","platform","rateLimiter","configureGlobal","setPlatformOptions","lastErrorHash","maxItems","itemsPerMinute","_defaultLogLevel","_log","wait","postJsonPayload","defaultLevel","_sameAsLastError","_captureRollbarItem","telemetryEvents","copyEvents","itemHash","generateItemHash","startTime","counter","perMinCounter","platformOptions","checkRate","limit","ignoreRateLimit","shouldSendValue","shouldSend","globalRateLimit","limitPerMin","perMinute","msg","environment","extra","language","framework","rateLimitPayload","globalSettings","elapsedTime","globalRateLimitPerMin","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copy","clone","gap","indent","meta","rep","state","container","escapes","string","number","action","rx_escapable","n","this_value","valueOf","quote","lastIndex","a","charCodeAt","toJSON","isFinite","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Boolean","Number","\b","\t","\n","\f","\r","\"","\\","replacer","space","holder","partial","mind","","/","b","go","firstokey","okey","ovalue","firstavalue","avalue","{","}","ocomma","[","]","acomma",":","colon","SyntaxError",",","true","false","null","reviver","text","tx","ignore","fromCharCode","walk","pendingItems","pendingRequests","retryQueue","retryHandle","waitCallback","waitIntervalID","predicate","addPendingItem","removePendingItem","idx","splice","addItem","originalError","originalItem","predicateResult","_applyPredicates","stop","_maybeLog","_makeApiRequest","_dequeuePendingRequest","_maybeCallWait","clearInterval","setInterval","rateLimitResponse","postItem","_maybeRetry","RETRIABLE_ERRORS","shouldRetry","retryInterval","code","_retryApiRequest","retryObject","transform","_applyTransforms","transformIndex","transformsLength","cb","maxTelemetryEvents","maxQueueSize","max","min","newMaxEvents","deleteCount","events","filterTelemetry","capture","rollbarUUID","manual","getLevel","timestamp_ms","captureError","captureLog","captureNetwork","subtype","levelFromStatus","status_code","statusCode","captureDom","element","checked","captureNavigation","from","to","captureConnectivityChange","change","helpers","truncation","Api","transportOptions","_getTransport","getTransportFromOptions","buildPayload","post","stringifyResult","contextResult","defaults","proxy","opts","method","appendPathToPath","base","baseTrailingSlash","pathBeginningSlash","con","dummy","properties","methods","Detection","div","createElement","all","getElementsByTagName","innerHTML","undef","_extendListenerPrototype","handler","shim","oldAddEventListener","addEventListener","_rollbarOldAdd","belongsToShim","addFn","bubble","oldRemoveEventListener","removeEventListener","_rollbarOldRemove","removeFn","oldOnError","_rollbarOldOnError","onerror","fn","old","_rollbarWindowOnError","rejectionHandler","evt","detail","_rollbarURH","_makeZoneRequest","requestFactory","currentZone","Zone","_name","_parent","run","_makeRequest","RollbarProxy","json","_msg","_proxyRequest","xmlhttp","factories","XMLHttpRequest","ActiveXObject","numFactories","_createXMLHTTPObject","onreadystatechange","readyState","parseResponse","responseText","status","_isSuccess","_isNormalFailure","_newRetriableError","ex","open","setRequestHeader","send","e1","XDomainRequest","xdomainrequest","onprogress","ontimeout","onload","e2","writeData","addBodyMessage","stackFromItem","buildTrace","guess","class","frame","pre","contextLength","mid","filename","sendFrameUrl","endsWith","reverse","_savedStackTrace","server","remoteString","query_string","user_ip","nav","scr","screen","runtime_ms","round","javascript","browser","cookie_enabled","cookieEnabled","width","height","cur","plugins","navPlugins","traces","traceChainLength","addBodyTraceChain","className","addBodyTrace","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","root","factory","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","_map","array","thisArg","map","output","_filter","filter","stacktrace","parseOpera","parseV8OrIE","parseFFOrSafari","extractLocation","urlLike","locationParts","lastNumber","possibleNumber","isNaN","parseFloat","filtered","tokens","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","argsRaw","functionCall","_isNumber","setFunctionName","setArgs","setFileName","setLineNumber","setColumnNumber","setSource","getFunctionName","getArgs","TypeError","getFileName","getLineNumber","getColumnNumber","getSource","payloadOptions","tracePath","newExtra","newItem","configured_options","diagnostic","is_anonymous","raw_error","constructor_name","failed","settings","matchFrames","list","black","listLength","frameLength","urlIsOnAList","whiteOrBlack","hostBlackList","hostWhiteList","tracesLength","listName","levelVal","isUncaught","onSendCallback","exceptionMessage","ignoredMessages","traceMessage","bodyMessage","urlparser","domUtil","network","networkResponseHeaders","networkResponseBody","networkRequestBody","dom","navigation","connectivity","replacements","orig","restore","_window","_document","autoInstrument","scrubTelemetryInputs","telemetryScrubber","defaultValueScrubber","patterns","attributes","attrs","nameFromDescription","eventRemovers","_location","_lastHref","oldSettings","deinstrumentNetwork","instrumentNetwork","deinstrumentConsole","instrumentConsole","deinstrumentDom","instrumentDom","deinstrumentNavigation","instrumentNavigation","deinstrumentConnectivity","instrumentConnectivity","wrapProp","xhr","xhrp","__rollbar_xhr","start_time_ms","end_time_ms","onreadystatechangeHandler","__rollbar_event","headers","headersConfig","header","allHeaders","getAllResponseHeaders","trim","getResponseHeader","response","then","wrapConsole","origConsole","removeListeners","clickHandler","handleClick","blurHandler","handleBlur","addListener","getElementFromEvent","hasTag","tagName","anchorOrButton","isDescribedElement","captureDomEvent","handleSelectInputChanged","elem","multiple","selected","selectedIndex","isChecked","getElementType","describeElement","elementString","elementArrayToString","treeToArray","app","history","pushState","handleUrlChange","parsedHref","parsedTo","parsedFrom","section","altType","attachEvent","detachEvent","getAttribute","descriptionToString","desc","out","id","classes","attr","nextStr","totalLength","separatorLength","MAX_LENGTH","nextDescription","parentNode","doc","target","elementFromPoint","clientX","clientY","subtypes","getter","defineProperty","enumerable","Symbol","toStringTag","__esModule","ns","create","object","property","moduleId","modules"],"mappings":"sCACAA,EAAA,GA4BAC,EAAAC,qBC7BA,IAAAC,EAAYF,EAAQ,IAEpBG,EAAA,GACAC,GAAA,EAwCA,SAAAC,EAAAC,EAAAC,GACA,OAAAA,IAAAC,EAAAF,GAMA,SAAAE,EAAAF,GACA,IAAAG,SAAAH,EACA,gBAAAG,EACAA,EAEAH,EAGAA,aAAAI,MACA,QAEA,GAAYC,SAAAC,KAAAN,GAAAO,MAAA,oBAAAC,cALZ,OAaA,SAAAC,EAAAC,GACA,OAAAX,EAAAW,EAAA,YAQA,SAAAC,EAAAD,GACA,IACAE,EAAAC,SAAAC,UAAAT,SAAAC,KAAAS,OAAAD,UAAAE,gBACAC,QAFA,sBAEA,QACAA,QAAA,kEACAC,EAAAC,OAAA,IAAAP,EAAA,KACA,OAAAQ,EAAAV,IAAAQ,EAAAG,KAAAX,GAQA,SAAAU,EAAAE,GACA,IAAAC,SAAAD,EACA,aAAAA,IAAA,UAAAC,GAAA,YAAAA,GA6CA,SAAAC,EAAAC,EAAAC,EAAAC,GACA,IAAAC,EAAAC,EAAAC,EACAC,EAAAhC,EAAA0B,EAAA,UACAO,EAAAjC,EAAA0B,EAAA,SACAQ,EAAA,GAEA,GAAAF,IAAA,IAAAJ,EAAAO,QAAAT,GACA,OAAAA,EAIA,GAFAE,EAAAQ,KAAAV,GAEAM,EACA,IAAAH,KAAAH,EACAV,OAAAD,UAAAE,eAAAV,KAAAmB,EAAAG,IACAK,EAAAE,KAAAP,QAGG,GAAAI,EACH,IAAAF,EAAA,EAAeA,EAAAL,EAAAW,SAAgBN,EAC/BG,EAAAE,KAAAL,GAIA,IAAAO,EAAAN,EAAA,G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H,OAAAhC,EAAAgC,IAAqBkL,KAAA,KAAAlL,IACrI,OAAAw0B,GAIAp4B,EAAA0c,EAAA,SAAA1X,GACA,IAAA8yB,EAAA9yB,KAAAmzB,WACA,WAA2B,OAAAnzB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAhF,EAAA+C,EAAA+0B,EAAA,IAAAA,GACAA,GAIA93B,EAAAmL,EAAA,SAAAmtB,EAAAC,GAAsD,OAAAl3B,OAAAD,UAAAE,eAAAV,KAAA03B,EAAAC,IAGtDv4B,EAAA4F,EAAA,GAIA5F,IAAAsJ,EAAA,GA9EA,SAAAtJ,EAAAw4B,GAGA,GAAAz4B,EAAAy4B,GACA,OAAAz4B,EAAAy4B,GAAAvzB,QAGA,IAAAD,EAAAjF,EAAAy4B,GAAA,CACAp2B,EAAAo2B,EACA7xB,GAAA,EACA1B,QAAA,IAUA,OANAwzB,EAAAD,GAAA53B,KAAAoE,EAAAC,QAAAD,IAAAC,QAAAjF,GAGAgF,EAAA2B,GAAA,EAGA3B,EAAAC,cAvBAlF","file":"rollbar.named-amd.min.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.noconflict.umd.js b/dist/rollbar.noconflict.umd.js index ddb288564..32f78da51 100644 --- a/dist/rollbar.noconflict.umd.js +++ b/dist/rollbar.noconflict.umd.js @@ -1569,9 +1569,7 @@ Rollbar.prototype.handleAnonymousErrors = function() { } // Workaround to ensure stack is preserved for normal errors. - error.stack; - - return error.toString(); + return error.stack; } // https://v8.dev/docs/stack-trace-api @@ -1772,7 +1770,7 @@ function _gWindow() { /* global __DEFAULT_ENDPOINT__:false */ var defaultOptions = { - version: "2.12.1", + version: "2.12.2", scrubFields: ["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","secret_key","secretKey","secretToken","cc-number","card number","cardnumber","cardnum","ccnum","ccnumber","cc num","creditcardnumber","credit card number","newcreditcardnumber","new credit card","creditcardno","credit card no","card#","card #","cc-csc","cvc","cvc2","cvv2","ccv2","security code","card verification","name on credit card","name on card","nameoncard","cardholder","card holder","name des karteninhabers","ccname","card type","cardtype","cc type","cctype","payment type","expiration date","expirationdate","expdate","cc-exp","ccmonth","ccyear"], logLevel: "debug", reportLevel: "debug", diff --git a/dist/rollbar.noconflict.umd.js.map b/dist/rollbar.noconflict.umd.js.map index ef90495d0..16640398d 100644 --- a/dist/rollbar.noconflict.umd.js.map +++ b/dist/rollbar.noconflict.umd.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://rollbar/webpack/universalModuleDefinition","webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.noconflict.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,EAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AC9EA,uBAAuB,mBAAO,CAAC,EAAoB;;AAEnD;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACvHA,cAAc,mBAAO,CAAC,CAAY;;AAElC;AACA;AACA;;AAEA;;;;;;;ACNA,aAAa,mBAAO,CAAC,CAAY;AACjC,QAAQ,mBAAO,CAAC,CAAY;AAC5B,UAAU,mBAAO,CAAC,EAAQ;AAC1B,aAAa,mBAAO,CAAC,CAAU;AAC/B,cAAc,mBAAO,CAAC,EAAe;;AAErC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,aAAa,mBAAO,CAAC,CAAO;;AAE5B,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,kBAAkB,mBAAO,CAAC,CAAe;AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChiBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.noconflict.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rollbar\"] = factory();\n\telse\n\t\troot[\"rollbar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/universalModuleDefinition","webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.noconflict.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,EAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA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AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC9hBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.noconflict.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rollbar\"] = factory();\n\telse\n\t\troot[\"rollbar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.noconflict.umd.min.js b/dist/rollbar.noconflict.umd.min.js index de44f7160..48e3ac784 100644 --- a/dist/rollbar.noconflict.umd.min.js +++ b/dist/rollbar.noconflict.umd.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,function(){return r={},o.m=n=[function(t,e,n){var y=n(10),i={},r=!1;function p(t,e){return e===b(t)}function b(t){var e=typeof t;return"object"!=e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function a(t){return p(t,"function")}function o(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),n=RegExp("^"+e+"$");return s(t)&&n.test(t)}function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function u(t,e,n){var r,o,i,a=p(t,"object"),s=p(t,"array"),u=[];if(a&&-1!==n.indexOf(t))return t;if(n.push(t),a)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&u.push(r);else if(s)for(i=0;it?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;rt?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;r qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/universalModuleDefinition","webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.noconflict.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","m","merge","RollbarJSON","__initRollbarJSON","isType","x","t","typeName","name","Error","toString","call","match","toLowerCase","isFunction","f","isNativeFunction","funcMatchString","Function","prototype","Object","hasOwnProperty","replace","reIsNative","RegExp","isObject","test","value","type","traverse","obj","func","seen","k","v","i","isObj","isArray","keys","indexOf","push","length","result","same","redact","uuid4","d","now","c","r","Math","random","floor","JSON","stringify","parse","setupCustomJSON","parseUriOptions","strictMode","key","q","parser","strict","loose","backup","error","jsonError","backupError","wrapCallback","logger","err","resp","e","TELEMETRY_TYPES","TELEMETRY_LEVELS","arrayIncludes","arr","val","Date","addParamsAndAccessTokenToPath","accessToken","options","params","access_token","paramsArray","join","query","sort","path","p","qs","h","substring","createItem","args","notifier","requestKeys","lambdaContext","message","custom","callback","request","arg","extraArgs","l","typ","DOMException","j","len","undefined","item","timestamp","uuid","level","_originalArgs","createTelemetryEvent","metadata","filterIp","requestData","captureIp","newIp","parts","split","pop","beginning","slice","slashIdx","concat","formatArgsAsString","substr","formatUrl","u","protocol","port","hostname","get","handleOptions","current","input","payload","overwriteScrubFields","scrubFields","isError","isIterable","isString","String","jsonParse","s","LEVELS","debug","info","warning","critical","makeUnhandledStackInfo","url","lineno","colno","mode","backupMessage","errorParser","location","line","column","guessFunctionName","context","gatherContext","href","document","useragent","window","navigator","userAgent","stack","sanitizeUrl","baseUrlParts","str","o","exec","uri","$0","$1","$2","parseUri","anchor","source","scrub","data","paramRes","pat","ret","_getScrubFieldRegexs","queryRes","_getScrubQueryParamRegexs","redactQueryParam","dummy0","paramPart","scrubber","tmpV","valScrubber","paramScrubber","set","temp","replacement","detection","_","Array","arguments","unshift","ieVersion","console","apply","log","raw","jsonBackup","selectFrames","frames","range","truncateFrames","body","trace_chain","chain","trace","maybeTruncateValue","truncateStrings","truncator","truncateTraceData","traceData","exception","description","minBody","truncate","maxSize","strategy","results","strategies","bind","shift","last","auth","host","hash","pathname","search","parseInt","pathParts","ErrorStackParser","ERR_CLASS_REGEXP","Frame","stackFrame","_stackFrame","fileName","lineNumber","functionName","columnNumber","Stack","constructor","exc","parserStack","getStack","rawStack","rawException","guessErrorClass","errMsg","errClassMatch","errClass","nested","traceChain","rollbar","_rollbarStartTime","getTime","Client","API","globals","transport","urllib","transforms","sharedTransforms","predicates","sharedPredicates","Instrumenter","Rollbar","client","defaultOptions","_configuredOptions","api","gWindow","_gWindow","gDocument","isChrome","chrome","runtime","anonymousErrorsPending","addTransform","handleDomException","handleItemWithError","ensureItemHasSomethingToSay","addBaseInfo","addRequestInfo","addClientInfo","addPluginInfo","addBody","addMessageWithError","addTelemetryData","addConfigToPayload","scrubPayload","userTransform","addConfiguredOptions","addDiagnosticKeys","itemToPayload","addTransformsToNotifier","queue","addPredicate","checkLevel","checkIgnore","userCheckIgnore","urlIsNotBlacklisted","urlIsWhitelisted","messageIsIgnored","addPredicatesToQueue","setupUnhandledCapture","instrumenter","telemeter","instrument","_instance","handleUninitialized","maybeCallback","_getFirstFunction","self","init","global","configure","payloadData","oldOptions","lastError","_createItem","warn","buildJsonPayload","sendJsonPayload","jsonPayload","unhandledExceptionsInitialized","captureUncaught","handleUncaughtExceptions","captureUncaughtExceptions","wrapGlobalEventHandlers","wrapGlobals","unhandledRejectionsInitialized","captureUnhandledRejections","handleUnhandledRejections","handleUncaughtException","inspectAnonymousErrors","stackInfo","_unhandledStackInfo","uncaughtErrorLevel","_isUncaught","handleAnonymousErrors","prepareStackTrace","_stack","_isAnonymous","handleUnhandledRejection","reason","promise","reasonResult","_rollbarContext","wrap","_before","ctxFn","_isWrap","_rollbar_wrapped","_rollbarWrappedError","_wrappedSource","prop","captureEvent","event","captureDomContentLoaded","ts","captureLoad","version","logLevel","reportLevel","endpoint","verbose","enabled","transmit","sendConfig","includeItemsInTelemetry","ignoreDuplicateErrors","RateLimiter","Queue","Notifier","Telemeter","platform","rateLimiter","configureGlobal","setPlatformOptions","lastErrorHash","maxItems","itemsPerMinute","_defaultLogLevel","_log","wait","postJsonPayload","defaultLevel","_sameAsLastError","_captureRollbarItem","telemetryEvents","copyEvents","itemHash","generateItemHash","startTime","counter","perMinCounter","platformOptions","checkRate","limit","ignoreRateLimit","shouldSendValue","shouldSend","globalRateLimit","limitPerMin","perMinute","msg","environment","extra","language","framework","rateLimitPayload","globalSettings","elapsedTime","globalRateLimitPerMin","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copy","clone","gap","indent","meta","rep","state","container","escapes","string","number","action","rx_escapable","n","this_value","valueOf","quote","lastIndex","a","charCodeAt","toJSON","isFinite","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Boolean","Number","\b","\t","\n","\f","\r","\"","\\","replacer","space","holder","partial","mind","","/","b","go","firstokey","okey","ovalue","firstavalue","avalue","{","}","ocomma","[","]","acomma",":","colon","SyntaxError",",","true","false","null","reviver","text","tx","ignore","fromCharCode","walk","pendingItems","pendingRequests","retryQueue","retryHandle","waitCallback","waitIntervalID","predicate","addPendingItem","removePendingItem","idx","splice","addItem","originalError","originalItem","predicateResult","_applyPredicates","stop","_maybeLog","_makeApiRequest","_dequeuePendingRequest","_maybeCallWait","clearInterval","setInterval","rateLimitResponse","postItem","_maybeRetry","RETRIABLE_ERRORS","shouldRetry","retryInterval","code","_retryApiRequest","retryObject","transform","_applyTransforms","transformIndex","transformsLength","cb","maxTelemetryEvents","maxQueueSize","max","min","newMaxEvents","deleteCount","events","filterTelemetry","capture","rollbarUUID","manual","getLevel","timestamp_ms","captureError","captureLog","captureNetwork","subtype","levelFromStatus","status_code","statusCode","captureDom","element","checked","captureNavigation","from","to","captureConnectivityChange","change","helpers","truncation","Api","transportOptions","_getTransport","getTransportFromOptions","buildPayload","post","stringifyResult","contextResult","defaults","proxy","opts","method","appendPathToPath","base","baseTrailingSlash","pathBeginningSlash","con","dummy","properties","methods","Detection","div","createElement","all","getElementsByTagName","innerHTML","undef","_extendListenerPrototype","handler","shim","oldAddEventListener","addEventListener","_rollbarOldAdd","belongsToShim","addFn","bubble","oldRemoveEventListener","removeEventListener","_rollbarOldRemove","removeFn","oldOnError","_rollbarOldOnError","onerror","fn","old","_rollbarWindowOnError","rejectionHandler","evt","detail","_rollbarURH","_makeZoneRequest","requestFactory","currentZone","Zone","_name","_parent","run","_makeRequest","RollbarProxy","json","_msg","_proxyRequest","xmlhttp","factories","XMLHttpRequest","ActiveXObject","numFactories","_createXMLHTTPObject","onreadystatechange","readyState","parseResponse","responseText","status","_isSuccess","_isNormalFailure","_newRetriableError","ex","open","setRequestHeader","send","e1","XDomainRequest","xdomainrequest","onprogress","ontimeout","onload","e2","writeData","addBodyMessage","stackFromItem","buildTrace","guess","class","frame","pre","contextLength","mid","filename","sendFrameUrl","endsWith","reverse","_savedStackTrace","server","remoteString","query_string","user_ip","nav","scr","screen","runtime_ms","round","javascript","browser","cookie_enabled","cookieEnabled","width","height","cur","plugins","navPlugins","traces","traceChainLength","addBodyTraceChain","className","addBodyTrace","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","_map","array","thisArg","map","output","_filter","filter","stacktrace","parseOpera","parseV8OrIE","parseFFOrSafari","extractLocation","urlLike","locationParts","lastNumber","possibleNumber","isNaN","parseFloat","filtered","tokens","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","argsRaw","functionCall","_isNumber","setFunctionName","setArgs","setFileName","setLineNumber","setColumnNumber","setSource","getFunctionName","getArgs","TypeError","getFileName","getLineNumber","getColumnNumber","getSource","payloadOptions","tracePath","newExtra","newItem","configured_options","diagnostic","is_anonymous","raw_error","constructor_name","failed","settings","matchFrames","list","black","listLength","frameLength","urlIsOnAList","whiteOrBlack","hostBlackList","hostWhiteList","tracesLength","listName","levelVal","isUncaught","onSendCallback","exceptionMessage","ignoredMessages","traceMessage","bodyMessage","urlparser","domUtil","network","networkResponseHeaders","networkResponseBody","networkRequestBody","dom","navigation","connectivity","replacements","orig","restore","_window","_document","autoInstrument","scrubTelemetryInputs","telemetryScrubber","defaultValueScrubber","patterns","attributes","attrs","nameFromDescription","eventRemovers","_location","_lastHref","oldSettings","deinstrumentNetwork","instrumentNetwork","deinstrumentConsole","instrumentConsole","deinstrumentDom","instrumentDom","deinstrumentNavigation","instrumentNavigation","deinstrumentConnectivity","instrumentConnectivity","wrapProp","xhr","xhrp","__rollbar_xhr","start_time_ms","end_time_ms","onreadystatechangeHandler","__rollbar_event","headers","headersConfig","header","allHeaders","getAllResponseHeaders","trim","getResponseHeader","response","then","wrapConsole","origConsole","removeListeners","clickHandler","handleClick","blurHandler","handleBlur","addListener","getElementFromEvent","hasTag","tagName","anchorOrButton","isDescribedElement","captureDomEvent","handleSelectInputChanged","elem","multiple","selected","selectedIndex","isChecked","getElementType","describeElement","elementString","elementArrayToString","treeToArray","app","history","pushState","handleUrlChange","parsedHref","parsedTo","parsedFrom","section","altType","attachEvent","detachEvent","getAttribute","descriptionToString","desc","out","id","classes","attr","nextStr","totalLength","separatorLength","MAX_LENGTH","nextDescription","parentNode","doc","target","elementFromPoint","clientX","clientY","subtypes","getter","defineProperty","enumerable","Symbol","toStringTag","__esModule","ns","create","object","property","moduleId","modules"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,IARA,CASCK,KAAA,WACD,OCTAC,EAAA,GA4BAC,EAAAC,qBC7BA,IAAAC,EAAYF,EAAQ,IAEpBG,EAAA,GACAC,GAAA,EAwCA,SAAAC,EAAAC,EAAAC,GACA,OAAAA,IAAAC,EAAAF,GAMA,SAAAE,EAAAF,GACA,IAAAG,SAAAH,EACA,gBAAAG,EACAA,EAEAH,EAGAA,aAAAI,MACA,QAEA,GAAYC,SAAAC,KAAAN,GAAAO,MAAA,oBAAAC,cALZ,OAaA,SAAAC,EAAAC,GACA,OAAAX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,OAAA+1B,eAAA13B,EAAA43B,OAAAC,YAAA,CAAwD31B,MAAA,WAExDP,OAAA+1B,eAAA13B,EAAA,cAAiDkC,OAAA,KAQjD5B,EAAAO,EAAA,SAAAqB,EAAAkI,GAEA,GADA,EAAAA,IAAAlI,EAAA5B,EAAA4B,IACA,EAAAkI,EAAA,OAAAlI,EACA,KAAAkI,GAAA,iBAAAlI,QAAA41B,WAAA,OAAA51B,EACA,IAAA61B,EAAAp2B,OAAAq2B,OAAA,MAGA,GAFA13B,EAAAkD,EAAAu0B,GACAp2B,OAAA+1B,eAAAK,EAAA,WAAyCJ,YAAA,EAAAz1B,UACzC,EAAAkI,GAAA,iBAAAlI,EAAA,QAAAgC,KAAAhC,EAAA5B,EAAA+C,EAAA00B,EAAA7zB,EAAA,SAAAA,GAAgH,OAAAhC,EAAAgC,IAAqBgL,KAAA,KAAAhL,IACrI,OAAA6zB,GAIAz3B,EAAAic,EAAA,SAAAtc,GACA,IAAAw3B,EAAAx3B,KAAA63B,WACA,WAA2B,OAAA73B,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAK,EAAA+C,EAAAo0B,EAAA,IAAAA,GACAA,GAIAn3B,EAAAiL,EAAA,SAAA0sB,EAAAC,GAAsD,OAAAv2B,OAAAD,UAAAE,eAAAV,KAAA+2B,EAAAC,IAGtD53B,EAAA0F,EAAA,GAIA1F,IAAAoJ,EAAA,GA9EA,SAAApJ,EAAA63B,GAGA,GAAA93B,EAAA83B,GACA,OAAA93B,EAAA83B,GAAAn4B,QAGA,IAAAC,EAAAI,EAAA83B,GAAA,CACAz1B,EAAAy1B,EACApxB,GAAA,EACA/G,QAAA,IAUA,OANAo4B,EAAAD,GAAAj3B,KAAAjB,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAA8G,GAAA,EAGA9G,EAAAD,cAvBAK","file":"rollbar.noconflict.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rollbar\"] = factory();\n\telse\n\t\troot[\"rollbar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.snippet.js b/dist/rollbar.snippet.js index a3a7d032b..071814dd0 100644 --- a/dist/rollbar.snippet.js +++ b/dist/rollbar.snippet.js @@ -1 +1 @@ -!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.12.1/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/universalModuleDefinition","webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCAAiC;AAC1E,wHAAgH,mBAAmB,EAAE;AACrI;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;;AAGA;AACA;;;;;;;AClFA,YAAY,mBAAO,CAAC,EAAS;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B,mBAAO,CAAC,EAA4B;AAC9D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH,eAAe,gBAAgB;AAC/B;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA,aAAa,iBAAiB;AAC9B;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mCAAmC,OAAO;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,kCAAkC,OAAO;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,wCAAwC,SAAS,UAAU,YAAY,GAAG;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,qBAAqB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gCAAgC,SAAS;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACluBA;AACA,mBAAO,CAAC,EAAkB;AAC1B,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACzCA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;AC9EA,uBAAuB,mBAAO,CAAC,EAAoB;;AAEnD;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;;;AAGA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA,mBAAmB,wBAAwB;AAC3C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACvHA,cAAc,mBAAO,CAAC,CAAY;;AAElC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;;;;;;;ACrBA,aAAa,mBAAO,CAAC,CAAY;AACjC,QAAQ,mBAAO,CAAC,CAAY;AAC5B,UAAU,mBAAO,CAAC,EAAQ;AAC1B,aAAa,mBAAO,CAAC,CAAU;AAC/B,cAAc,mBAAO,CAAC,EAAe;;AAErC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,aAAa,mBAAO,CAAC,CAAO;;AAE5B,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,iBAAiB,mBAAO,CAAC,EAAc;AACvC,uBAAuB,mBAAO,CAAC,EAAe;AAC9C,kBAAkB,mBAAO,CAAC,CAAe;AACzC,mBAAmB,mBAAO,CAAC,EAAa;;AAExC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,2DAA2D;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,6CAA6C;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,0BAA0B,sBAAsB;AAChD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,oCAAoC,SAAS;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW,QAAoB;AAC/B,eAAe,0sBAAgC;AAC/C,YAAY,OAAqB;AACjC,eAAe,OAAwB;AACvC,sBAAsB,OAA8B;AACpD,YAAY,6BAAoB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC9hBA,kBAAkB,mBAAO,CAAC,CAAe;AACzC,YAAY,mBAAO,CAAC,EAAS;AAC7B,eAAe,mBAAO,CAAC,EAAY;AACnC,gBAAgB,mBAAO,CAAC,EAAa;AACrC,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,6BAA6B;AAC7B;AACA;;AAEA;;;;;;;ACzJA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;AC9Ia;;AAEb;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;;AAEnB;AACA;;AAEA;AACA;AACA,iBAAiB;AACjB;AACA;;AAEA,WAAW,YAAY;AACvB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE;AACzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,oBAAoB;AACpB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,yCAAyC,iBAAiB;AAC1D,8BAA8B,kBAAkB;;AAEhD,yCAAyC,iBAAiB;AAC1D,sCAAsC,6BAA6B;;AAEnE;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AACrD;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,wBAAwB;AACxB,+CAA+C,EAAE;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;;AAGA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;;AAGA;;AAEA;;AAEA,UAAU;AACV,UAAU;AACV,UAAU;AACV;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,YAAY;AACjC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,eAAe;AACf;AACA,cAAc,wDAAwD;AACtE,cAAc,0BAA0B;AACxC;AACA;AACA;AACA;;AAEA;;AAEA;AACA,YAAY;AACZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,mBAAmB,WAAW;AAC9B;AACA;;AAEA;;AAEA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,sBAAsB,UAAU;AAChC;AACA;;;AAGA;;AAEA;AACA;;AAEA;AACA;;AAEA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAgB;AAChB,oBAAoB;AACpB,cAAc;AACd,gBAAgB;AAChB,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,oBAAoB;AACpB;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,UAAU;AACV;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,wBAAwB,YAAY;AACpC;AACA;AACA,WAAW;AACX;AACA,wBAAwB,gDAAgD;AACxE;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA,WAAW;AACX;AACA,wBAAwB,sCAAsC;AAC9D;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA,sCAAsC,EAAE;AACxC;AACA;AACA;AACA,SAAS;AACT;;AAEA;;AAEA;AACA;;AAEA;AACA,+CAA+C,yGAAyG,EAAE;;AAE1J;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA,aAAa;;AAEb;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,SAAS;AACT;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA,WAAW,EAAE,UAAU;AACvB;AACA;AACA,KAAK;AACL;AACA;;AAEA;;;;;;;AC1vBA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD,WAAW;AACnE;AACA;AACA,eAAe,WAAW;AAC1B,eAAe,eAAe;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,QAAQ;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,aAAa,8BAA8B;AAC3C;AACA;AACA;AACA;AACA,+CAA+C,SAAS;AACxD;AACA;AACA,cAAc;AACd;AACA;AACA,UAAU;AACV;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kDAAkD,SAAS;AAC3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,wBAAwB,+BAA+B;;AAEvD;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrQA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;;;;;;;ACrHA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qCAAqC,mBAAmB;AACxD;;AAEA;AACA,qCAAqC,4BAA4B;AACjE;AACA;AACA,8BAA8B,4BAA4B;AAC1D;AACA;AACA;AACA,qCAAqC,gBAAgB;AACrD;AACA;AACA,8BAA8B,gBAAgB;AAC9C;AACA;;AAEA;AACA,8BAA8B,aAAa;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AChLA,QAAQ,mBAAO,CAAC,CAAW;AAC3B,cAAc,mBAAO,CAAC,EAAc;AACpC,iBAAiB,mBAAO,CAAC,CAAc;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC/FA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACvFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;AClBD;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;AC7BA;AACA,gBAAgB,QAAQ;AACxB;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC;AAClC;AACA;;AAEA;AACA,gBAAgB,QAAQ;;AAExB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gBAAgB,QAAQ;AACxB;AACA;AACA;AACA,aAAa,oBAAoB;AACjC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACxIA;;AAEA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,iBAAiB,mBAAO,CAAC,CAAe;AACxC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAoB,mBAAmB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,kBAAkB;AAC/B;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AC3PA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,kBAAkB,mBAAO,CAAC,CAAe;AACzC,aAAa,mBAAO,CAAC,CAAU;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,OAAO;AAC7C;AACA,oBAAoB,6CAA6C;AACjE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,gBAAgB;AAC5C;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,sBAAsB;AACvC;AACA;AACA;;AAEA,4BAA4B,oBAAoB;AAChD;AACA;;AAEA;AACA;;AAEA;AACA;AACA,8BAA8B,aAAa;AAC3C;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe,kBAAkB;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC1SA;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAA6B,CAAC,uBAAY,CAAC,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AAC7D,KAAK,MAAM,EAIN;AACL,CAAC;AACD;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;;AAEA,+CAA+C,SAAS;AACxD;AACA;AACA;AACA;AACA;;AAEA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;;;;;;;;AC/LD;AACA;AACA;;AAEA;AACA,QAAQ,IAA0C;AAClD,QAAQ,iCAAqB,EAAE,oCAAE,OAAO;AAAA;AAAA;AAAA,oGAAC;AACzC,KAAK,MAAM,EAIN;AACL,CAAC;AACD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA;AACA,SAAS;;AAET;AACA,2DAA2D,UAAU;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;;;;;;AC1GD,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oCAAoC,sBAAsB;AAC1D;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,8BAA8B;AAC9B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACtHA,QAAQ,mBAAO,CAAC,CAAY;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;;;;;ACXA,QAAQ,mBAAO,CAAC,CAAW;;AAE3B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,eAAe;;AAEf;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA,iBAAiB,iBAAiB;AAClC;AACA;;AAEA,wCAAwC,eAAe;;AAEvD,mBAAmB,gBAAgB;AACnC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,mBAAmB,kBAAkB;AACrC;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,iBAAiB,SAAS;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC5KA,QAAQ,mBAAO,CAAC,CAAY;AAC5B,gBAAgB,mBAAO,CAAC,CAAO;AAC/B,cAAc,mBAAO,CAAC,EAAc;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,gDAAgD,aAAa;AAC7D;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA,gBAAgB,cAAc;AAC9B,mBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,gBAAgB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,SAAS;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf,6BAA6B,0BAA0B;AACvD;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,SAAS;AAC5C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,yBAAyB;AAC5C;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACnlBA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,qBAAqB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,sBAAsB,6BAA6B;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,4BAA4B,QAAQ;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB,4BAA4B;AAC7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,uBAAuB;AACpC;AACA;AACA;AACA,2BAA2B,sBAAsB;AACjD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"rollbar.umd.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rollbar\"] = factory();\n\telse\n\t\troot[\"rollbar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/rollbar.umd.min.js b/dist/rollbar.umd.min.js index 6cfa70b80..469cda029 100644 --- a/dist/rollbar.umd.min.js +++ b/dist/rollbar.umd.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.rollbar=e():t.rollbar=e()}(this,function(){return r={},o.m=n=[function(t,e,n){var y=n(10),i={},r=!1;function p(t,e){return e===b(t)}function b(t){var e=typeof t;return"object"!=e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function a(t){return p(t,"function")}function o(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),n=RegExp("^"+e+"$");return s(t)&&n.test(t)}function s(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function u(t,e,n){var r,o,i,a=p(t,"object"),s=p(t,"array"),u=[];if(a&&-1!==n.indexOf(t))return t;if(n.push(t),a)for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&u.push(r);else if(s)for(i=0;it?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;rt?e.slice(0,t-3).concat("..."):e}function p(o,t,e){return[t=s.traverse(t,function t(e,n,r){switch(s.typeName(n)){case"string":return i(o,n);case"object":case"array":return s.traverse(n,t,r);default:return n}},[]),s.stringify(t,e)]}function a(t){return t.exception&&(delete t.exception.description,t.exception.message=i(255,t.exception.message)),t.frames=u(t.frames,1),t}function f(t,e){var n=t.data.body;if(n.trace_chain)for(var r=n.trace_chain,o=0;os)))return i;return i},raw:c,truncateFrames:l,truncateStrings:p,maybeTruncateValue:i}},function(t,e){t.exports={parse:function(t){var e,n,r={protocol:null,auth:null,host:null,path:null,hash:null,href:t,hostname:null,port:null,pathname:null,search:null,query:null};if(n=-1!==(e=t.indexOf("//"))?(r.protocol=t.substring(0,e),e+2):0,-1!==(e=t.indexOf("@",n))&&(r.auth=t.substring(n,e),n=e+1),-1===(e=t.indexOf("/",n))){if(-1===(e=t.indexOf("?",n)))return-1===(e=t.indexOf("#",n))?r.host=t.substring(n):(r.host=t.substring(n,e),r.hash=t.substring(e)),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),r;r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e}else r.host=t.substring(n,e),r.hostname=r.host.split(":")[0],r.port=r.host.split(":")[1],r.port&&(r.port=parseInt(r.port,10)),n=e;if(-1===(e=t.indexOf("#",n))?r.path=t.substring(n):(r.path=t.substring(n,e),r.hash=t.substring(e)),r.path){var o=r.path.split("?");r.pathname=o[0],r.query=o[1],r.search=r.query?"?"+r.query:null}return r}}},function(t,e,n){var i=n(22),r=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function o(){return null}function a(t){var e={};return e._stackFrame=t,e.url=t.fileName,e.line=t.lineNumber,e.func=t.functionName,e.column=t.columnNumber,e.args=t.args,e.context=null,e}function s(o){var t=o.constructor&&o.constructor.name;return t&&t.length&&!(t.length<3)||(t=o.name),{stack:function(){var e,n=[];if(o.stack)e=o;else try{throw o}catch(t){e=t}try{n=i.parse(e)}catch(t){n=[]}for(var t=[],r=0;rr&&(o=this.maxQueueSize-r),this.maxQueueSize=r,this.queue.splice(0,o)},r.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(a.isFunction(this.options.filterTelemetry))try{for(var e=t.length;e--;)this.options.filterTelemetry(t[e])&&t.splice(e,1)}catch(t){this.options.filterTelemetry=null}return t},r.prototype.capture=function(t,e,n,r,o){var i={level:function(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}(t,n),type:t,timestamp_ms:o||a.now(),body:e,source:"client"};r&&(i.uuid=r);try{if(a.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(i))return!1}catch(t){this.options.filterTelemetry=null}return this.push(i),i},r.prototype.captureEvent=function(t,e,n,r){return this.capture(t,e,n,r)},r.prototype.captureError=function(t,e,n,r){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,n,r)},r.prototype.captureLog=function(t,e,n,r){return this.capture("log",{message:t},e,n,r)},r.prototype.captureNetwork=function(t,e,n,r){e=e||"xhr",t.subtype=t.subtype||e,r&&(t.request=r);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,n)},r.prototype.levelFromStatus=function(t){return 200<=t&&t<400?"info":0===t||400<=t?"error":"info"},r.prototype.captureDom=function(t,e,n,r,o){var i={subtype:t,element:e};return void 0!==n&&(i.value=n),void 0!==r&&(i.checked=r),this.capture("dom",i,"info",o)},r.prototype.captureNavigation=function(t,e,n){return this.capture("navigation",{from:t,to:e},"info",n)},r.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},r.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},r.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},r.prototype._captureRollbarItem=function(t){if(this.options.includeItemsInTelemetry)return t.err?this.captureError(t.err,t.level,t.uuid,t.timestamp):t.message?this.captureLog(t.message,t.level,t.uuid,t.timestamp):t.custom?this.capture("log",t.custom,t.level,t.uuid,t.timestamp):void 0},r.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=r},function(t,e,n){var r=n(0),o=n(16),i=n(2),a={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,n,r){this.options=t,this.transport=e,this.url=n,this.jsonBackup=r,this.accessToken=t.accessToken,this.transportOptions=u(t,n)}function u(t,e){return o.getTransportFromOptions(t,a,e)}s.prototype.postItem=function(t,e){var n=o.transportOptions(this.transportOptions,"POST"),r=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,n,r,e)},s.prototype.buildJsonPayload=function(t,e){var n=o.buildPayload(this.accessToken,t,this.jsonBackup),r=i.truncate(n);return r.error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var n=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,n,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=r.merge(e,t),this.transportOptions=u(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,n){var o=n(0);t.exports={buildPayload:function(t,e,n){if(!o.isType(e.context,"string")){var r=o.stringify(e.context,n);r.error?e.context="Error: could not serialize 'context'":e.context=r.value||"",255 eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new s(t);var e=t.split("@"),n=this.extractLocation(e.pop()),r=e.shift()||void 0;return new s(r,void 0,n[0],n[1],n[2],t)},this)},parseOpera:function(t){return!t.stacktrace||-1t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(t){for(var e=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),r=[],o=2,i=n.length;o/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(e=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var a=void 0===e||"[arguments not available]"===e?void 0:e.split(",");return new s(i,a,r[0],r[1],r[2],t)},this)}}})?i.apply(r,a):i)||(n.exports=s)}()},function(n,r,t){var o,i,a;!function(t,e){"use strict";i=[],void 0===(a="function"==typeof(o=function(){function e(t){return!isNaN(parseFloat(t))&&isFinite(t)}function t(t,e,n,r,o,i){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==o&&this.setColumnNumber(o),void 0!==i&&this.setSource(i)}return t.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(t){if(!e(t))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(t)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(t){if(!e(t))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(t)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+"("+(this.getArgs()||[]).join(",")+")"+(this.getFileName()?"@"+this.getFileName():"")+(e(this.getLineNumber())?":"+this.getLineNumber():"")+(e(this.getColumnNumber())?":"+this.getColumnNumber():"")}},t})?o.apply(r,i):o)||(n.exports=a)}()},function(t,e,n){var s=n(0);t.exports={itemToPayload:function(t,e,n){var r=e.payload||{};r.body&&delete r.body;var o=s.merge(t.data,r);t._isUncaught&&(o._isUncaught=!0),t._originalArgs&&(o._originalArgs=t._originalArgs),n(null,o)},addTelemetryData:function(t,e,n){t.telemetryEvents&&s.set(t,"data.body.telemetry",t.telemetryEvents),n(null,t)},addMessageWithError:function(t,e,n){if(t.message){var r="data.body.trace_chain.0",o=s.get(t,r);if(o||(r="data.body.trace",o=s.get(t,r)),o){if(!o.exception||!o.exception.description)return s.set(t,r+".exception.description",t.message),void n(null,t);var i=s.get(t,r+".extra")||{},a=s.merge(i,{message:t.message});s.set(t,r+".extra",a)}n(null,t)}else n(null,t)},userTransform:function(o){return function(e,n,r){var t=s.merge(e);try{s.isFunction(n.transform)&&n.transform(t.data,e)}catch(t){return n.transform=null,o.error("Error while calling custom transform() function. Removing custom transform().",t),void r(null,e)}r(null,t)}},addConfigToPayload:function(t,e,n){if(!e.sendConfig)return n(null,t);var r=s.get(t,"data.custom")||{};r._rollbarConfig=e,t.data.custom=r,n(null,t)},addConfiguredOptions:function(t,e,n){delete e._configuredOptions.accessToken,t.data.notifier.configured_options=e._configuredOptions,n(null,t)},addDiagnosticKeys:function(t,e,n){var r={};if(s.get(t,"err._isAnonymous")&&(r.is_anonymous=!0),t.err)try{r.raw_error={message:t.err.message,name:t.err.name,constructor_name:t.err.constructor&&t.err.constructor.name,filename:t.err.fileName,line:t.err.lineNumber,column:t.err.columnNumber,stack:t.err.stack}}catch(t){r.raw_error={failed:String(t)}}t.data.notifier.diagnostic=s.merge(t.data.notifier.diagnostic,r),n(null,t)}}},function(t,e,n){var r=n(0);t.exports={checkIgnore:function(t,e){return!r.get(e,"plugins.jquery.ignoreAjaxErrors")||!r.get(t,"body.message.extra.isAjax")}}},function(t,e,n){var p=n(0);function l(t,e,n){if(!t)return!n;var r,o,i=t.frames;if(!i||0===i.length)return!n;for(var a=e.length,s=i.length,u=0;u ")},treeToArray:function(t){for(var e,n=[],r=0;t&&r<5&&"html"!==(e=i(t)).tagName;r++)n.unshift(e),t=t.parentNode;return n},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,n){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!n)return!0;t=o(t);for(var r=0;r qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n error.stack;\n\n return error.toString();\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://rollbar/webpack/universalModuleDefinition","webpack://rollbar/webpack/bootstrap","webpack://rollbar/./src/utility.js","webpack://rollbar/./src/browser/logger.js","webpack://rollbar/./src/truncation.js","webpack://rollbar/./src/browser/url.js","webpack://rollbar/./src/browser/errorParser.js","webpack://rollbar/./src/browser/bundles/rollbar.js","webpack://rollbar/./src/browser/rollbar.js","webpack://rollbar/./src/rollbar.js","webpack://rollbar/./src/rateLimiter.js","webpack://rollbar/./src/merge.js","webpack://rollbar/./vendor/JSON-js/json3.js","webpack://rollbar/./src/queue.js","webpack://rollbar/./src/notifier.js","webpack://rollbar/./src/telemetry.js","webpack://rollbar/./src/api.js","webpack://rollbar/./src/apiUtility.js","webpack://rollbar/./node_modules/console-polyfill/index.js","webpack://rollbar/./src/browser/detection.js","webpack://rollbar/./src/browser/globalSetup.js","webpack://rollbar/./src/browser/transport.js","webpack://rollbar/./src/browser/transforms.js","webpack://rollbar/./node_modules/error-stack-parser/error-stack-parser.js","webpack://rollbar/./node_modules/error-stack-parser/node_modules/stackframe/stackframe.js","webpack://rollbar/./src/transforms.js","webpack://rollbar/./src/browser/predicates.js","webpack://rollbar/./src/predicates.js","webpack://rollbar/./src/browser/telemetry.js","webpack://rollbar/./src/browser/domUtility.js"],"names":["root","factory","exports","module","define","amd","this","installedModules","__webpack_require__","m","merge","RollbarJSON","__initRollbarJSON","isType","x","t","typeName","name","Error","toString","call","match","toLowerCase","isFunction","f","isNativeFunction","funcMatchString","Function","prototype","Object","hasOwnProperty","replace","reIsNative","RegExp","isObject","test","value","type","traverse","obj","func","seen","k","v","i","isObj","isArray","keys","indexOf","push","length","result","same","redact","uuid4","d","now","c","r","Math","random","floor","JSON","stringify","parse","setupCustomJSON","parseUriOptions","strictMode","key","q","parser","strict","loose","backup","error","jsonError","backupError","wrapCallback","logger","err","resp","e","TELEMETRY_TYPES","TELEMETRY_LEVELS","arrayIncludes","arr","val","Date","addParamsAndAccessTokenToPath","accessToken","options","params","access_token","paramsArray","join","query","sort","path","p","qs","h","substring","createItem","args","notifier","requestKeys","lambdaContext","message","custom","callback","request","arg","extraArgs","l","typ","DOMException","j","len","undefined","item","timestamp","uuid","level","_originalArgs","createTelemetryEvent","metadata","filterIp","requestData","captureIp","newIp","parts","split","pop","beginning","slice","slashIdx","concat","formatArgsAsString","substr","formatUrl","u","protocol","port","hostname","get","handleOptions","current","input","payload","overwriteScrubFields","scrubFields","isError","isIterable","isString","String","jsonParse","s","LEVELS","debug","info","warning","critical","makeUnhandledStackInfo","url","lineno","colno","mode","backupMessage","errorParser","location","line","column","guessFunctionName","context","gatherContext","href","document","useragent","window","navigator","userAgent","stack","sanitizeUrl","baseUrlParts","str","o","exec","uri","$0","$1","$2","parseUri","anchor","source","scrub","data","paramRes","pat","ret","_getScrubFieldRegexs","queryRes","_getScrubQueryParamRegexs","redactQueryParam","dummy0","paramPart","scrubber","tmpV","valScrubber","paramScrubber","set","temp","replacement","detection","_","Array","arguments","unshift","ieVersion","console","apply","log","raw","jsonBackup","selectFrames","frames","range","truncateFrames","body","trace_chain","chain","trace","maybeTruncateValue","truncateStrings","truncator","truncateTraceData","traceData","exception","description","minBody","truncate","maxSize","strategy","results","strategies","bind","shift","last","auth","host","hash","pathname","search","parseInt","pathParts","ErrorStackParser","ERR_CLASS_REGEXP","Frame","stackFrame","_stackFrame","fileName","lineNumber","functionName","columnNumber","Stack","constructor","exc","parserStack","getStack","rawStack","rawException","guessErrorClass","errMsg","errClassMatch","errClass","nested","traceChain","rollbar","_rollbarConfig","alias","globalAlias","shimRunning","shimId","_rollbarStartTime","getTime","Rollbar","_rollbarDidLoad","self","Client","API","globals","transport","urllib","transforms","sharedTransforms","predicates","sharedPredicates","Instrumenter","client","defaultOptions","_configuredOptions","api","gWindow","_gWindow","gDocument","isChrome","chrome","runtime","anonymousErrorsPending","addTransform","handleDomException","handleItemWithError","ensureItemHasSomethingToSay","addBaseInfo","addRequestInfo","addClientInfo","addPluginInfo","addBody","addMessageWithError","addTelemetryData","addConfigToPayload","scrubPayload","userTransform","addConfiguredOptions","addDiagnosticKeys","itemToPayload","addTransformsToNotifier","queue","addPredicate","checkLevel","checkIgnore","userCheckIgnore","urlIsNotBlacklisted","urlIsWhitelisted","messageIsIgnored","addPredicatesToQueue","setupUnhandledCapture","instrumenter","telemeter","instrument","_instance","handleUninitialized","maybeCallback","_getFirstFunction","init","global","configure","payloadData","oldOptions","lastError","_createItem","warn","buildJsonPayload","sendJsonPayload","jsonPayload","unhandledExceptionsInitialized","captureUncaught","handleUncaughtExceptions","captureUncaughtExceptions","wrapGlobalEventHandlers","wrapGlobals","unhandledRejectionsInitialized","captureUnhandledRejections","handleUnhandledRejections","handleUncaughtException","inspectAnonymousErrors","stackInfo","_unhandledStackInfo","uncaughtErrorLevel","_isUncaught","handleAnonymousErrors","prepareStackTrace","_stack","_isAnonymous","handleUnhandledRejection","reason","promise","reasonResult","_rollbarContext","wrap","_before","ctxFn","_isWrap","_rollbar_wrapped","_rollbarWrappedError","_wrappedSource","prop","captureEvent","event","captureDomContentLoaded","ts","captureLoad","version","logLevel","reportLevel","endpoint","verbose","enabled","transmit","sendConfig","includeItemsInTelemetry","ignoreDuplicateErrors","RateLimiter","Queue","Notifier","Telemeter","platform","rateLimiter","configureGlobal","setPlatformOptions","lastErrorHash","maxItems","itemsPerMinute","_defaultLogLevel","_log","wait","postJsonPayload","defaultLevel","_sameAsLastError","_captureRollbarItem","telemetryEvents","copyEvents","itemHash","generateItemHash","startTime","counter","perMinCounter","platformOptions","checkRate","limit","ignoreRateLimit","shouldSendValue","shouldSend","globalRateLimit","limitPerMin","perMinute","msg","environment","extra","language","framework","rateLimitPayload","globalSettings","elapsedTime","globalRateLimitPerMin","hasOwn","toStr","isPlainObject","hasOwnConstructor","hasIsPrototypeOf","src","copy","clone","gap","indent","meta","rep","state","container","escapes","string","number","action","rx_escapable","n","this_value","valueOf","quote","lastIndex","a","charCodeAt","toJSON","isFinite","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","Boolean","Number","\b","\t","\n","\f","\r","\"","\\","replacer","space","holder","partial","mind","","/","b","go","firstokey","okey","ovalue","firstavalue","avalue","{","}","ocomma","[","]","acomma",":","colon","SyntaxError",",","true","false","null","reviver","text","tx","ignore","fromCharCode","walk","pendingItems","pendingRequests","retryQueue","retryHandle","waitCallback","waitIntervalID","predicate","addPendingItem","removePendingItem","idx","splice","addItem","originalError","originalItem","predicateResult","_applyPredicates","stop","_maybeLog","_makeApiRequest","_dequeuePendingRequest","_maybeCallWait","clearInterval","setInterval","rateLimitResponse","postItem","_maybeRetry","RETRIABLE_ERRORS","shouldRetry","retryInterval","code","_retryApiRequest","retryObject","transform","_applyTransforms","transformIndex","transformsLength","cb","maxTelemetryEvents","maxQueueSize","max","min","newMaxEvents","deleteCount","events","filterTelemetry","capture","rollbarUUID","manual","getLevel","timestamp_ms","captureError","captureLog","captureNetwork","subtype","levelFromStatus","status_code","statusCode","captureDom","element","checked","captureNavigation","from","to","captureConnectivityChange","change","helpers","truncation","Api","transportOptions","_getTransport","getTransportFromOptions","buildPayload","post","stringifyResult","contextResult","defaults","proxy","opts","method","appendPathToPath","base","baseTrailingSlash","pathBeginningSlash","con","dummy","properties","methods","Detection","div","createElement","all","getElementsByTagName","innerHTML","undef","_extendListenerPrototype","handler","shim","oldAddEventListener","addEventListener","_rollbarOldAdd","belongsToShim","addFn","bubble","oldRemoveEventListener","removeEventListener","_rollbarOldRemove","removeFn","oldOnError","_rollbarOldOnError","onerror","fn","old","_rollbarWindowOnError","rejectionHandler","evt","detail","_rollbarURH","_makeZoneRequest","requestFactory","currentZone","Zone","_name","_parent","run","_makeRequest","RollbarProxy","json","_msg","_proxyRequest","xmlhttp","factories","XMLHttpRequest","ActiveXObject","numFactories","_createXMLHTTPObject","onreadystatechange","readyState","parseResponse","responseText","status","_isSuccess","_isNormalFailure","_newRetriableError","ex","open","setRequestHeader","send","e1","XDomainRequest","xdomainrequest","onprogress","ontimeout","onload","e2","writeData","addBodyMessage","stackFromItem","buildTrace","guess","class","frame","pre","contextLength","mid","filename","sendFrameUrl","endsWith","reverse","_savedStackTrace","server","remoteString","query_string","user_ip","nav","scr","screen","runtime_ms","round","javascript","browser","cookie_enabled","cookieEnabled","width","height","cur","plugins","navPlugins","traces","traceChainLength","addBodyTraceChain","className","addBodyTrace","__WEBPACK_AMD_DEFINE_FACTORY__","__WEBPACK_AMD_DEFINE_ARRAY__","__WEBPACK_AMD_DEFINE_RESULT__","StackFrame","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","_map","array","thisArg","map","output","_filter","filter","stacktrace","parseOpera","parseV8OrIE","parseFFOrSafari","extractLocation","urlLike","locationParts","lastNumber","possibleNumber","isNaN","parseFloat","filtered","tokens","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","argsRaw","functionCall","_isNumber","setFunctionName","setArgs","setFileName","setLineNumber","setColumnNumber","setSource","getFunctionName","getArgs","TypeError","getFileName","getLineNumber","getColumnNumber","getSource","payloadOptions","tracePath","newExtra","newItem","configured_options","diagnostic","is_anonymous","raw_error","constructor_name","failed","settings","matchFrames","list","black","listLength","frameLength","urlIsOnAList","whiteOrBlack","hostBlackList","hostWhiteList","tracesLength","listName","levelVal","isUncaught","onSendCallback","exceptionMessage","ignoredMessages","traceMessage","bodyMessage","urlparser","domUtil","network","networkResponseHeaders","networkResponseBody","networkRequestBody","dom","navigation","connectivity","replacements","orig","restore","_window","_document","autoInstrument","scrubTelemetryInputs","telemetryScrubber","defaultValueScrubber","patterns","attributes","attrs","nameFromDescription","eventRemovers","_location","_lastHref","oldSettings","deinstrumentNetwork","instrumentNetwork","deinstrumentConsole","instrumentConsole","deinstrumentDom","instrumentDom","deinstrumentNavigation","instrumentNavigation","deinstrumentConnectivity","instrumentConnectivity","wrapProp","xhr","xhrp","__rollbar_xhr","start_time_ms","end_time_ms","onreadystatechangeHandler","__rollbar_event","headers","headersConfig","header","allHeaders","getAllResponseHeaders","trim","getResponseHeader","response","then","wrapConsole","origConsole","removeListeners","clickHandler","handleClick","blurHandler","handleBlur","addListener","getElementFromEvent","hasTag","tagName","anchorOrButton","isDescribedElement","captureDomEvent","handleSelectInputChanged","elem","multiple","selected","selectedIndex","isChecked","getElementType","describeElement","elementString","elementArrayToString","treeToArray","app","history","pushState","handleUrlChange","parsedHref","parsedTo","parsedFrom","section","altType","attachEvent","detachEvent","getAttribute","descriptionToString","desc","out","id","classes","attr","nextStr","totalLength","separatorLength","MAX_LENGTH","nextDescription","parentNode","doc","target","elementFromPoint","clientX","clientY","subtypes","getter","defineProperty","enumerable","Symbol","toStringTag","__esModule","ns","create","object","property","moduleId","modules"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,IACA,mBAAAG,eAAAC,IACAD,OAAA,GAAAH,GACA,iBAAAC,QACAA,QAAA,QAAAD,IAEAD,EAAA,QAAAC,IARA,CASCK,KAAA,WACD,OCTAC,EAAA,GA4BAC,EAAAC,qBC7BA,IAAAC,EAAYF,EAAQ,IAEpBG,EAAA,GACAC,GAAA,EAwCA,SAAAC,EAAAC,EAAAC,GACA,OAAAA,IAAAC,EAAAF,GAMA,SAAAE,EAAAF,GACA,IAAAG,SAAAH,EACA,gBAAAG,EACAA,EAEAH,EAGAA,aAAAI,MACA,QAEA,GAAYC,SAA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AiL,EAAA,SAAAgtB,EAAAC,GAAsD,OAAA72B,OAAAD,UAAAE,eAAAV,KAAAq3B,EAAAC,IAGtDl4B,EAAA0F,EAAA,GAIA1F,IAAAoJ,EAAA,GA9EA,SAAApJ,EAAAm4B,GAGA,GAAAp4B,EAAAo4B,GACA,OAAAp4B,EAAAo4B,GAAAz4B,QAGA,IAAAC,EAAAI,EAAAo4B,GAAA,CACA/1B,EAAA+1B,EACA1xB,GAAA,EACA/G,QAAA,IAUA,OANA04B,EAAAD,GAAAv3B,KAAAjB,EAAAD,QAAAC,IAAAD,QAAAM,GAGAL,EAAA8G,GAAA,EAGA9G,EAAAD,cAvBAK","file":"rollbar.umd.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"rollbar\"] = factory();\n\telse\n\t\troot[\"rollbar\"] = factory();\n})(this, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 5);\n","var merge = require('./merge');\n\nvar RollbarJSON = {};\nvar __initRollbarJSON = false;\nfunction setupJSON() {\n if (__initRollbarJSON) {\n return;\n }\n __initRollbarJSON = true;\n\n if (isDefined(JSON)) {\n if (isNativeFunction(JSON.stringify)) {\n RollbarJSON.stringify = JSON.stringify;\n }\n if (isNativeFunction(JSON.parse)) {\n RollbarJSON.parse = JSON.parse;\n }\n }\n if (!isFunction(RollbarJSON.stringify) || !isFunction(RollbarJSON.parse)) {\n var setupCustomJSON = require('../vendor/JSON-js/json3.js');\n setupCustomJSON(RollbarJSON);\n }\n}\nsetupJSON();\n\n/*\n * isType - Given a Javascript value and a string, returns true if the type of the value matches the\n * given string.\n *\n * @param x - any value\n * @param t - a lowercase string containing one of the following type names:\n * - undefined\n * - null\n * - error\n * - number\n * - boolean\n * - string\n * - symbol\n * - function\n * - object\n * - array\n * @returns true if x is of type t, otherwise false\n */\nfunction isType(x, t) {\n return t === typeName(x);\n}\n\n/*\n * typeName - Given a Javascript value, returns the type of the object as a string\n */\nfunction typeName(x) {\n var name = typeof x;\n if (name !== 'object') {\n return name;\n }\n if (!x) {\n return 'null';\n }\n if (x instanceof Error) {\n return 'error';\n }\n return ({}).toString.call(x).match(/\\s([a-zA-Z]+)/)[1].toLowerCase();\n}\n\n/* isFunction - a convenience function for checking if a value is a function\n *\n * @param f - any value\n * @returns true if f is a function, otherwise false\n */\nfunction isFunction(f) {\n return isType(f, 'function');\n}\n\n/* isNativeFunction - a convenience function for checking if a value is a native JS function\n *\n * @param f - any value\n * @returns true if f is a native JS function, otherwise false\n */\nfunction isNativeFunction(f) {\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n var funcMatchString = Function.prototype.toString.call(Object.prototype.hasOwnProperty)\n .replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?');\n var reIsNative = RegExp('^' + funcMatchString + '$');\n return isObject(f) && reIsNative.test(f);\n}\n\n/* isObject - Checks if the argument is an object\n *\n * @param value - any value\n * @returns true is value is an object function is an object)\n*/\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/* isString - Checks if the argument is a string\n *\n * @param value - any value\n * @returns true if value is a string\n*/\nfunction isString(value) {\n return typeof value === 'string' || value instanceof String\n}\n\n/*\n * isDefined - a convenience function for checking if a value is not equal to undefined\n *\n * @param u - any value\n * @returns true if u is anything other than undefined\n */\nfunction isDefined(u) {\n return !isType(u, 'undefined');\n}\n\n/*\n * isIterable - convenience function for checking if a value can be iterated, essentially\n * whether it is an object or an array.\n *\n * @param i - any value\n * @returns true if i is an object or an array as determined by `typeName`\n */\nfunction isIterable(i) {\n var type = typeName(i);\n return (type === 'object' || type === 'array');\n}\n\n/*\n * isError - convenience function for checking if a value is of an error type\n *\n * @param e - any value\n * @returns true if e is an error\n */\nfunction isError(e) {\n // Detect both Error and Firefox Exception type\n return isType(e, 'error') || isType(e, 'exception');\n}\n\nfunction traverse(obj, func, seen) {\n var k, v, i;\n var isObj = isType(obj, 'object');\n var isArray = isType(obj, 'array');\n var keys = [];\n\n if (isObj && seen.indexOf(obj) !== -1) {\n return obj;\n }\n seen.push(obj);\n\n if (isObj) {\n for (k in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, k)) {\n keys.push(k);\n }\n }\n } else if (isArray) {\n for (i = 0; i < obj.length; ++i) {\n keys.push(i);\n }\n }\n\n var result = isObj ? {} : [];\n var same = true;\n for (i = 0; i < keys.length; ++i) {\n k = keys[i];\n v = obj[k];\n result[k] = func(k, v, seen);\n same = same && result[k] === obj[k];\n }\n\n return (keys.length != 0 && !same) ? result : obj;\n}\n\nfunction redact() {\n return '********';\n}\n\n// from http://stackoverflow.com/a/8809472/1138191\nfunction uuid4() {\n var d = now();\n var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x7 | 0x8)).toString(16);\n });\n return uuid;\n}\n\nvar LEVELS = {\n debug: 0,\n info: 1,\n warning: 2,\n error: 3,\n critical: 4\n};\n\nfunction sanitizeUrl(url) {\n var baseUrlParts = parseUri(url);\n if (!baseUrlParts) {\n return '(unknown)';\n }\n\n // remove a trailing # if there is no anchor\n if (baseUrlParts.anchor === '') {\n baseUrlParts.source = baseUrlParts.source.replace('#', '');\n }\n\n url = baseUrlParts.source.replace('?' + baseUrlParts.query, '');\n return url;\n}\n\nvar parseUriOptions = {\n strictMode: false,\n key: [\n 'source',\n 'protocol',\n 'authority',\n 'userInfo',\n 'user',\n 'password',\n 'host',\n 'port',\n 'relative',\n 'path',\n 'directory',\n 'file',\n 'query',\n 'anchor'\n ],\n q: {\n name: 'queryKey',\n parser: /(?:^|&)([^&=]*)=?([^&]*)/g\n },\n parser: {\n strict: /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?))?((((?:[^?#\\/]*\\/)*)([^?#]*))(?:\\?([^#]*))?(?:#(.*))?)/,\n loose: /^(?:(?![^:@]+:[^:@\\/]*@)([^:\\/?#.]+):)?(?:\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/\n }\n};\n\nfunction parseUri(str) {\n if (!isType(str, 'string')) {\n return undefined;\n }\n\n var o = parseUriOptions;\n var m = o.parser[o.strictMode ? 'strict' : 'loose'].exec(str);\n var uri = {};\n\n for (var i = 0, l = o.key.length; i < l; ++i) {\n uri[o.key[i]] = m[i] || '';\n }\n\n uri[o.q.name] = {};\n uri[o.key[12]].replace(o.q.parser, function ($0, $1, $2) {\n if ($1) {\n uri[o.q.name][$1] = $2;\n }\n });\n\n return uri;\n}\n\nfunction addParamsAndAccessTokenToPath(accessToken, options, params) {\n params = params || {};\n params.access_token = accessToken;\n var paramsArray = [];\n var k;\n for (k in params) {\n if (Object.prototype.hasOwnProperty.call(params, k)) {\n paramsArray.push([k, params[k]].join('='));\n }\n }\n var query = '?' + paramsArray.sort().join('&');\n\n options = options || {};\n options.path = options.path || '';\n var qs = options.path.indexOf('?');\n var h = options.path.indexOf('#');\n var p;\n if (qs !== -1 && (h === -1 || h > qs)) {\n p = options.path;\n options.path = p.substring(0,qs) + query + '&' + p.substring(qs+1);\n } else {\n if (h !== -1) {\n p = options.path;\n options.path = p.substring(0,h) + query + p.substring(h);\n } else {\n options.path = options.path + query;\n }\n }\n}\n\nfunction formatUrl(u, protocol) {\n protocol = protocol || u.protocol;\n if (!protocol && u.port) {\n if (u.port === 80) {\n protocol = 'http:';\n } else if (u.port === 443) {\n protocol = 'https:';\n }\n }\n protocol = protocol || 'https:';\n\n if (!u.hostname) {\n return null;\n }\n var result = protocol + '//' + u.hostname;\n if (u.port) {\n result = result + ':' + u.port;\n }\n if (u.path) {\n result = result + u.path;\n }\n return result;\n}\n\nfunction stringify(obj, backup) {\n var value, error;\n try {\n value = RollbarJSON.stringify(obj);\n } catch (jsonError) {\n if (backup && isFunction(backup)) {\n try {\n value = backup(obj);\n } catch (backupError) {\n error = backupError;\n }\n } else {\n error = jsonError;\n }\n }\n return {error: error, value: value};\n}\n\nfunction jsonParse(s) {\n var value, error;\n try {\n value = RollbarJSON.parse(s);\n } catch (e) {\n error = e;\n }\n return {error: error, value: value};\n}\n\nfunction makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n mode,\n backupMessage,\n errorParser\n) {\n var location = {\n url: url || '',\n line: lineno,\n column: colno\n };\n location.func = errorParser.guessFunctionName(location.url, location.line);\n location.context = errorParser.gatherContext(location.url, location.line);\n var href = document && document.location && document.location.href;\n var useragent = window && window.navigator && window.navigator.userAgent;\n return {\n 'mode': mode,\n 'message': error ? String(error) : (message || backupMessage),\n 'url': href,\n 'stack': [location],\n 'useragent': useragent\n };\n}\n\nfunction wrapCallback(logger, f) {\n return function(err, resp) {\n try {\n f(err, resp);\n } catch (e) {\n logger.error(e);\n }\n };\n}\n\nfunction createItem(args, logger, notifier, requestKeys, lambdaContext) {\n var message, err, custom, callback, request;\n var arg;\n var extraArgs = [];\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'undefined':\n break;\n case 'string':\n message ? extraArgs.push(arg) : message = arg;\n break;\n case 'function':\n callback = wrapCallback(logger, arg);\n break;\n case 'date':\n extraArgs.push(arg);\n break;\n case 'error':\n case 'domexception':\n case 'exception': // Firefox Exception type\n err ? extraArgs.push(arg) : err = arg;\n break;\n case 'object':\n case 'array':\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n if (requestKeys && typ === 'object' && !request) {\n for (var j = 0, len = requestKeys.length; j < len; ++j) {\n if (arg[requestKeys[j]] !== undefined) {\n request = arg;\n break;\n }\n }\n if (request) {\n break;\n }\n }\n custom ? extraArgs.push(arg) : custom = arg;\n break;\n default:\n if (arg instanceof Error || (typeof DOMException !== 'undefined' && arg instanceof DOMException)) {\n err ? extraArgs.push(arg) : err = arg;\n break;\n }\n extraArgs.push(arg);\n }\n }\n\n if (extraArgs.length > 0) {\n // if custom is an array this turns it into an object with integer keys\n custom = merge(custom);\n custom.extraArgs = extraArgs;\n }\n\n var item = {\n message: message,\n err: err,\n custom: custom,\n timestamp: now(),\n callback: callback,\n uuid: uuid4()\n };\n if (custom && custom.level !== undefined) {\n item.level = custom.level;\n delete custom.level;\n }\n if (requestKeys && request) {\n item.request = request;\n }\n if (lambdaContext) {\n item.lambdaContext = lambdaContext;\n }\n item._originalArgs = args;\n return item;\n}\n\nvar TELEMETRY_TYPES = ['log', 'network', 'dom', 'navigation', 'error', 'manual'];\nvar TELEMETRY_LEVELS = ['critical', 'error', 'warning', 'info', 'debug'];\n\nfunction arrayIncludes(arr, val) {\n for (var k = 0; k < arr.length; ++k) {\n if (arr[k] === val) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction createTelemetryEvent(args) {\n var type, metadata, level;\n var arg;\n\n for (var i = 0, l = args.length; i < l; ++i) {\n arg = args[i];\n\n var typ = typeName(arg);\n switch (typ) {\n case 'string':\n if (arrayIncludes(TELEMETRY_TYPES, arg)) {\n type = arg;\n } else if (arrayIncludes(TELEMETRY_LEVELS, arg)) {\n level = arg;\n }\n break;\n case 'object':\n metadata = arg;\n break;\n default:\n break;\n }\n }\n var event = {\n type: type || 'manual',\n metadata: metadata || {},\n level: level\n };\n\n return event;\n}\n\n/*\n * get - given an obj/array and a keypath, return the value at that keypath or\n * undefined if not possible.\n *\n * @param obj - an object or array\n * @param path - a string of keys separated by '.' such as 'plugin.jquery.0.message'\n * which would correspond to 42 in `{plugin: {jquery: [{message: 42}]}}`\n */\nfunction get(obj, path) {\n if (!obj) {\n return undefined;\n }\n var keys = path.split('.');\n var result = obj;\n try {\n for (var i = 0, len = keys.length; i < len; ++i) {\n result = result[keys[i]];\n }\n } catch (e) {\n result = undefined;\n }\n return result;\n}\n\nfunction set(obj, path, value) {\n if (!obj) {\n return;\n }\n var keys = path.split('.');\n var len = keys.length;\n if (len < 1) {\n return;\n }\n if (len === 1) {\n obj[keys[0]] = value;\n return;\n }\n try {\n var temp = obj[keys[0]] || {};\n var replacement = temp;\n for (var i = 1; i < len - 1; ++i) {\n temp[keys[i]] = temp[keys[i]] || {};\n temp = temp[keys[i]];\n }\n temp[keys[len-1]] = value;\n obj[keys[0]] = replacement;\n } catch (e) {\n return;\n }\n}\n\nfunction scrub(data, scrubFields) {\n scrubFields = scrubFields || [];\n var paramRes = _getScrubFieldRegexs(scrubFields);\n var queryRes = _getScrubQueryParamRegexs(scrubFields);\n\n function redactQueryParam(dummy0, paramPart) {\n return paramPart + redact();\n }\n\n function paramScrubber(v) {\n var i;\n if (isType(v, 'string')) {\n for (i = 0; i < queryRes.length; ++i) {\n v = v.replace(queryRes[i], redactQueryParam);\n }\n }\n return v;\n }\n\n function valScrubber(k, v) {\n var i;\n for (i = 0; i < paramRes.length; ++i) {\n if (paramRes[i].test(k)) {\n v = redact();\n break;\n }\n }\n return v;\n }\n\n function scrubber(k, v, seen) {\n var tmpV = valScrubber(k, v);\n if (tmpV === v) {\n if (isType(v, 'object') || isType(v, 'array')) {\n return traverse(v, scrubber, seen);\n }\n return paramScrubber(tmpV);\n } else {\n return tmpV;\n }\n }\n\n return traverse(data, scrubber, []);\n}\n\nfunction _getScrubFieldRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '^\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?$';\n ret.push(new RegExp(pat, 'i'));\n }\n return ret;\n}\n\n\nfunction _getScrubQueryParamRegexs(scrubFields) {\n var ret = [];\n var pat;\n for (var i = 0; i < scrubFields.length; ++i) {\n pat = '\\\\[?(%5[bB])?' + scrubFields[i] + '\\\\[?(%5[bB])?\\\\]?(%5[dD])?';\n ret.push(new RegExp('(' + pat + '=)([^&\\\\n]+)', 'igm'));\n }\n return ret;\n}\n\nfunction formatArgsAsString(args) {\n var i, len, arg;\n var result = [];\n for (i = 0, len = args.length; i < len; ++i) {\n arg = args[i];\n switch (typeName(arg)) {\n case 'object':\n arg = stringify(arg);\n arg = arg.error || arg.value;\n if (arg.length > 500) {\n arg = arg.substr(0, 497) + '...';\n }\n break;\n case 'null':\n arg = 'null';\n break;\n case 'undefined':\n arg = 'undefined';\n break;\n case 'symbol':\n arg = arg.toString();\n break;\n }\n result.push(arg);\n }\n return result.join(' ');\n}\n\nfunction now() {\n if (Date.now) {\n return +Date.now();\n }\n return +new Date();\n}\n\nfunction filterIp(requestData, captureIp) {\n if (!requestData || !requestData['user_ip'] || captureIp === true) {\n return;\n }\n var newIp = requestData['user_ip'];\n if (!captureIp) {\n newIp = null;\n } else {\n try {\n var parts;\n if (newIp.indexOf('.') !== -1) {\n parts = newIp.split('.');\n parts.pop();\n parts.push('0');\n newIp = parts.join('.');\n } else if (newIp.indexOf(':') !== -1) {\n parts = newIp.split(':');\n if (parts.length > 2) {\n var beginning = parts.slice(0, 3);\n var slashIdx = beginning[2].indexOf('/');\n if (slashIdx !== -1) {\n beginning[2] = beginning[2].substring(0, slashIdx);\n }\n var terminal = '0000:0000:0000:0000:0000';\n newIp = beginning.concat(terminal).join(':');\n }\n } else {\n newIp = null;\n }\n } catch (e) {\n newIp = null;\n }\n }\n requestData['user_ip'] = newIp;\n}\n\nfunction handleOptions(current, input, payload) {\n var result = merge(current, input, payload);\n if (!input || input.overwriteScrubFields) {\n return result;\n }\n if (input.scrubFields) {\n result.scrubFields = (current.scrubFields || []).concat(input.scrubFields);\n }\n return result;\n}\n\nmodule.exports = {\n addParamsAndAccessTokenToPath: addParamsAndAccessTokenToPath,\n createItem: createItem,\n createTelemetryEvent: createTelemetryEvent,\n filterIp: filterIp,\n formatArgsAsString: formatArgsAsString,\n formatUrl: formatUrl,\n get: get,\n handleOptions: handleOptions,\n isError: isError,\n isFunction: isFunction,\n isIterable: isIterable,\n isNativeFunction: isNativeFunction,\n isType: isType,\n isObject: isObject,\n isString: isString,\n jsonParse: jsonParse,\n LEVELS: LEVELS,\n makeUnhandledStackInfo: makeUnhandledStackInfo,\n merge: merge,\n now: now,\n redact: redact,\n sanitizeUrl: sanitizeUrl,\n scrub: scrub,\n set: set,\n stringify: stringify,\n traverse: traverse,\n typeName: typeName,\n uuid4: uuid4\n};\n","/* eslint-disable no-console */\nrequire('console-polyfill');\nvar detection = require('./detection');\nvar _ = require('../utility');\n\nfunction error() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.error(_.formatArgsAsString(args));\n } else {\n console.error.apply(console, args);\n }\n}\n\nfunction info() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.info(_.formatArgsAsString(args));\n } else {\n console.info.apply(console, args);\n }\n}\n\nfunction log() {\n var args = Array.prototype.slice.call(arguments, 0);\n args.unshift('Rollbar:');\n if (detection.ieVersion() <= 8) {\n console.log(_.formatArgsAsString(args));\n } else {\n console.log.apply(console, args);\n }\n}\n\n/* eslint-enable no-console */\n\nmodule.exports = {\n error: error,\n info: info,\n log: log\n};\n","var _ = require('./utility');\n\nfunction raw(payload, jsonBackup) {\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction selectFrames(frames, range) {\n var len = frames.length;\n if (len > range * 2) {\n return frames.slice(0, range).concat(frames.slice(len - range));\n }\n return frames;\n}\n\nfunction truncateFrames(payload, jsonBackup, range) {\n range = (typeof range === 'undefined') ? 30 : range;\n var body = payload.data.body;\n var frames;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n frames = chain[i].frames;\n frames = selectFrames(frames, range);\n chain[i].frames = frames;\n }\n } else if (body.trace) {\n frames = body.trace.frames;\n frames = selectFrames(frames, range);\n body.trace.frames = frames;\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction maybeTruncateValue(len, val) {\n if (!val) {\n return val;\n }\n if (val.length > len) {\n return val.slice(0, len - 3).concat('...');\n }\n return val;\n}\n\nfunction truncateStrings(len, payload, jsonBackup) {\n function truncator(k, v, seen) {\n switch (_.typeName(v)) {\n case 'string':\n return maybeTruncateValue(len, v);\n case 'object':\n case 'array':\n return _.traverse(v, truncator, seen);\n default:\n return v;\n }\n }\n payload = _.traverse(payload, truncator, []);\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction truncateTraceData(traceData) {\n if (traceData.exception) {\n delete traceData.exception.description;\n traceData.exception.message = maybeTruncateValue(255, traceData.exception.message);\n }\n traceData.frames = selectFrames(traceData.frames, 1);\n return traceData;\n}\n\nfunction minBody(payload, jsonBackup) {\n var body = payload.data.body;\n if (body.trace_chain) {\n var chain = body.trace_chain;\n for (var i = 0; i < chain.length; i++) {\n chain[i] = truncateTraceData(chain[i]);\n }\n } else if (body.trace) {\n body.trace = truncateTraceData(body.trace);\n }\n return [payload, _.stringify(payload, jsonBackup)];\n}\n\nfunction needsTruncation(payload, maxSize) {\n return payload.length > maxSize;\n}\n\nfunction truncate(payload, jsonBackup, maxSize) {\n maxSize = (typeof maxSize === 'undefined') ? (512 * 1024) : maxSize;\n var strategies = [\n raw,\n truncateFrames,\n truncateStrings.bind(null, 1024),\n truncateStrings.bind(null, 512),\n truncateStrings.bind(null, 256),\n minBody\n ];\n var strategy, results, result;\n\n while ((strategy = strategies.shift())) {\n results = strategy(payload, jsonBackup);\n payload = results[0];\n result = results[1];\n if (result.error || !needsTruncation(result.value, maxSize)) {\n return result;\n }\n }\n return result;\n}\n\nmodule.exports = {\n truncate: truncate,\n\n /* for testing */\n raw: raw,\n truncateFrames: truncateFrames,\n truncateStrings: truncateStrings,\n maybeTruncateValue: maybeTruncateValue\n};\n","// See https://nodejs.org/docs/latest/api/url.html\nfunction parse(url) {\n var result = {\n protocol: null, auth: null, host: null, path: null,\n hash: null, href: url, hostname: null, port: null,\n pathname: null, search: null, query: null\n };\n\n var i, last;\n i = url.indexOf('//');\n if (i !== -1) {\n result.protocol = url.substring(0,i);\n last = i+2;\n } else {\n last = 0;\n }\n \n i = url.indexOf('@', last);\n if (i !== -1) {\n result.auth = url.substring(last, i);\n last = i+1;\n }\n\n i = url.indexOf('/', last);\n if (i === -1) {\n i = url.indexOf('?', last);\n if (i === -1) {\n i = url.indexOf('#', last);\n if (i === -1) {\n result.host = url.substring(last);\n } else {\n result.host = url.substring(last, i);\n result.hash = url.substring(i);\n }\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n return result;\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n } else {\n result.host = url.substring(last, i);\n result.hostname = result.host.split(':')[0];\n result.port = result.host.split(':')[1];\n if (result.port) {\n result.port = parseInt(result.port, 10);\n }\n last = i;\n }\n\n i = url.indexOf('#', last);\n if (i === -1) {\n result.path = url.substring(last);\n } else {\n result.path = url.substring(last, i);\n result.hash = url.substring(i);\n }\n\n if (result.path) {\n var pathParts = result.path.split('?');\n result.pathname = pathParts[0];\n result.query = pathParts[1];\n result.search = result.query ? '?' + result.query : null;\n }\n return result;\n}\n\nmodule.exports = {\n parse: parse\n};\n","var ErrorStackParser = require('error-stack-parser');\n\nvar UNKNOWN_FUNCTION = '?';\nvar ERR_CLASS_REGEXP = new RegExp('^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ');\n\nfunction guessFunctionName() {\n return UNKNOWN_FUNCTION;\n}\n\n\nfunction gatherContext() {\n return null;\n}\n\n\nfunction Frame(stackFrame) {\n var data = {};\n\n data._stackFrame = stackFrame;\n\n data.url = stackFrame.fileName;\n data.line = stackFrame.lineNumber;\n data.func = stackFrame.functionName;\n data.column = stackFrame.columnNumber;\n data.args = stackFrame.args;\n\n data.context = gatherContext();\n\n return data;\n}\n\n\nfunction Stack(exception) {\n function getStack() {\n var parserStack = [];\n var exc;\n\n if (!exception.stack) {\n try {\n throw exception;\n } catch (e) {\n exc = e;\n }\n } else {\n exc = exception;\n }\n\n try {\n parserStack = ErrorStackParser.parse(exc);\n } catch(e) {\n parserStack = [];\n }\n\n var stack = [];\n\n for (var i = 0; i < parserStack.length; i++) {\n stack.push(new Frame(parserStack[i]));\n }\n\n return stack;\n }\n\n var name = exception.constructor && exception.constructor.name;\n if (!name || !name.length || name.length < 3) {\n name = exception.name;\n }\n\n return {\n stack: getStack(),\n message: exception.message,\n name: name,\n rawStack: exception.stack,\n rawException: exception\n };\n}\n\n\nfunction parse(e) {\n var err = e;\n\n if (err.nested) {\n var traceChain = [];\n while (err) {\n traceChain.push(new Stack(err));\n err = err.nested;\n }\n\n // Return primary error with full trace chain attached.\n traceChain[0].traceChain = traceChain;\n return traceChain[0];\n } else {\n return new Stack(err);\n }\n}\n\n\nfunction guessErrorClass(errMsg) {\n if (!errMsg || !errMsg.match) {\n return ['Unknown error. There was no error message to display.', ''];\n }\n var errClassMatch = errMsg.match(ERR_CLASS_REGEXP);\n var errClass = '(unknown)';\n\n if (errClassMatch) {\n errClass = errClassMatch[errClassMatch.length - 1];\n errMsg = errMsg.replace((errClassMatch[errClassMatch.length - 2] || '') + errClass + ':', '');\n errMsg = errMsg.replace(/(^[\\s]+|[\\s]+$)/g, '');\n }\n return [errClass, errMsg];\n}\n\n\nmodule.exports = {\n guessFunctionName: guessFunctionName,\n guessErrorClass: guessErrorClass,\n gatherContext: gatherContext,\n parse: parse,\n Stack: Stack,\n Frame: Frame\n};\n","var rollbar = require('../rollbar');\n\nvar options = (typeof window !== 'undefined') && window._rollbarConfig;\nvar alias = options && options.globalAlias || 'Rollbar';\nvar shimRunning = (typeof window !== 'undefined') && window[alias] && typeof window[alias].shimId === 'function' && window[alias].shimId() !== undefined;\n\nif ((typeof window !== 'undefined') && !window._rollbarStartTime) {\n window._rollbarStartTime = (new Date()).getTime();\n}\n\nif (!shimRunning && options) {\n var Rollbar = new rollbar(options);\n window[alias] = Rollbar;\n} else if (typeof window !== 'undefined') {\n window.rollbar = rollbar;\n window._rollbarDidLoad = true;\n} else if (typeof self !== 'undefined') {\n self.rollbar = rollbar;\n self._rollbarDidLoad = true;\n}\n\nmodule.exports = rollbar;\n","var Client = require('../rollbar');\nvar _ = require('../utility');\nvar API = require('../api');\nvar logger = require('./logger');\nvar globals = require('./globalSetup');\n\nvar transport = require('./transport');\nvar urllib = require('./url');\n\nvar transforms = require('./transforms');\nvar sharedTransforms = require('../transforms');\nvar predicates = require('./predicates');\nvar sharedPredicates = require('../predicates');\nvar errorParser = require('./errorParser');\nvar Instrumenter = require('./telemetry');\n\nfunction Rollbar(options, client) {\n this.options = _.handleOptions(defaultOptions, options);\n this.options._configuredOptions = options;\n var api = new API(this.options, transport, urllib);\n this.client = client || new Client(this.options, api, logger, 'browser');\n\n var gWindow = _gWindow();\n var gDocument = (typeof document != 'undefined') && document;\n this.isChrome = gWindow.chrome && gWindow.chrome.runtime; // check .runtime to avoid Edge browsers\n this.anonymousErrorsPending = 0;\n addTransformsToNotifier(this.client.notifier, gWindow);\n addPredicatesToQueue(this.client.queue);\n this.setupUnhandledCapture();\n this.instrumenter = new Instrumenter(this.options, this.client.telemeter, this, gWindow, gDocument);\n this.instrumenter.instrument();\n}\n\nvar _instance = null;\nRollbar.init = function(options, client) {\n if (_instance) {\n return _instance.global(options).configure(options);\n }\n _instance = new Rollbar(options, client);\n return _instance;\n};\n\nfunction handleUninitialized(maybeCallback) {\n var message = 'Rollbar is not initialized';\n logger.error(message);\n if (maybeCallback) {\n maybeCallback(new Error(message));\n }\n}\n\nRollbar.prototype.global = function(options) {\n this.client.global(options);\n return this;\n};\nRollbar.global = function(options) {\n if (_instance) {\n return _instance.global(options);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.handleOptions(oldOptions, options, payload);\n this.options._configuredOptions = _.handleOptions(oldOptions._configuredOptions, options, payload);\n this.client.configure(this.options, payloadData);\n this.instrumenter.configure(this.options);\n this.setupUnhandledCapture();\n return this;\n};\nRollbar.configure = function(options, payloadData) {\n if (_instance) {\n return _instance.configure(options, payloadData);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.lastError = function() {\n return this.client.lastError;\n};\nRollbar.lastError = function() {\n if (_instance) {\n return _instance.lastError();\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.log = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.log(item);\n return {uuid: uuid};\n};\nRollbar.log = function() {\n if (_instance) {\n return _instance.log.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.debug = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.debug(item);\n return {uuid: uuid};\n};\nRollbar.debug = function() {\n if (_instance) {\n return _instance.debug.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.info = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.info(item);\n return {uuid: uuid};\n};\nRollbar.info = function() {\n if (_instance) {\n return _instance.info.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warn = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warn(item);\n return {uuid: uuid};\n};\nRollbar.warn = function() {\n if (_instance) {\n return _instance.warn.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.warning = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.warning(item);\n return {uuid: uuid};\n};\nRollbar.warning = function() {\n if (_instance) {\n return _instance.warning.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.error = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.error(item);\n return {uuid: uuid};\n};\nRollbar.error = function() {\n if (_instance) {\n return _instance.error.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.critical = function() {\n var item = this._createItem(arguments);\n var uuid = item.uuid;\n this.client.critical(item);\n return {uuid: uuid};\n};\nRollbar.critical = function() {\n if (_instance) {\n return _instance.critical.apply(_instance, arguments);\n } else {\n var maybeCallback = _getFirstFunction(arguments);\n handleUninitialized(maybeCallback);\n }\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.client.buildJsonPayload(item);\n};\nRollbar.buildJsonPayload = function() {\n if (_instance) {\n return _instance.buildJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n return this.client.sendJsonPayload(jsonPayload);\n};\nRollbar.sendJsonPayload = function() {\n if (_instance) {\n return _instance.sendJsonPayload.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.setupUnhandledCapture = function() {\n var gWindow = _gWindow();\n\n if (!this.unhandledExceptionsInitialized) {\n if (this.options.captureUncaught || this.options.handleUncaughtExceptions) {\n globals.captureUncaughtExceptions(gWindow, this);\n if (this.options.wrapGlobalEventHandlers) {\n globals.wrapGlobals(gWindow, this);\n }\n this.unhandledExceptionsInitialized = true;\n }\n }\n if (!this.unhandledRejectionsInitialized) {\n if (this.options.captureUnhandledRejections || this.options.handleUnhandledRejections) {\n globals.captureUnhandledRejections(gWindow, this);\n this.unhandledRejectionsInitialized = true;\n }\n }\n};\n\nRollbar.prototype.handleUncaughtException = function(message, url, lineno, colno, error, context) {\n if (!this.options.captureUncaught && !this.options.handleUncaughtExceptions) {\n return;\n }\n\n // Chrome will always send 5+ arguments and error will be valid or null, not undefined.\n // If error is undefined, we have a different caller.\n if (this.options.inspectAnonymousErrors && this.isChrome && (error === null)) {\n return 'anonymous';\n }\n\n var item;\n var stackInfo = _.makeUnhandledStackInfo(\n message,\n url,\n lineno,\n colno,\n error,\n 'onerror',\n 'uncaught exception',\n errorParser\n );\n if (_.isError(error)) {\n item = this._createItem([message, error, context]);\n item._unhandledStackInfo = stackInfo;\n } else if (_.isError(url)) {\n item = this._createItem([message, url, context]);\n item._unhandledStackInfo = stackInfo;\n } else {\n item = this._createItem([message, context]);\n item.stackInfo = stackInfo;\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n this.client.log(item);\n};\n\n/**\n * Chrome only. Other browsers will ignore.\n *\n * Use Error.prepareStackTrace to extract information about errors that\n * do not have a valid error object in onerror().\n *\n * In tested version of Chrome, onerror is called first but has no way\n * to communicate with prepareStackTrace. Use a counter to let this\n * handler know which errors to send to Rollbar.\n *\n * In config options, set inspectAnonymousErrors to enable.\n */\nRollbar.prototype.handleAnonymousErrors = function() {\n if (!this.options.inspectAnonymousErrors || !this.isChrome) {\n return;\n }\n\n var r = this;\n function prepareStackTrace(error, _stack) { // eslint-disable-line no-unused-vars\n if (r.options.inspectAnonymousErrors) {\n if (r.anonymousErrorsPending) {\n // This is the only known way to detect that onerror saw an anonymous error.\n // It depends on onerror reliably being called before Error.prepareStackTrace,\n // which so far holds true on tested versions of Chrome. If versions of Chrome\n // are tested that behave differently, this logic will need to be updated\n // accordingly.\n r.anonymousErrorsPending -= 1;\n\n if (!error) {\n // Not likely to get here, but calling handleUncaughtException from here\n // without an error object would throw off the anonymousErrorsPending counter,\n // so return now.\n return;\n }\n\n // Allow this to be tracked later.\n error._isAnonymous = true;\n\n // url, lineno, colno shouldn't be needed for these errors.\n // If that changes, update this accordingly, using the unused\n // _stack param as needed (rather than parse error.toString()).\n r.handleUncaughtException(error.message, null, null, null, error);\n }\n }\n\n // Workaround to ensure stack is preserved for normal errors.\n return error.stack;\n }\n\n // https://v8.dev/docs/stack-trace-api\n try {\n Error.prepareStackTrace = prepareStackTrace;\n } catch (e) {\n this.options.inspectAnonymousErrors = false;\n this.error('anonymous error handler failed', e);\n }\n}\n\nRollbar.prototype.handleUnhandledRejection = function(reason, promise) {\n if (!this.options.captureUnhandledRejections && !this.options.handleUnhandledRejections) {\n return;\n }\n\n var message = 'unhandled rejection was null or undefined!';\n if (reason) {\n if (reason.message) {\n message = reason.message;\n } else {\n var reasonResult = _.stringify(reason);\n if (reasonResult.value) {\n message = reasonResult.value;\n }\n }\n }\n var context = (reason && reason._rollbarContext) || (promise && promise._rollbarContext);\n\n var item;\n if (_.isError(reason)) {\n item = this._createItem([message, reason, context]);\n } else {\n item = this._createItem([message, reason, context]);\n item.stackInfo = _.makeUnhandledStackInfo(\n message,\n '',\n 0,\n 0,\n null,\n 'unhandledrejection',\n '',\n errorParser\n );\n }\n item.level = this.options.uncaughtErrorLevel;\n item._isUncaught = true;\n item._originalArgs = item._originalArgs || [];\n item._originalArgs.push(promise);\n this.client.log(item);\n};\n\nRollbar.prototype.wrap = function(f, context, _before) {\n try {\n var ctxFn;\n if(_.isFunction(context)) {\n ctxFn = context;\n } else {\n ctxFn = function() { return context || {}; };\n }\n\n if (!_.isFunction(f)) {\n return f;\n }\n\n if (f._isWrap) {\n return f;\n }\n\n if (!f._rollbar_wrapped) {\n f._rollbar_wrapped = function () {\n if (_before && _.isFunction(_before)) {\n _before.apply(this, arguments);\n }\n try {\n return f.apply(this, arguments);\n } catch(exc) {\n var e = exc;\n if (e && window._rollbarWrappedError !== e) {\n if (_.isType(e, 'string')) {\n e = new String(e);\n }\n e._rollbarContext = ctxFn() || {};\n e._rollbarContext._wrappedSource = f.toString();\n\n window._rollbarWrappedError = e;\n }\n throw e;\n }\n };\n\n f._rollbar_wrapped._isWrap = true;\n\n if (f.hasOwnProperty) {\n for (var prop in f) {\n if (f.hasOwnProperty(prop) && prop !== '_rollbar_wrapped') {\n f._rollbar_wrapped[prop] = f[prop];\n }\n }\n }\n }\n\n return f._rollbar_wrapped;\n } catch (e) {\n // Return the original function if the wrap fails.\n return f;\n }\n};\nRollbar.wrap = function(f, context) {\n if (_instance) {\n return _instance.wrap(f, context);\n } else {\n handleUninitialized();\n }\n};\n\nRollbar.prototype.captureEvent = function() {\n var event = _.createTelemetryEvent(arguments);\n return this.client.captureEvent(event.type, event.metadata, event.level);\n};\nRollbar.captureEvent = function() {\n if (_instance) {\n return _instance.captureEvent.apply(_instance, arguments);\n } else {\n handleUninitialized();\n }\n};\n\n// The following two methods are used internally and are not meant for public use\nRollbar.prototype.captureDomContentLoaded = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(e, ts) {\n if (!ts) {\n ts = new Date();\n }\n return this.client.captureLoad(ts);\n};\n\n/* Internal */\n\nfunction addTransformsToNotifier(notifier, gWindow) {\n notifier\n .addTransform(transforms.handleDomException)\n .addTransform(transforms.handleItemWithError)\n .addTransform(transforms.ensureItemHasSomethingToSay)\n .addTransform(transforms.addBaseInfo)\n .addTransform(transforms.addRequestInfo(gWindow))\n .addTransform(transforms.addClientInfo(gWindow))\n .addTransform(transforms.addPluginInfo(gWindow))\n .addTransform(transforms.addBody)\n .addTransform(sharedTransforms.addMessageWithError)\n .addTransform(sharedTransforms.addTelemetryData)\n .addTransform(sharedTransforms.addConfigToPayload)\n .addTransform(transforms.scrubPayload)\n .addTransform(sharedTransforms.userTransform(logger))\n .addTransform(sharedTransforms.addConfiguredOptions)\n .addTransform(sharedTransforms.addDiagnosticKeys)\n .addTransform(sharedTransforms.itemToPayload);\n}\n\nfunction addPredicatesToQueue(queue) {\n queue\n .addPredicate(sharedPredicates.checkLevel)\n .addPredicate(predicates.checkIgnore)\n .addPredicate(sharedPredicates.userCheckIgnore(logger))\n .addPredicate(sharedPredicates.urlIsNotBlacklisted(logger))\n .addPredicate(sharedPredicates.urlIsWhitelisted(logger))\n .addPredicate(sharedPredicates.messageIsIgnored(logger));\n}\n\nRollbar.prototype._createItem = function(args) {\n return _.createItem(args, logger, this);\n};\n\nfunction _getFirstFunction(args) {\n for (var i = 0, len = args.length; i < len; ++i) {\n if (_.isFunction(args[i])) {\n return args[i];\n }\n }\n return undefined;\n}\n\nfunction _gWindow() {\n return ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n}\n\n/* global __NOTIFIER_VERSION__:false */\n/* global __DEFAULT_BROWSER_SCRUB_FIELDS__:false */\n/* global __DEFAULT_LOG_LEVEL__:false */\n/* global __DEFAULT_REPORT_LEVEL__:false */\n/* global __DEFAULT_UNCAUGHT_ERROR_LEVEL:false */\n/* global __DEFAULT_ENDPOINT__:false */\n\nvar defaultOptions = {\n version: __NOTIFIER_VERSION__,\n scrubFields: __DEFAULT_BROWSER_SCRUB_FIELDS__,\n logLevel: __DEFAULT_LOG_LEVEL__,\n reportLevel: __DEFAULT_REPORT_LEVEL__,\n uncaughtErrorLevel: __DEFAULT_UNCAUGHT_ERROR_LEVEL,\n endpoint: __DEFAULT_ENDPOINT__,\n verbose: false,\n enabled: true,\n transmit: true,\n sendConfig: false,\n includeItemsInTelemetry: true,\n captureIp: true,\n inspectAnonymousErrors: true,\n ignoreDuplicateErrors: true,\n wrapGlobalEventHandlers: false\n};\n\nmodule.exports = Rollbar;\n","var RateLimiter = require('./rateLimiter');\nvar Queue = require('./queue');\nvar Notifier = require('./notifier');\nvar Telemeter = require('./telemetry');\nvar _ = require('./utility');\n\n/*\n * Rollbar - the interface to Rollbar\n *\n * @param options\n * @param api\n * @param logger\n */\nfunction Rollbar(options, api, logger, platform) {\n this.options = _.merge(options);\n this.logger = logger;\n Rollbar.rateLimiter.configureGlobal(this.options);\n Rollbar.rateLimiter.setPlatformOptions(platform, this.options);\n this.api = api;\n this.queue = new Queue(Rollbar.rateLimiter, api, logger, this.options);\n this.notifier = new Notifier(this.queue, this.options);\n this.telemeter = new Telemeter(this.options);\n this.lastError = null;\n this.lastErrorHash = 'none';\n}\n\nvar defaultOptions = {\n maxItems: 0,\n itemsPerMinute: 60\n};\n\nRollbar.rateLimiter = new RateLimiter(defaultOptions);\n\nRollbar.prototype.global = function(options) {\n Rollbar.rateLimiter.configureGlobal(options);\n return this;\n};\n\nRollbar.prototype.configure = function(options, payloadData) {\n var oldOptions = this.options;\n var payload = {};\n if (payloadData) {\n payload = {payload: payloadData};\n }\n this.options = _.merge(oldOptions, options, payload);\n this.notifier && this.notifier.configure(this.options);\n this.telemeter && this.telemeter.configure(this.options);\n this.global(this.options);\n return this;\n};\n\nRollbar.prototype.log = function(item) {\n var level = this._defaultLogLevel();\n return this._log(level, item);\n};\n\nRollbar.prototype.debug = function(item) {\n this._log('debug', item);\n};\n\nRollbar.prototype.info = function(item) {\n this._log('info', item);\n};\n\nRollbar.prototype.warn = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.warning = function(item) {\n this._log('warning', item);\n};\n\nRollbar.prototype.error = function(item) {\n this._log('error', item);\n};\n\nRollbar.prototype.critical = function(item) {\n this._log('critical', item);\n};\n\nRollbar.prototype.wait = function(callback) {\n this.queue.wait(callback);\n};\n\nRollbar.prototype.captureEvent = function(type, metadata, level) {\n return this.telemeter.captureEvent(type, metadata, level);\n};\n\nRollbar.prototype.captureDomContentLoaded = function(ts) {\n return this.telemeter.captureDomContentLoaded(ts);\n};\n\nRollbar.prototype.captureLoad = function(ts) {\n return this.telemeter.captureLoad(ts);\n};\n\nRollbar.prototype.buildJsonPayload = function(item) {\n return this.api.buildJsonPayload(item);\n};\n\nRollbar.prototype.sendJsonPayload = function(jsonPayload) {\n this.api.postJsonPayload(jsonPayload);\n};\n\n/* Internal */\n\nRollbar.prototype._log = function(defaultLevel, item) {\n var callback;\n if (item.callback) {\n callback = item.callback;\n delete item.callback;\n }\n if (this.options.ignoreDuplicateErrors && this._sameAsLastError(item)) {\n if (callback) {\n var error = new Error('ignored identical item');\n error.item = item;\n callback(error);\n }\n return;\n }\n try {\n item.level = item.level || defaultLevel;\n this.telemeter._captureRollbarItem(item);\n item.telemetryEvents = this.telemeter.copyEvents();\n this.notifier.log(item, callback);\n } catch (e) {\n this.logger.error(e);\n }\n};\n\nRollbar.prototype._defaultLogLevel = function() {\n return this.options.logLevel || 'debug';\n};\n\nRollbar.prototype._sameAsLastError = function(item) {\n if (!item._isUncaught) {\n return false;\n }\n var itemHash = generateItemHash(item);\n if (this.lastErrorHash === itemHash) {\n return true;\n }\n this.lastError = item.err;\n this.lastErrorHash = itemHash;\n return false;\n};\n\nfunction generateItemHash(item) {\n var message = item.message || '';\n var stack = (item.err || {}).stack || String(item.err);\n return message + '::' + stack;\n}\n\nmodule.exports = Rollbar;\n","var _ = require('./utility');\n\n/*\n * RateLimiter - an object that encapsulates the logic for counting items sent to Rollbar\n *\n * @param options - the same options that are accepted by configureGlobal offered as a convenience\n */\nfunction RateLimiter(options) {\n this.startTime = _.now();\n this.counter = 0;\n this.perMinCounter = 0;\n this.platform = null;\n this.platformOptions = {};\n this.configureGlobal(options);\n}\n\nRateLimiter.globalSettings = {\n startTime: _.now(),\n maxItems: undefined,\n itemsPerMinute: undefined\n};\n\n/*\n * configureGlobal - set the global rate limiter options\n *\n * @param options - Only the following values are recognized:\n * startTime: a timestamp of the form returned by (new Date()).getTime()\n * maxItems: the maximum items\n * itemsPerMinute: the max number of items to send in a given minute\n */\nRateLimiter.prototype.configureGlobal = function(options) {\n if (options.startTime !== undefined) {\n RateLimiter.globalSettings.startTime = options.startTime;\n }\n if (options.maxItems !== undefined) {\n RateLimiter.globalSettings.maxItems = options.maxItems;\n }\n if (options.itemsPerMinute !== undefined) {\n RateLimiter.globalSettings.itemsPerMinute = options.itemsPerMinute;\n }\n};\n\n/*\n * shouldSend - determine if we should send a given item based on rate limit settings\n *\n * @param item - the item we are about to send\n * @returns An object with the following structure:\n * error: (Error|null)\n * shouldSend: bool\n * payload: (Object|null)\n * If shouldSend is false, the item passed as a parameter should not be sent to Rollbar, and\n * exactly one of error or payload will be non-null. If error is non-null, the returned Error will\n * describe the situation, but it means that we were already over a rate limit (either globally or\n * per minute) when this item was checked. If error is null, and therefore payload is non-null, it\n * means this item put us over the global rate limit and the payload should be sent to Rollbar in\n * place of the passed in item.\n */\nRateLimiter.prototype.shouldSend = function(item, now) {\n now = now || _.now();\n var elapsedTime = now - this.startTime;\n if (elapsedTime < 0 || elapsedTime >= 60000) {\n this.startTime = now;\n this.perMinCounter = 0;\n }\n\n var globalRateLimit = RateLimiter.globalSettings.maxItems;\n var globalRateLimitPerMin = RateLimiter.globalSettings.itemsPerMinute;\n\n if (checkRate(item, globalRateLimit, this.counter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimit + ' max items reached', false);\n } else if (checkRate(item, globalRateLimitPerMin, this.perMinCounter)) {\n return shouldSendValue(this.platform, this.platformOptions, globalRateLimitPerMin + ' items per minute reached', false);\n }\n this.counter++;\n this.perMinCounter++;\n\n var shouldSend = !checkRate(item, globalRateLimit, this.counter);\n var perMinute = shouldSend;\n shouldSend = shouldSend && !checkRate(item, globalRateLimitPerMin, this.perMinCounter);\n return shouldSendValue(this.platform, this.platformOptions, null, shouldSend, globalRateLimit, globalRateLimitPerMin, perMinute);\n};\n\nRateLimiter.prototype.setPlatformOptions = function(platform, options) {\n this.platform = platform;\n this.platformOptions = options;\n};\n\n/* Helpers */\n\nfunction checkRate(item, limit, counter) {\n return !item.ignoreRateLimit && limit >= 1 && counter > limit;\n}\n\nfunction shouldSendValue(platform, options, error, shouldSend, globalRateLimit, limitPerMin, perMinute) {\n var payload = null;\n if (error) {\n error = new Error(error);\n }\n if (!error && !shouldSend) {\n payload = rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute);\n }\n return {error: error, shouldSend: shouldSend, payload: payload};\n}\n\nfunction rateLimitPayload(platform, options, globalRateLimit, limitPerMin, perMinute) {\n var environment = options.environment || (options.payload && options.payload.environment);\n var msg;\n if (perMinute) {\n msg = 'item per minute limit reached, ignoring errors until timeout';\n } else {\n msg = 'maxItems has been hit, ignoring errors until reset.';\n }\n var item = {\n body: {\n message: {\n body: msg,\n extra: {\n maxItems: globalRateLimit,\n itemsPerMinute: limitPerMin\n }\n }\n },\n language: 'javascript',\n environment: environment,\n notifier: {\n version: (options.notifier && options.notifier.version) || options.version\n }\n };\n if (platform === 'browser') {\n item.platform = 'browser';\n item.framework = 'browser-js';\n item.notifier.name = 'rollbar-browser-js';\n } else if (platform === 'server') {\n item.framework = options.framework || 'node-js';\n item.notifier.name = options.notifier.name;\n } else if (platform === 'react-native') {\n item.framework = options.framework || 'react-native';\n item.notifier.name = options.notifier.name;\n }\n return item;\n}\n\nmodule.exports = RateLimiter;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) {/**/}\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\nfunction merge() {\n var i, src, copy, clone, name,\n result = {},\n current = null,\n length = arguments.length;\n\n for (i=0; i < length; i++) {\n current = arguments[i];\n if (current == null) {\n continue;\n }\n\n for (name in current) {\n src = result[name];\n copy = current[name];\n if (result !== copy) {\n if (copy && isPlainObject(copy)) {\n clone = src && isPlainObject(src) ? src : {};\n result[name] = merge(clone, copy);\n } else if (typeof copy !== 'undefined') {\n result[name] = copy;\n }\n }\n }\n }\n return result;\n}\n\nmodule.exports = merge;\n","// json3.js\n// 2017-02-21\n// Public Domain.\n// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.\n// See http://www.JSON.org/js.html\n// This code should be minified before deployment.\n// See http://javascript.crockford.com/jsmin.html\n\n// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO\n// NOT CONTROL.\n\n// This file creates a global JSON object containing two methods: stringify\n// and parse. This file provides the ES5 JSON capability to ES3 systems.\n// If a project might run on IE8 or earlier, then this file should be included.\n// This file does nothing on ES5 systems.\n\n// JSON.stringify(value, replacer, space)\n// value any JavaScript value, usually an object or array.\n// replacer an optional parameter that determines how object\n// values are stringified for objects. It can be a\n// function or an array of strings.\n// space an optional parameter that specifies the indentation\n// of nested structures. If it is omitted, the text will\n// be packed without extra whitespace. If it is a number,\n// it will specify the number of spaces to indent at each\n// level. If it is a string (such as \"\\t\" or \" \"),\n// it contains the characters used to indent at each level.\n// This method produces a JSON text from a JavaScript value.\n// When an object value is found, if the object contains a toJSON\n// method, its toJSON method will be called and the result will be\n// stringified. A toJSON method does not serialize: it returns the\n// value represented by the name/value pair that should be serialized,\n// or undefined if nothing should be serialized. The toJSON method\n// will be passed the key associated with the value, and this will be\n// bound to the value.\n\n// For example, this would serialize Dates as ISO strings.\n\n// Date.prototype.toJSON = function (key) {\n// function f(n) {\n// // Format integers to have at least two digits.\n// return (n < 10)\n// ? \"0\" + n\n// : n;\n// }\n// return this.getUTCFullYear() + \"-\" +\n// f(this.getUTCMonth() + 1) + \"-\" +\n// f(this.getUTCDate()) + \"T\" +\n// f(this.getUTCHours()) + \":\" +\n// f(this.getUTCMinutes()) + \":\" +\n// f(this.getUTCSeconds()) + \"Z\";\n// };\n\n// You can provide an optional replacer method. It will be passed the\n// key and value of each member, with this bound to the containing\n// object. The value that is returned from your method will be\n// serialized. If your method returns undefined, then the member will\n// be excluded from the serialization.\n\n// If the replacer parameter is an array of strings, then it will be\n// used to select the members to be serialized. It filters the results\n// such that only members with keys listed in the replacer array are\n// stringified.\n\n// Values that do not have JSON representations, such as undefined or\n// functions, will not be serialized. Such values in objects will be\n// dropped; in arrays they will be replaced with null. You can use\n// a replacer function to replace those with JSON values.\n\n// JSON.stringify(undefined) returns undefined.\n\n// The optional space parameter produces a stringification of the\n// value that is filled with line breaks and indentation to make it\n// easier to read.\n\n// If the space parameter is a non-empty string, then that string will\n// be used for indentation. If the space parameter is a number, then\n// the indentation will be that many spaces.\n\n// Example:\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}]);\n// // text is '[\"e\",{\"pluribus\":\"unum\"}]'\n\n// text = JSON.stringify([\"e\", {pluribus: \"unum\"}], null, \"\\t\");\n// // text is '[\\n\\t\"e\",\\n\\t{\\n\\t\\t\"pluribus\": \"unum\"\\n\\t}\\n]'\n\n// text = JSON.stringify([new Date()], function (key, value) {\n// return this[key] instanceof Date\n// ? \"Date(\" + this[key] + \")\"\n// : value;\n// });\n// // text is '[\"Date(---current time---)\"]'\n\n// JSON.parse(text, reviver)\n// This method parses a JSON text to produce an object or array.\n// It can throw a SyntaxError exception.\n// This has been modified to use JSON-js/json_parse_state.js as the\n// parser instead of the one built around eval found in JSON-js/json2.js\n\n// The optional reviver parameter is a function that can filter and\n// transform the results. It receives each of the keys and values,\n// and its return value is used instead of the original value.\n// If it returns what it received, then the structure is not modified.\n// If it returns undefined then the member is deleted.\n\n// Example:\n\n// // Parse the text. Values that look like ISO date strings will\n// // be converted to Date objects.\n\n// myData = JSON.parse(text, function (key, value) {\n// var a;\n// if (typeof value === \"string\") {\n// a =\n// /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2}):(\\d{2}(?:\\.\\d*)?)Z$/.exec(value);\n// if (a) {\n// return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4],\n// +a[5], +a[6]));\n// }\n// }\n// return value;\n// });\n\n// myData = JSON.parse('[\"Date(09/09/2001)\"]', function (key, value) {\n// var d;\n// if (typeof value === \"string\" &&\n// value.slice(0, 5) === \"Date(\" &&\n// value.slice(-1) === \")\") {\n// d = new Date(value.slice(5, -1));\n// if (d) {\n// return d;\n// }\n// }\n// return value;\n// });\n\n// This is a reference implementation. You are free to copy, modify, or\n// redistribute.\n\n/*jslint\n for, this\n */\n\n/*property\n JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,\n getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,\n lastIndex, length, parse, prototype, push, replace, slice, stringify,\n test, toJSON, toString, valueOf\n */\n\nvar setupCustomJSON = function(JSON) {\n\n var rx_one = /^[\\],:{}\\s]*$/;\n var rx_two = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n var rx_three = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n var rx_four = /(?:^|:|,)(?:\\s*\\[)+/g;\n var rx_escapable = /[\\\\\"\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n var rx_dangerous = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g;\n\n function f(n) {\n // Format integers to have at least two digits.\n return n < 10\n ? \"0\" + n\n : n;\n }\n\n function this_value() {\n return this.valueOf();\n }\n\n if (typeof Date.prototype.toJSON !== \"function\") {\n\n Date.prototype.toJSON = function () {\n\n return isFinite(this.valueOf())\n ? this.getUTCFullYear() + \"-\" +\n f(this.getUTCMonth() + 1) + \"-\" +\n f(this.getUTCDate()) + \"T\" +\n f(this.getUTCHours()) + \":\" +\n f(this.getUTCMinutes()) + \":\" +\n f(this.getUTCSeconds()) + \"Z\"\n : null;\n };\n\n Boolean.prototype.toJSON = this_value;\n Number.prototype.toJSON = this_value;\n String.prototype.toJSON = this_value;\n }\n\n var gap;\n var indent;\n var meta;\n var rep;\n\n\n function quote(string) {\n\n // If the string contains no control characters, no quote characters, and no\n // backslash characters, then we can safely slap some quotes around it.\n // Otherwise we must also replace the offending characters with safe escape\n // sequences.\n\n rx_escapable.lastIndex = 0;\n return rx_escapable.test(string)\n ? \"\\\"\" + string.replace(rx_escapable, function (a) {\n var c = meta[a];\n return typeof c === \"string\"\n ? c\n : \"\\\\u\" + (\"0000\" + a.charCodeAt(0).toString(16)).slice(-4);\n }) + \"\\\"\"\n : \"\\\"\" + string + \"\\\"\";\n }\n\n\n function str(key, holder) {\n\n // Produce a string from holder[key].\n\n var i; // The loop counter.\n var k; // The member key.\n var v; // The member value.\n var length;\n var mind = gap;\n var partial;\n var value = holder[key];\n\n // If the value has a toJSON method, call it to obtain a replacement value.\n\n if (value && typeof value === \"object\" &&\n typeof value.toJSON === \"function\") {\n value = value.toJSON(key);\n }\n\n // If we were called with a replacer function, then call the replacer to\n // obtain a replacement value.\n\n if (typeof rep === \"function\") {\n value = rep.call(holder, key, value);\n }\n\n // What happens next depends on the value's type.\n\n switch (typeof value) {\n case \"string\":\n return quote(value);\n\n case \"number\":\n\n // JSON numbers must be finite. Encode non-finite numbers as null.\n\n return isFinite(value)\n ? String(value)\n : \"null\";\n\n case \"boolean\":\n case \"null\":\n\n // If the value is a boolean or null, convert it to a string. Note:\n // typeof null does not produce \"null\". The case is included here in\n // the remote chance that this gets fixed someday.\n\n return String(value);\n\n // If the type is \"object\", we might be dealing with an object or an array or\n // null.\n\n case \"object\":\n\n // Due to a specification blunder in ECMAScript, typeof null is \"object\",\n // so watch out for that case.\n\n if (!value) {\n return \"null\";\n }\n\n // Make an array to hold the partial results of stringifying this object value.\n\n gap += indent;\n partial = [];\n\n // Is the value an array?\n\n if (Object.prototype.toString.apply(value) === \"[object Array]\") {\n\n // The value is an array. Stringify every element. Use null as a placeholder\n // for non-JSON values.\n\n length = value.length;\n for (i = 0; i < length; i += 1) {\n partial[i] = str(i, value) || \"null\";\n }\n\n // Join all of the elements together, separated with commas, and wrap them in\n // brackets.\n\n v = partial.length === 0\n ? \"[]\"\n : gap\n ? \"[\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"]\"\n : \"[\" + partial.join(\",\") + \"]\";\n gap = mind;\n return v;\n }\n\n // If the replacer is an array, use it to select the members to be stringified.\n\n if (rep && typeof rep === \"object\") {\n length = rep.length;\n for (i = 0; i < length; i += 1) {\n if (typeof rep[i] === \"string\") {\n k = rep[i];\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n } else {\n\n // Otherwise, iterate through all of the keys in the object.\n\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(value, k)) {\n v = str(k, value);\n if (v) {\n partial.push(quote(k) + (\n gap\n ? \": \"\n : \":\"\n ) + v);\n }\n }\n }\n }\n\n // Join all of the member texts together, separated with commas,\n // and wrap them in braces.\n\n v = partial.length === 0\n ? \"{}\"\n : gap\n ? \"{\\n\" + gap + partial.join(\",\\n\" + gap) + \"\\n\" + mind + \"}\"\n : \"{\" + partial.join(\",\") + \"}\";\n gap = mind;\n return v;\n }\n }\n\n // If the JSON object does not yet have a stringify method, give it one.\n\n if (typeof JSON.stringify !== \"function\") {\n meta = { // table of character substitutions\n \"\\b\": \"\\\\b\",\n \"\\t\": \"\\\\t\",\n \"\\n\": \"\\\\n\",\n \"\\f\": \"\\\\f\",\n \"\\r\": \"\\\\r\",\n \"\\\"\": \"\\\\\\\"\",\n \"\\\\\": \"\\\\\\\\\"\n };\n JSON.stringify = function (value, replacer, space) {\n\n // The stringify method takes a value and an optional replacer, and an optional\n // space parameter, and returns a JSON text. The replacer can be a function\n // that can replace values, or an array of strings that will select the keys.\n // A default replacer method can be provided. Use of the space parameter can\n // produce text that is more easily readable.\n\n var i;\n gap = \"\";\n indent = \"\";\n\n // If the space parameter is a number, make an indent string containing that\n // many spaces.\n\n if (typeof space === \"number\") {\n for (i = 0; i < space; i += 1) {\n indent += \" \";\n }\n\n // If the space parameter is a string, it will be used as the indent string.\n\n } else if (typeof space === \"string\") {\n indent = space;\n }\n\n // If there is a replacer, it must be a function or an array.\n // Otherwise, throw an error.\n\n rep = replacer;\n if (replacer && typeof replacer !== \"function\" &&\n (typeof replacer !== \"object\" ||\n typeof replacer.length !== \"number\")) {\n throw new Error(\"JSON.stringify\");\n }\n\n // Make a fake root object containing our value under the key of \"\".\n // Return the result of stringifying the value.\n\n return str(\"\", {\"\": value});\n };\n }\n\n\n // If the JSON object does not yet have a parse method, give it one.\n\n if (typeof JSON.parse !== \"function\") {\n JSON.parse = (function () {\n\n // This function creates a JSON parse function that uses a state machine rather\n // than the dangerous eval function to parse a JSON text.\n\n var state; // The state of the parser, one of\n // 'go' The starting state\n // 'ok' The final, accepting state\n // 'firstokey' Ready for the first key of the object or\n // the closing of an empty object\n // 'okey' Ready for the next key of the object\n // 'colon' Ready for the colon\n // 'ovalue' Ready for the value half of a key/value pair\n // 'ocomma' Ready for a comma or closing }\n // 'firstavalue' Ready for the first value of an array or\n // an empty array\n // 'avalue' Ready for the next value of an array\n // 'acomma' Ready for a comma or closing ]\n var stack; // The stack, for controlling nesting.\n var container; // The current container object or array\n var key; // The current key\n var value; // The current value\n var escapes = { // Escapement translation table\n \"\\\\\": \"\\\\\",\n \"\\\"\": \"\\\"\",\n \"/\": \"/\",\n \"t\": \"\\t\",\n \"n\": \"\\n\",\n \"r\": \"\\r\",\n \"f\": \"\\f\",\n \"b\": \"\\b\"\n };\n var string = { // The actions for string tokens\n go: function () {\n state = \"ok\";\n },\n firstokey: function () {\n key = value;\n state = \"colon\";\n },\n okey: function () {\n key = value;\n state = \"colon\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var number = { // The actions for number tokens\n go: function () {\n state = \"ok\";\n },\n ovalue: function () {\n state = \"ocomma\";\n },\n firstavalue: function () {\n state = \"acomma\";\n },\n avalue: function () {\n state = \"acomma\";\n }\n };\n var action = {\n\n // The action table describes the behavior of the machine. It contains an\n // object for each token. Each object contains a method that is called when\n // a token is matched in a state. An object will lack a method for illegal\n // states.\n\n \"{\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = {};\n state = \"firstokey\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = {};\n state = \"firstokey\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = {};\n state = \"firstokey\";\n }\n },\n \"}\": {\n firstokey: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n ocomma: function () {\n var pop = stack.pop();\n container[key] = value;\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \"[\": {\n go: function () {\n stack.push({state: \"ok\"});\n container = [];\n state = \"firstavalue\";\n },\n ovalue: function () {\n stack.push({container: container, state: \"ocomma\", key: key});\n container = [];\n state = \"firstavalue\";\n },\n firstavalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n },\n avalue: function () {\n stack.push({container: container, state: \"acomma\"});\n container = [];\n state = \"firstavalue\";\n }\n },\n \"]\": {\n firstavalue: function () {\n var pop = stack.pop();\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n },\n acomma: function () {\n var pop = stack.pop();\n container.push(value);\n value = container;\n container = pop.container;\n key = pop.key;\n state = pop.state;\n }\n },\n \":\": {\n colon: function () {\n if (Object.hasOwnProperty.call(container, key)) {\n throw new SyntaxError(\"Duplicate key '\" + key + \"\\\"\");\n }\n state = \"ovalue\";\n }\n },\n \",\": {\n ocomma: function () {\n container[key] = value;\n state = \"okey\";\n },\n acomma: function () {\n container.push(value);\n state = \"avalue\";\n }\n },\n \"true\": {\n go: function () {\n value = true;\n state = \"ok\";\n },\n ovalue: function () {\n value = true;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = true;\n state = \"acomma\";\n },\n avalue: function () {\n value = true;\n state = \"acomma\";\n }\n },\n \"false\": {\n go: function () {\n value = false;\n state = \"ok\";\n },\n ovalue: function () {\n value = false;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = false;\n state = \"acomma\";\n },\n avalue: function () {\n value = false;\n state = \"acomma\";\n }\n },\n \"null\": {\n go: function () {\n value = null;\n state = \"ok\";\n },\n ovalue: function () {\n value = null;\n state = \"ocomma\";\n },\n firstavalue: function () {\n value = null;\n state = \"acomma\";\n },\n avalue: function () {\n value = null;\n state = \"acomma\";\n }\n }\n };\n\n function debackslashify(text) {\n\n // Remove and replace any backslash escapement.\n\n return text.replace(/\\\\(?:u(.{4})|([^u]))/g, function (ignore, b, c) {\n return b\n ? String.fromCharCode(parseInt(b, 16))\n : escapes[c];\n });\n }\n\n return function (source, reviver) {\n\n // A regular expression is used to extract tokens from the JSON text.\n // The extraction process is cautious.\n\n var result;\n var tx = /^[\\u0020\\t\\n\\r]*(?:([,:\\[\\]{}]|true|false|null)|(-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)|\"((?:[^\\r\\n\\t\\\\\\\"]|\\\\(?:[\"\\\\\\/trnfb]|u[0-9a-fA-F]{4}))*)\")/;\n\n // Set the starting state.\n\n state = \"go\";\n\n // The stack records the container, key, and state for each object or array\n // that contains another object or array while processing nested structures.\n\n stack = [];\n\n // If any error occurs, we will catch it and ultimately throw a syntax error.\n\n try {\n\n // For each token...\n\n while (true) {\n result = tx.exec(source);\n if (!result) {\n break;\n }\n\n // result is the result array from matching the tokenizing regular expression.\n // result[0] contains everything that matched, including any initial whitespace.\n // result[1] contains any punctuation that was matched, or true, false, or null.\n // result[2] contains a matched number, still in string form.\n // result[3] contains a matched string, without quotes but with escapement.\n\n if (result[1]) {\n\n // Token: Execute the action for this state and token.\n\n action[result[1]][state]();\n\n } else if (result[2]) {\n\n // Number token: Convert the number string into a number value and execute\n // the action for this state and number.\n\n value = +result[2];\n number[state]();\n } else {\n\n // String token: Replace the escapement sequences and execute the action for\n // this state and string.\n\n value = debackslashify(result[3]);\n string[state]();\n }\n\n // Remove the token from the string. The loop will continue as long as there\n // are tokens. This is a slow process, but it allows the use of ^ matching,\n // which assures that no illegal tokens slip through.\n\n source = source.slice(result[0].length);\n }\n\n // If we find a state/token combination that is illegal, then the action will\n // cause an error. We handle the error by simply changing the state.\n\n } catch (e) {\n state = e;\n }\n\n // The parsing is finished. If we are not in the final \"ok\" state, or if the\n // remaining source contains anything except whitespace, then we did not have\n //a well-formed JSON text.\n\n if (state !== \"ok\" || (/[^\\u0020\\t\\n\\r]/.test(source))) {\n throw (state instanceof SyntaxError)\n ? state\n : new SyntaxError(\"JSON\");\n }\n\n // If there is a reviver function, we recursively walk the new structure,\n // passing each name/value pair to the reviver function for possible\n // transformation, starting with a temporary root object that holds the current\n // value in an empty key. If there is not a reviver function, we simply return\n // that value.\n\n return (typeof reviver === \"function\")\n ? (function walk(holder, key) {\n var k;\n var v;\n var val = holder[key];\n if (val && typeof val === \"object\") {\n for (k in value) {\n if (Object.prototype.hasOwnProperty.call(val, k)) {\n v = walk(val, k);\n if (v !== undefined) {\n val[k] = v;\n } else {\n delete val[k];\n }\n }\n }\n }\n return reviver.call(holder, key, val);\n }({\"\": value}, \"\"))\n : value;\n };\n }());\n }\n}\n\nmodule.exports = setupCustomJSON;\n","var _ = require('./utility');\n\n/*\n * Queue - an object which handles which handles a queue of items to be sent to Rollbar.\n * This object handles rate limiting via a passed in rate limiter, retries based on connection\n * errors, and filtering of items based on a set of configurable predicates. The communication to\n * the backend is performed via a given API object.\n *\n * @param rateLimiter - An object which conforms to the interface\n * rateLimiter.shouldSend(item) -> bool\n * @param api - An object which conforms to the interface\n * api.postItem(payload, function(err, response))\n * @param logger - An object used to log verbose messages if desired\n * @param options - see Queue.prototype.configure\n */\nfunction Queue(rateLimiter, api, logger, options) {\n this.rateLimiter = rateLimiter;\n this.api = api;\n this.logger = logger;\n this.options = options;\n this.predicates = [];\n this.pendingItems = [];\n this.pendingRequests = [];\n this.retryQueue = [];\n this.retryHandle = null;\n this.waitCallback = null;\n this.waitIntervalID = null;\n}\n\n/*\n * configure - updates the options this queue uses\n *\n * @param options\n */\nQueue.prototype.configure = function(options) {\n this.api && this.api.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addPredicate - adds a predicate to the end of the list of predicates for this queue\n *\n * @param predicate - function(item, options) -> (bool|{err: Error})\n * Returning true means that this predicate passes and the item is okay to go on the queue\n * Returning false means do not add the item to the queue, but it is not an error\n * Returning {err: Error} means do not add the item to the queue, and the given error explains why\n * Returning {err: undefined} is equivalent to returning true but don't do that\n */\nQueue.prototype.addPredicate = function(predicate) {\n if (_.isFunction(predicate)) {\n this.predicates.push(predicate);\n }\n return this;\n};\n\nQueue.prototype.addPendingItem = function(item) {\n this.pendingItems.push(item);\n};\n\nQueue.prototype.removePendingItem = function(item) {\n var idx = this.pendingItems.indexOf(item);\n if (idx !== -1) {\n this.pendingItems.splice(idx, 1);\n }\n};\n\n/*\n * addItem - Send an item to the Rollbar API if all of the predicates are satisfied\n *\n * @param item - The payload to send to the backend\n * @param callback - function(error, repsonse) which will be called with the response from the API\n * in the case of a success, otherwise response will be null and error will have a value. If both\n * error and response are null then the item was stopped by a predicate which did not consider this\n * to be an error condition, but nonetheless did not send the item to the API.\n * @param originalError - The original error before any transformations that is to be logged if any\n */\nQueue.prototype.addItem = function(item, callback, originalError, originalItem) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() { return; };\n }\n var predicateResult = this._applyPredicates(item);\n if (predicateResult.stop) {\n this.removePendingItem(originalItem);\n callback(predicateResult.err);\n return;\n }\n this._maybeLog(item, originalError);\n this.removePendingItem(originalItem);\n if (!this.options.transmit) {\n callback(new Error('Transmit disabled'));\n return;\n }\n this.pendingRequests.push(item);\n try {\n this._makeApiRequest(item, function(err, resp) {\n this._dequeuePendingRequest(item);\n callback(err, resp);\n }.bind(this));\n } catch (e) {\n this._dequeuePendingRequest(item);\n callback(e);\n }\n};\n\n/*\n * wait - Stop any further errors from being added to the queue, and get called back when all items\n * currently processing have finished sending to the backend.\n *\n * @param callback - function() called when all pending items have been sent\n */\nQueue.prototype.wait = function(callback) {\n if (!_.isFunction(callback)) {\n return;\n }\n this.waitCallback = callback;\n if (this._maybeCallWait()) {\n return;\n }\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitIntervalID = setInterval(function() {\n this._maybeCallWait();\n }.bind(this), 500);\n};\n\n/* _applyPredicates - Sequentially applies the predicates that have been added to the queue to the\n * given item with the currently configured options.\n *\n * @param item - An item in the queue\n * @returns {stop: bool, err: (Error|null)} - stop being true means do not add item to the queue,\n * the error value should be passed up to a callbak if we are stopping.\n */\nQueue.prototype._applyPredicates = function(item) {\n var p = null;\n for (var i = 0, len = this.predicates.length; i < len; i++) {\n p = this.predicates[i](item, this.options);\n if (!p || p.err !== undefined) {\n return {stop: true, err: p.err};\n }\n }\n return {stop: false, err: null};\n};\n\n/*\n * _makeApiRequest - Send an item to Rollbar, callback when done, if there is an error make an\n * effort to retry if we are configured to do so.\n *\n * @param item - an item ready to send to the backend\n * @param callback - function(err, response)\n */\nQueue.prototype._makeApiRequest = function(item, callback) {\n var rateLimitResponse = this.rateLimiter.shouldSend(item);\n if (rateLimitResponse.shouldSend) {\n this.api.postItem(item, function(err, resp) {\n if (err) {\n this._maybeRetry(err, item, callback);\n } else {\n callback(err, resp);\n }\n }.bind(this));\n } else if (rateLimitResponse.error) {\n callback(rateLimitResponse.error);\n } else {\n this.api.postItem(rateLimitResponse.payload, callback);\n }\n};\n\n// These are errors basically mean there is no internet connection\nvar RETRIABLE_ERRORS = ['ECONNRESET', 'ENOTFOUND', 'ESOCKETTIMEDOUT', 'ETIMEDOUT', 'ECONNREFUSED', 'EHOSTUNREACH', 'EPIPE', 'EAI_AGAIN'];\n\n/*\n * _maybeRetry - Given the error returned by the API, decide if we should retry or just callback\n * with the error.\n *\n * @param err - an error returned by the API transport\n * @param item - the item that was trying to be sent when this error occured\n * @param callback - function(err, response)\n */\nQueue.prototype._maybeRetry = function(err, item, callback) {\n var shouldRetry = false;\n if (this.options.retryInterval) {\n for (var i = 0, len = RETRIABLE_ERRORS.length; i < len; i++) {\n if (err.code === RETRIABLE_ERRORS[i]) {\n shouldRetry = true;\n break;\n }\n }\n }\n if (shouldRetry) {\n this._retryApiRequest(item, callback);\n } else {\n callback(err);\n }\n};\n\n/*\n * _retryApiRequest - Add an item and a callback to a queue and possibly start a timer to process\n * that queue based on the retryInterval in the options for this queue.\n *\n * @param item - an item that failed to send due to an error we deem retriable\n * @param callback - function(err, response)\n */\nQueue.prototype._retryApiRequest = function(item, callback) {\n this.retryQueue.push({item: item, callback: callback});\n\n if (!this.retryHandle) {\n this.retryHandle = setInterval(function() {\n while (this.retryQueue.length) {\n var retryObject = this.retryQueue.shift();\n this._makeApiRequest(retryObject.item, retryObject.callback);\n }\n }.bind(this), this.options.retryInterval);\n }\n};\n\n/*\n * _dequeuePendingRequest - Removes the item from the pending request queue, this queue is used to\n * enable to functionality of providing a callback that clients can pass to `wait` to be notified\n * when the pending request queue has been emptied. This must be called when the API finishes\n * processing this item. If a `wait` callback is configured, it is called by this function.\n *\n * @param item - the item previously added to the pending request queue\n */\nQueue.prototype._dequeuePendingRequest = function(item) {\n var idx = this.pendingRequests.indexOf(item);\n if (idx !== -1) {\n this.pendingRequests.splice(idx, 1);\n this._maybeCallWait();\n }\n};\n\nQueue.prototype._maybeLog = function(data, originalError) {\n if (this.logger && this.options.verbose) {\n var message = originalError;\n message = message || _.get(data, 'body.trace.exception.message');\n message = message || _.get(data, 'body.trace_chain.0.exception.message');\n if (message) {\n this.logger.error(message);\n return;\n }\n message = _.get(data, 'body.message.body');\n if (message) {\n this.logger.log(message);\n }\n }\n};\n\nQueue.prototype._maybeCallWait = function() {\n if (_.isFunction(this.waitCallback) && this.pendingItems.length === 0 && this.pendingRequests.length === 0) {\n if (this.waitIntervalID) {\n this.waitIntervalID = clearInterval(this.waitIntervalID);\n }\n this.waitCallback();\n return true;\n }\n return false;\n};\n\nmodule.exports = Queue;\n","var _ = require('./utility');\n\n/*\n * Notifier - the internal object responsible for delegating between the client exposed API, the\n * chain of transforms necessary to turn an item into something that can be sent to Rollbar, and the\n * queue which handles the communcation with the Rollbar API servers.\n *\n * @param queue - an object that conforms to the interface: addItem(item, callback)\n * @param options - an object representing the options to be set for this notifier, this should have\n * any defaults already set by the caller\n */\nfunction Notifier(queue, options) {\n this.queue = queue;\n this.options = options;\n this.transforms = [];\n}\n\n/*\n * configure - updates the options for this notifier with the passed in object\n *\n * @param options - an object which gets merged with the current options set on this notifier\n * @returns this\n */\nNotifier.prototype.configure = function(options) {\n this.queue && this.queue.configure(options);\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n return this;\n};\n\n/*\n * addTransform - adds a transform onto the end of the queue of transforms for this notifier\n *\n * @param transform - a function which takes three arguments:\n * * item: An Object representing the data to eventually be sent to Rollbar\n * * options: The current value of the options for this notifier\n * * callback: function(err: (Null|Error), item: (Null|Object)) the transform must call this\n * callback with a null value for error if it wants the processing chain to continue, otherwise\n * with an error to terminate the processing. The item should be the updated item after this\n * transform is finished modifying it.\n */\nNotifier.prototype.addTransform = function(transform) {\n if (_.isFunction(transform)) {\n this.transforms.push(transform);\n }\n return this;\n};\n\n/*\n * log - the internal log function which applies the configured transforms and then pushes onto the\n * queue to be sent to the backend.\n *\n * @param item - An object with the following structure:\n * message [String] - An optional string to be sent to rollbar\n * error [Error] - An optional error\n *\n * @param callback - A function of type function(err, resp) which will be called with exactly one\n * null argument and one non-null argument. The callback will be called once, either during the\n * transform stage if an error occurs inside a transform, or in response to the communication with\n * the backend. The second argument will be the response from the backend in case of success.\n */\nNotifier.prototype.log = function(item, callback) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!this.options.enabled) {\n return callback(new Error('Rollbar is not enabled'));\n }\n\n this.queue.addPendingItem(item);\n var originalError = item.err;\n this._applyTransforms(item, function(err, i) {\n if (err) {\n this.queue.removePendingItem(item);\n return callback(err, null);\n }\n this.queue.addItem(i, callback, originalError, item);\n }.bind(this));\n};\n\n/* Internal */\n\n/*\n * _applyTransforms - Applies the transforms that have been added to this notifier sequentially. See\n * `addTransform` for more information.\n *\n * @param item - An item to be transformed\n * @param callback - A function of type function(err, item) which will be called with a non-null\n * error and a null item in the case of a transform failure, or a null error and non-null item after\n * all transforms have been applied.\n */\nNotifier.prototype._applyTransforms = function(item, callback) {\n var transformIndex = -1;\n var transformsLength = this.transforms.length;\n var transforms = this.transforms;\n var options = this.options;\n\n var cb = function(err, i) {\n if (err) {\n callback(err, null);\n return;\n }\n\n transformIndex++;\n\n if (transformIndex === transformsLength) {\n callback(null, i);\n return;\n }\n\n transforms[transformIndex](i, options, cb);\n };\n\n cb(null, item);\n};\n\nmodule.exports = Notifier;\n","var _ = require('./utility');\n\nvar MAX_EVENTS = 100;\n\nfunction Telemeter(options) {\n this.queue = [];\n this.options = _.merge(options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n this.maxQueueSize = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n}\n\nTelemeter.prototype.configure = function(options) {\n var oldOptions = this.options;\n this.options = _.merge(oldOptions, options);\n var maxTelemetryEvents = this.options.maxTelemetryEvents || MAX_EVENTS;\n var newMaxEvents = Math.max(0, Math.min(maxTelemetryEvents, MAX_EVENTS));\n var deleteCount = 0;\n if (this.maxQueueSize > newMaxEvents) {\n deleteCount = this.maxQueueSize - newMaxEvents;\n }\n this.maxQueueSize = newMaxEvents;\n this.queue.splice(0, deleteCount);\n};\n\nTelemeter.prototype.copyEvents = function() {\n var events = Array.prototype.slice.call(this.queue, 0);\n if (_.isFunction(this.options.filterTelemetry)) {\n try {\n var i = events.length;\n while (i--) {\n if (this.options.filterTelemetry(events[i])) {\n events.splice(i, 1);\n }\n }\n } catch (e) {\n this.options.filterTelemetry = null;\n }\n }\n return events;\n};\n\nTelemeter.prototype.capture = function(type, metadata, level, rollbarUUID, timestamp) {\n var e = {\n level: getLevel(type, level),\n type: type,\n timestamp_ms: timestamp || _.now(),\n body: metadata,\n source: 'client'\n };\n if (rollbarUUID) {\n e.uuid = rollbarUUID;\n }\n\n try {\n if (_.isFunction(this.options.filterTelemetry) && this.options.filterTelemetry(e)) {\n return false;\n }\n } catch (exc) {\n this.options.filterTelemetry = null;\n }\n\n this.push(e);\n return e;\n};\n\nTelemeter.prototype.captureEvent = function(type, metadata, level, rollbarUUID) {\n return this.capture(type, metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.captureError = function(err, level, rollbarUUID, timestamp) {\n var metadata = {\n message: err.message || String(err)\n };\n if (err.stack) {\n metadata.stack = err.stack;\n }\n return this.capture('error', metadata, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureLog = function(message, level, rollbarUUID, timestamp) {\n return this.capture('log', {\n message: message\n }, level, rollbarUUID, timestamp);\n};\n\nTelemeter.prototype.captureNetwork = function(metadata, subtype, rollbarUUID, requestData) {\n subtype = subtype || 'xhr';\n metadata.subtype = metadata.subtype || subtype;\n if (requestData) {\n metadata.request = requestData;\n }\n var level = this.levelFromStatus(metadata.status_code);\n return this.capture('network', metadata, level, rollbarUUID);\n};\n\nTelemeter.prototype.levelFromStatus = function(statusCode) {\n if (statusCode >= 200 && statusCode < 400) {\n return 'info';\n }\n if (statusCode === 0 || statusCode >= 400) {\n return 'error';\n }\n return 'info';\n};\n\nTelemeter.prototype.captureDom = function(subtype, element, value, checked, rollbarUUID) {\n var metadata = {\n subtype: subtype,\n element: element\n };\n if (value !== undefined) {\n metadata.value = value;\n }\n if (checked !== undefined) {\n metadata.checked = checked;\n }\n return this.capture('dom', metadata, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureNavigation = function(from, to, rollbarUUID) {\n return this.capture('navigation', {from: from, to: to}, 'info', rollbarUUID);\n};\n\nTelemeter.prototype.captureDomContentLoaded = function(ts) {\n return this.capture('navigation', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'DOMContentLoaded'}, 'info', undefined, ts && ts.getTime());\n */\n};\nTelemeter.prototype.captureLoad = function(ts) {\n return this.capture('navigation', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n /**\n * If we decide to make this a dom event instead, then use the line below:\n return this.capture('dom', {subtype: 'load'}, 'info', undefined, ts && ts.getTime());\n */\n};\n\nTelemeter.prototype.captureConnectivityChange = function(type, rollbarUUID) {\n return this.captureNetwork({change: type}, 'connectivity', rollbarUUID);\n};\n\n// Only intended to be used internally by the notifier\nTelemeter.prototype._captureRollbarItem = function(item) {\n if (!this.options.includeItemsInTelemetry) {\n return;\n }\n if (item.err) {\n return this.captureError(item.err, item.level, item.uuid, item.timestamp);\n }\n if (item.message) {\n return this.captureLog(item.message, item.level, item.uuid, item.timestamp);\n }\n if (item.custom) {\n return this.capture('log', item.custom, item.level, item.uuid, item.timestamp);\n }\n};\n\nTelemeter.prototype.push = function(e) {\n this.queue.push(e);\n if (this.queue.length > this.maxQueueSize) {\n this.queue.shift();\n }\n};\n\nfunction getLevel(type, level) {\n if (level) {\n return level;\n }\n var defaultLevel = {\n error: 'error',\n manual: 'info'\n };\n return defaultLevel[type] || 'info';\n}\n\nmodule.exports = Telemeter;\n","var _ = require('./utility');\nvar helpers = require('./apiUtility');\nvar truncation = require('./truncation');\n\nvar defaultOptions = {\n hostname: 'api.rollbar.com',\n path: '/api/1/item/',\n search: null,\n version: '1',\n protocol: 'https:',\n port: 443\n};\n\n/**\n * Api is an object that encapsulates methods of communicating with\n * the Rollbar API. It is a standard interface with some parts implemented\n * differently for server or browser contexts. It is an object that should\n * be instantiated when used so it can contain non-global options that may\n * be different for another instance of RollbarApi.\n *\n * @param options {\n * accessToken: the accessToken to use for posting items to rollbar\n * endpoint: an alternative endpoint to send errors to\n * must be a valid, fully qualified URL.\n * The default is: https://api.rollbar.com/api/1/item\n * proxy: if you wish to proxy requests provide an object\n * with the following keys:\n * host or hostname (required): foo.example.com\n * port (optional): 123\n * protocol (optional): https\n * }\n */\nfunction Api(options, t, u, j) {\n this.options = options;\n this.transport = t;\n this.url = u;\n this.jsonBackup = j;\n this.accessToken = options.accessToken;\n this.transportOptions = _getTransport(options, u);\n}\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.postItem = function(data, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n this.transport.post(this.accessToken, transportOptions, payload, callback);\n};\n\n/**\n *\n * @param data\n * @param callback\n */\nApi.prototype.buildJsonPayload = function(data, callback) {\n var payload = helpers.buildPayload(this.accessToken, data, this.jsonBackup);\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n if (callback) {\n callback(stringifyResult.error);\n }\n return null;\n }\n\n return stringifyResult.value;\n};\n\n/**\n *\n * @param jsonPayload\n * @param callback\n */\nApi.prototype.postJsonPayload = function(jsonPayload, callback) {\n var transportOptions = helpers.transportOptions(this.transportOptions, 'POST');\n this.transport.postJsonPayload(this.accessToken, transportOptions, jsonPayload, callback);\n};\n\nApi.prototype.configure = function(options) {\n var oldOptions = this.oldOptions;\n this.options = _.merge(oldOptions, options);\n this.transportOptions = _getTransport(this.options, this.url);\n if (this.options.accessToken !== undefined) {\n this.accessToken = this.options.accessToken;\n }\n return this;\n};\n\nfunction _getTransport(options, url) {\n return helpers.getTransportFromOptions(options, defaultOptions, url);\n}\n\nmodule.exports = Api;\n","var _ = require('./utility');\n\nfunction buildPayload(accessToken, data, jsonBackup) {\n if (!_.isType(data.context, 'string')) {\n var contextResult = _.stringify(data.context, jsonBackup);\n if (contextResult.error) {\n data.context = 'Error: could not serialize \\'context\\'';\n } else {\n data.context = contextResult.value || '';\n }\n if (data.context.length > 255) {\n data.context = data.context.substr(0, 255);\n }\n }\n return {\n access_token: accessToken,\n data: data\n };\n}\n\nfunction getTransportFromOptions(options, defaults, url) {\n var hostname = defaults.hostname;\n var protocol = defaults.protocol;\n var port = defaults.port;\n var path = defaults.path;\n var search = defaults.search;\n\n var proxy = options.proxy;\n if (options.endpoint) {\n var opts = url.parse(options.endpoint);\n hostname = opts.hostname;\n protocol = opts.protocol;\n port = opts.port;\n path = opts.pathname;\n search = opts.search;\n }\n return {\n hostname: hostname,\n protocol: protocol,\n port: port,\n path: path,\n search: search,\n proxy: proxy\n };\n}\n\nfunction transportOptions(transport, method) {\n var protocol = transport.protocol || 'https:';\n var port = transport.port || (protocol === 'http:' ? 80 : protocol === 'https:' ? 443 : undefined);\n var hostname = transport.hostname;\n var path = transport.path;\n if (transport.search) {\n path = path + transport.search;\n }\n if (transport.proxy) {\n path = protocol + '//' + hostname + path;\n hostname = transport.proxy.host || transport.proxy.hostname;\n port = transport.proxy.port;\n protocol = transport.proxy.protocol || protocol;\n }\n return {\n protocol: protocol,\n hostname: hostname,\n path: path,\n port: port,\n method: method\n };\n}\n\nfunction appendPathToPath(base, path) {\n var baseTrailingSlash = /\\/$/.test(base);\n var pathBeginningSlash = /^\\//.test(path);\n\n if (baseTrailingSlash && pathBeginningSlash) {\n path = path.substring(1);\n } else if (!baseTrailingSlash && !pathBeginningSlash) {\n path = '/' + path;\n }\n\n return base + path;\n}\n\nmodule.exports = {\n buildPayload: buildPayload,\n getTransportFromOptions: getTransportFromOptions,\n transportOptions: transportOptions,\n appendPathToPath: appendPathToPath\n};\n","// Console-polyfill. MIT license.\n// https://github.com/paulmillr/console-polyfill\n// Make it safe to do console.log() always.\n(function(global) {\n 'use strict';\n if (!global.console) {\n global.console = {};\n }\n var con = global.console;\n var prop, method;\n var dummy = function() {};\n var properties = ['memory'];\n var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +\n 'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +\n 'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');\n while (prop = properties.pop()) if (!con[prop]) con[prop] = {};\n while (method = methods.pop()) if (!con[method]) con[method] = dummy;\n // Using `this` for web workers & supports Browserify / Webpack.\n})(typeof window === 'undefined' ? this : window);\n","// This detection.js module is used to encapsulate any ugly browser/feature\n// detection we may need to do.\n\n// Figure out which version of IE we're using, if any.\n// This is gleaned from http://stackoverflow.com/questions/5574842/best-way-to-check-for-ie-less-than-9-in-javascript-without-library\n// Will return an integer on IE (i.e. 8)\n// Will return undefined otherwise\nfunction getIEVersion() {\n\tvar undef;\n\tif (typeof document === 'undefined') {\n\t\treturn undef;\n\t}\n\n var v = 3,\n div = document.createElement('div'),\n all = div.getElementsByTagName('i');\n\n while (\n div.innerHTML = '',\n all[0]\n );\n\n return v > 4 ? v : undef;\n}\n\nvar Detection = {\n ieVersion: getIEVersion\n};\n\nmodule.exports = Detection;\n","function captureUncaughtExceptions(window, handler, shim) {\n if (!window) { return; }\n var oldOnError;\n\n if (typeof handler._rollbarOldOnError === 'function') {\n oldOnError = handler._rollbarOldOnError;\n } else if (window.onerror) {\n oldOnError = window.onerror;\n while (oldOnError._rollbarOldOnError) {\n oldOnError = oldOnError._rollbarOldOnError;\n }\n handler._rollbarOldOnError = oldOnError;\n }\n\n handler.handleAnonymousErrors();\n\n var fn = function() {\n var args = Array.prototype.slice.call(arguments, 0);\n _rollbarWindowOnError(window, handler, oldOnError, args);\n };\n if (shim) {\n fn._rollbarOldOnError = oldOnError;\n }\n window.onerror = fn;\n}\n\nfunction _rollbarWindowOnError(window, r, old, args) {\n if (window._rollbarWrappedError) {\n if (!args[4]) {\n args[4] = window._rollbarWrappedError;\n }\n if (!args[5]) {\n args[5] = window._rollbarWrappedError._rollbarContext;\n }\n window._rollbarWrappedError = null;\n }\n\n var ret = r.handleUncaughtException.apply(r, args);\n\n if (old) {\n old.apply(window, args);\n }\n\n // Let other chained onerror handlers above run before setting this.\n // If an error is thrown and caught within a chained onerror handler,\n // Error.prepareStackTrace() will see that one before the one we want.\n if (ret === 'anonymous') {\n r.anonymousErrorsPending += 1; // See Rollbar.prototype.handleAnonymousErrors()\n }\n}\n\nfunction captureUnhandledRejections(window, handler, shim) {\n if (!window) { return; }\n\n if (typeof window._rollbarURH === 'function' && window._rollbarURH.belongsToShim) {\n window.removeEventListener('unhandledrejection', window._rollbarURH);\n }\n\n var rejectionHandler = function (evt) {\n var reason, promise, detail;\n try {\n reason = evt.reason;\n } catch (e) {\n reason = undefined;\n }\n try {\n promise = evt.promise;\n } catch (e) {\n promise = '[unhandledrejection] error getting `promise` from event';\n }\n try {\n detail = evt.detail;\n if (!reason && detail) {\n reason = detail.reason;\n promise = detail.promise;\n }\n } catch (e) {\n // Ignore\n }\n if (!reason) {\n reason = '[unhandledrejection] error getting `reason` from event';\n }\n\n if (handler && handler.handleUnhandledRejection) {\n handler.handleUnhandledRejection(reason, promise);\n }\n };\n rejectionHandler.belongsToShim = shim;\n window._rollbarURH = rejectionHandler;\n window.addEventListener('unhandledrejection', rejectionHandler);\n}\n\nfunction wrapGlobals(window, handler, shim) {\n if (!window) { return; }\n // Adapted from https://github.com/bugsnag/bugsnag-js\n var globals = '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(',');\n var i, global;\n for (i = 0; i < globals.length; ++i) {\n global = globals[i];\n\n if (window[global] && window[global].prototype) {\n _extendListenerPrototype(handler, window[global].prototype, shim);\n }\n }\n}\n\nfunction _extendListenerPrototype(handler, prototype, shim) {\n if (prototype.hasOwnProperty && prototype.hasOwnProperty('addEventListener')) {\n var oldAddEventListener = prototype.addEventListener;\n while (oldAddEventListener._rollbarOldAdd && oldAddEventListener.belongsToShim) {\n oldAddEventListener = oldAddEventListener._rollbarOldAdd;\n }\n var addFn = function(event, callback, bubble) {\n oldAddEventListener.call(this, event, handler.wrap(callback), bubble);\n };\n addFn._rollbarOldAdd = oldAddEventListener;\n addFn.belongsToShim = shim;\n prototype.addEventListener = addFn;\n\n var oldRemoveEventListener = prototype.removeEventListener;\n while (oldRemoveEventListener._rollbarOldRemove && oldRemoveEventListener.belongsToShim) {\n oldRemoveEventListener = oldRemoveEventListener._rollbarOldRemove;\n }\n var removeFn = function(event, callback, bubble) {\n oldRemoveEventListener.call(this, event, callback && callback._rollbar_wrapped || callback, bubble);\n };\n removeFn._rollbarOldRemove = oldRemoveEventListener;\n removeFn.belongsToShim = shim;\n prototype.removeEventListener = removeFn;\n }\n}\n\nmodule.exports = {\n captureUncaughtExceptions: captureUncaughtExceptions,\n captureUnhandledRejections: captureUnhandledRejections,\n wrapGlobals: wrapGlobals\n};\n","/*global XDomainRequest*/\n\nvar _ = require('../utility');\nvar truncation = require('../truncation');\nvar logger = require('./logger');\n\n/*\n * accessToken may be embedded in payload but that should not\n * be assumed\n *\n * options: {\n * hostname\n * protocol\n * path\n * port\n * method\n * }\n *\n * params is an object containing key/value pairs. These\n * will be appended to the path as 'key=value&key=value'\n *\n * payload is an unserialized object\n */\n\nfunction get(accessToken, options, params, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n _.addParamsAndAccessTokenToPath(accessToken, options, params);\n\n var method = 'GET';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, null, callback, requestFactory);\n}\n\nfunction post(accessToken, options, payload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n if (!payload) {\n return callback(new Error('Cannot send empty request'));\n }\n\n var stringifyResult = truncation.truncate(payload);\n if (stringifyResult.error) {\n return callback(stringifyResult.error);\n }\n\n var writeData = stringifyResult.value;\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, writeData, callback, requestFactory);\n}\n\nfunction postJsonPayload(accessToken, options, jsonPayload, callback, requestFactory) {\n if (!callback || !_.isFunction(callback)) {\n callback = function() {};\n }\n\n var method = 'POST';\n var url = _.formatUrl(options);\n _makeZoneRequest(accessToken, url, method, jsonPayload, callback, requestFactory);\n}\n\n// Wraps _makeRequest and if Angular 2+ Zone.js is detected, changes scope\n// so Angular change detection isn't triggered on each API call.\n// This is the equivalent of runOutsideAngular().\n//\nfunction _makeZoneRequest(accessToken, url, method, data, callback, requestFactory) {\n var gWindow = ((typeof window != 'undefined') && window) || ((typeof self != 'undefined') && self);\n var currentZone = gWindow && gWindow.Zone && gWindow.Zone.current;\n\n if (currentZone && currentZone._name === 'angular') {\n var rootZone = currentZone._parent;\n rootZone.run(function () {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n });\n } else {\n _makeRequest(accessToken, url, method, data, callback, requestFactory);\n }\n}\n\n/* global RollbarProxy */\nfunction _proxyRequest(json, callback) {\n var rollbarProxy = new RollbarProxy();\n rollbarProxy.sendJsonPayload(\n json,\n function(_msg) { /* do nothing */ }, // eslint-disable-line no-unused-vars\n function(err) {\n callback(new Error(err));\n }\n );\n}\n\nfunction _makeRequest(accessToken, url, method, data, callback, requestFactory) {\n if (typeof RollbarProxy !== 'undefined') {\n return _proxyRequest(data, callback);\n }\n\n var request;\n if (requestFactory) {\n request = requestFactory();\n } else {\n request = _createXMLHTTPObject();\n }\n if (!request) {\n // Give up, no way to send requests\n return callback(new Error('No way to send a request'));\n }\n try {\n try {\n var onreadystatechange = function() {\n try {\n if (onreadystatechange && request.readyState === 4) {\n onreadystatechange = undefined;\n\n var parseResponse = _.jsonParse(request.responseText);\n if (_isSuccess(request)) {\n callback(parseResponse.error, parseResponse.value);\n return;\n } else if (_isNormalFailure(request)) {\n if (request.status === 403) {\n // likely caused by using a server access token\n var message = parseResponse.value && parseResponse.value.message;\n logger.error(message);\n }\n // return valid http status codes\n callback(new Error(String(request.status)));\n } else {\n // IE will return a status 12000+ on some sort of connection failure,\n // so we return a blank error\n // http://msdn.microsoft.com/en-us/library/aa383770%28VS.85%29.aspx\n var msg = 'XHR response had no status code (likely connection failure)';\n callback(_newRetriableError(msg));\n }\n }\n } catch (ex) {\n //jquery source mentions firefox may error out while accessing the\n //request members if there is a network error\n //https://github.com/jquery/jquery/blob/a938d7b1282fc0e5c52502c225ae8f0cef219f0a/src/ajax/xhr.js#L111\n var exc;\n if (ex && ex.stack) {\n exc = ex;\n } else {\n exc = new Error(ex);\n }\n callback(exc);\n }\n };\n\n request.open(method, url, true);\n if (request.setRequestHeader) {\n request.setRequestHeader('Content-Type', 'application/json');\n request.setRequestHeader('X-Rollbar-Access-Token', accessToken);\n }\n request.onreadystatechange = onreadystatechange;\n request.send(data);\n } catch (e1) {\n // Sending using the normal xmlhttprequest object didn't work, try XDomainRequest\n if (typeof XDomainRequest !== 'undefined') {\n\n // Assume we are in a really old browser which has a bunch of limitations:\n // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\n // Extreme paranoia: if we have XDomainRequest then we have a window, but just in case\n if (!window || !window.location) {\n return callback(new Error('No window available during request, unknown environment'));\n }\n\n // If the current page is http, try and send over http\n if (window.location.href.substring(0, 5) === 'http:' && url.substring(0, 5) === 'https') {\n url = 'http' + url.substring(5);\n }\n\n var xdomainrequest = new XDomainRequest();\n xdomainrequest.onprogress = function() {};\n xdomainrequest.ontimeout = function() {\n var msg = 'Request timed out';\n var code = 'ETIMEDOUT';\n callback(_newRetriableError(msg, code));\n };\n xdomainrequest.onerror = function() {\n callback(new Error('Error during request'));\n };\n xdomainrequest.onload = function() {\n var parseResponse = _.jsonParse(xdomainrequest.responseText);\n callback(parseResponse.error, parseResponse.value);\n };\n xdomainrequest.open(method, url, true);\n xdomainrequest.send(data);\n } else {\n callback(new Error('Cannot find a method to transport a request'));\n }\n }\n } catch (e2) {\n callback(e2);\n }\n}\n\nfunction _createXMLHTTPObject() {\n /* global ActiveXObject:false */\n\n var factories = [\n function () {\n return new XMLHttpRequest();\n },\n function () {\n return new ActiveXObject('Msxml2.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Msxml3.XMLHTTP');\n },\n function () {\n return new ActiveXObject('Microsoft.XMLHTTP');\n }\n ];\n var xmlhttp;\n var i;\n var numFactories = factories.length;\n for (i = 0; i < numFactories; i++) {\n /* eslint-disable no-empty */\n try {\n xmlhttp = factories[i]();\n break;\n } catch (e) {\n // pass\n }\n /* eslint-enable no-empty */\n }\n return xmlhttp;\n}\n\nfunction _isSuccess(r) {\n return r && r.status && r.status === 200;\n}\n\nfunction _isNormalFailure(r) {\n return r && _.isType(r.status, 'number') && r.status >= 400 && r.status < 600;\n}\n\nfunction _newRetriableError(message, code) {\n var err = new Error(message);\n err.code = code || 'ENOTFOUND';\n return err;\n}\n\nmodule.exports = {\n get: get,\n post: post,\n postJsonPayload: postJsonPayload\n};\n","var _ = require('../utility');\nvar errorParser = require('./errorParser');\nvar logger = require('./logger');\n\nfunction handleDomException(item, options, callback) {\n if(item.err && errorParser.Stack(item.err).name === 'DOMException') {\n var originalError = new Error();\n originalError.name = item.err.name;\n originalError.message = item.err.message;\n originalError.stack = item.err.stack;\n originalError.nested = item.err;\n item.err = originalError;\n }\n callback(null, item);\n}\n\nfunction handleItemWithError(item, options, callback) {\n item.data = item.data || {};\n if (item.err) {\n try {\n item.stackInfo = item.err._savedStackTrace || errorParser.parse(item.err);\n } catch (e) {\n logger.error('Error while parsing the error object.', e);\n try {\n item.message = item.err.message || item.err.description || item.message || String(item.err);\n } catch (e2) {\n item.message = String(item.err) || String(e2);\n }\n delete item.err;\n }\n }\n callback(null, item);\n}\n\nfunction ensureItemHasSomethingToSay(item, options, callback) {\n if (!item.message && !item.stackInfo && !item.custom) {\n callback(new Error('No message, stack info, or custom data'), null);\n }\n callback(null, item);\n}\n\nfunction addBaseInfo(item, options, callback) {\n var environment = (options.payload && options.payload.environment) || options.environment;\n item.data = _.merge(item.data, {\n environment: environment,\n level: item.level,\n endpoint: options.endpoint,\n platform: 'browser',\n framework: 'browser-js',\n language: 'javascript',\n server: {},\n uuid: item.uuid,\n notifier: {\n name: 'rollbar-browser-js',\n version: options.version\n }\n });\n callback(null, item);\n}\n\nfunction addRequestInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.location) {\n return callback(null, item);\n }\n var remoteString = '$remote_ip';\n if (!options.captureIp) {\n remoteString = null;\n } else if (options.captureIp !== true) {\n remoteString += '_anonymize';\n }\n _.set(item, 'data.request', {\n url: window.location.href,\n query_string: window.location.search,\n user_ip: remoteString\n });\n callback(null, item);\n };\n}\n\nfunction addClientInfo(window) {\n return function(item, options, callback) {\n if (!window) {\n return callback(null, item);\n }\n var nav = window.navigator || {};\n var scr = window.screen || {};\n _.set(item, 'data.client', {\n runtime_ms: item.timestamp - window._rollbarStartTime,\n timestamp: Math.round(item.timestamp / 1000),\n javascript: {\n browser: nav.userAgent,\n language: nav.language,\n cookie_enabled: nav.cookieEnabled,\n screen: {\n width: scr.width,\n height: scr.height\n }\n }\n });\n callback(null, item);\n };\n}\n\nfunction addPluginInfo(window) {\n return function(item, options, callback) {\n if (!window || !window.navigator) {\n return callback(null, item);\n }\n var plugins = [];\n var navPlugins = window.navigator.plugins || [];\n var cur;\n for (var i=0, l=navPlugins.length; i < l; ++i) {\n cur = navPlugins[i];\n plugins.push({name: cur.name, description: cur.description});\n }\n _.set(item, 'data.client.javascript.plugins', plugins);\n callback(null, item);\n };\n}\n\nfunction addBody(item, options, callback) {\n if (item.stackInfo) {\n if (item.stackInfo.traceChain) {\n addBodyTraceChain(item, options, callback);\n } else {\n addBodyTrace(item, options, callback);\n }\n } else {\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction addBodyMessage(item, options, callback) {\n var message = item.message;\n var custom = item.custom;\n\n if (!message) {\n message = 'Item sent with null or missing arguments.';\n }\n var result = {\n body: message\n };\n\n if (custom) {\n result.extra = _.merge(custom);\n }\n\n _.set(item, 'data.body', {message: result});\n callback(null, item);\n}\n\nfunction stackFromItem(item) {\n // Transform a TraceKit stackInfo object into a Rollbar trace\n var stack = item.stackInfo.stack;\n if (stack && stack.length === 0 && item._unhandledStackInfo && item._unhandledStackInfo.stack) {\n stack = item._unhandledStackInfo.stack;\n }\n return stack;\n}\n\nfunction addBodyTraceChain(item, options, callback) {\n var traceChain = item.stackInfo.traceChain;\n var traces = [];\n\n var traceChainLength = traceChain.length;\n for (var i = 0; i < traceChainLength; i++) {\n var trace = buildTrace(item, traceChain[i], options);\n traces.push(trace);\n }\n\n _.set(item, 'data.body', {trace_chain: traces});\n callback(null, item);\n}\n\nfunction addBodyTrace(item, options, callback) {\n var stack = stackFromItem(item);\n\n if (stack) {\n var trace = buildTrace(item, item.stackInfo, options);\n _.set(item, 'data.body', {trace: trace});\n callback(null, item);\n } else {\n var stackInfo = item.stackInfo;\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n\n item.message = className + ': ' + message;\n addBodyMessage(item, options, callback);\n }\n}\n\nfunction buildTrace(item, stackInfo, options) {\n var description = item && item.data.description;\n var custom = item && item.custom;\n var stack = stackFromItem(item);\n\n var guess = errorParser.guessErrorClass(stackInfo.message);\n var className = stackInfo.name || guess[0];\n var message = guess[1];\n var trace = {\n exception: {\n 'class': className,\n message: message\n }\n };\n\n if (description) {\n trace.exception.description = description;\n }\n\n if (stack) {\n if (stack.length === 0) {\n trace.exception.stack = stackInfo.rawStack;\n trace.exception.raw = String(stackInfo.rawException);\n }\n var stackFrame;\n var frame;\n var code;\n var pre;\n var post;\n var contextLength;\n var i, mid;\n\n trace.frames = [];\n for (i = 0; i < stack.length; ++i) {\n stackFrame = stack[i];\n frame = {\n filename: stackFrame.url ? _.sanitizeUrl(stackFrame.url) : '(unknown)',\n lineno: stackFrame.line || null,\n method: (!stackFrame.func || stackFrame.func === '?') ? '[anonymous]' : stackFrame.func,\n colno: stackFrame.column\n };\n if (options.sendFrameUrl) {\n frame.url = stackFrame.url;\n }\n if (frame.method && frame.method.endsWith && frame.method.endsWith('_rollbar_wrapped')) {\n continue;\n }\n\n code = pre = post = null;\n contextLength = stackFrame.context ? stackFrame.context.length : 0;\n if (contextLength) {\n mid = Math.floor(contextLength / 2);\n pre = stackFrame.context.slice(0, mid);\n code = stackFrame.context[mid];\n post = stackFrame.context.slice(mid);\n }\n\n if (code) {\n frame.code = code;\n }\n\n if (pre || post) {\n frame.context = {};\n if (pre && pre.length) {\n frame.context.pre = pre;\n }\n if (post && post.length) {\n frame.context.post = post;\n }\n }\n\n if (stackFrame.args) {\n frame.args = stackFrame.args;\n }\n\n trace.frames.push(frame);\n }\n\n // NOTE(cory): reverse the frames since rollbar.com expects the most recent call last\n trace.frames.reverse();\n\n if (custom) {\n trace.extra = _.merge(custom);\n }\n }\n\n return trace;\n}\n\nfunction scrubPayload(item, options, callback) {\n var scrubFields = options.scrubFields;\n item.data = _.scrub(item.data, scrubFields);\n callback(null, item);\n}\n\nmodule.exports = {\n handleDomException: handleDomException,\n handleItemWithError: handleItemWithError,\n ensureItemHasSomethingToSay: ensureItemHasSomethingToSay,\n addBaseInfo: addBaseInfo,\n addRequestInfo: addRequestInfo,\n addClientInfo: addClientInfo,\n addPluginInfo: addPluginInfo,\n addBody: addBody,\n scrubPayload: scrubPayload\n};\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n\n function _map(array, fn, thisArg) {\n if (typeof Array.prototype.map === 'function') {\n return array.map(fn, thisArg);\n } else {\n var output = new Array(array.length);\n for (var i = 0; i < array.length; i++) {\n output[i] = fn.call(thisArg, array[i]);\n }\n return output;\n }\n }\n\n function _filter(array, fn, thisArg) {\n if (typeof Array.prototype.filter === 'function') {\n return array.filter(fn, thisArg);\n } else {\n var output = [];\n for (var i = 0; i < array.length; i++) {\n if (fn.call(thisArg, array[i])) {\n output.push(array[i]);\n }\n }\n return output;\n }\n }\n\n return {\n /**\n * Given an Error object, extract the most information from it.\n * @param error {Error}\n * @return Array[StackFrame]\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== 'undefined' || typeof error['opera#sourceloc'] !== 'undefined') {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error('Cannot parse given Error object');\n }\n },\n\n /**\n * Separate line and column numbers from a URL-like string.\n * @param urlLike String\n * @return Array[String]\n */\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(':') === -1) {\n return [urlLike];\n }\n\n var locationParts = urlLike.replace(/[\\(\\)\\s]/g, '').split(':');\n var lastNumber = locationParts.pop();\n var possibleNumber = locationParts[locationParts.length - 1];\n if (!isNaN(parseFloat(possibleNumber)) && isFinite(possibleNumber)) {\n var lineNumber = locationParts.pop();\n return [locationParts.join(':'), lineNumber, lastNumber];\n } else {\n return [locationParts.join(':'), lastNumber, undefined];\n }\n },\n\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n if (line.indexOf('(eval ') > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, 'eval').replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, '');\n }\n var tokens = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(').split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = locationParts[0] === 'eval' ? undefined : locationParts[0];\n\n return new StackFrame(functionName, undefined, fileName, locationParts[1], locationParts[2], line);\n }, this);\n },\n\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n\n return _map(filtered, function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(' > eval') > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, ':$1');\n }\n\n if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame(line);\n } else {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.shift() || undefined;\n return new StackFrame(functionName, undefined, locationParts[0], locationParts[1], locationParts[2], line);\n }\n }, this);\n },\n\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n e.message.split('\\n').length > e.stacktrace.split('\\n').length)) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split('\\n');\n var result = [];\n\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split('\\n');\n var result = [];\n\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame(match[3] || undefined, undefined, match[2], match[1], undefined, lines[i]));\n }\n }\n\n return result;\n },\n\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = _filter(error.stack.split('\\n'), function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) &&\n !line.match(/^Error created at/);\n }, this);\n\n return _map(filtered, function (line) {\n var tokens = line.split('@');\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = (tokens.shift() || '');\n var functionName = functionCall\n .replace(//, '$2')\n .replace(/\\([^\\)]*\\)/g, '') || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, '$1');\n }\n var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ? undefined : argsRaw.split(',');\n return new StackFrame(functionName, args, locationParts[0], locationParts[1], locationParts[2], line);\n }, this);\n }\n };\n}));\n\n","(function (root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function () {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function StackFrame(functionName, args, fileName, lineNumber, columnNumber, source) {\n if (functionName !== undefined) {\n this.setFunctionName(functionName);\n }\n if (args !== undefined) {\n this.setArgs(args);\n }\n if (fileName !== undefined) {\n this.setFileName(fileName);\n }\n if (lineNumber !== undefined) {\n this.setLineNumber(lineNumber);\n }\n if (columnNumber !== undefined) {\n this.setColumnNumber(columnNumber);\n }\n if (source !== undefined) {\n this.setSource(source);\n }\n }\n\n StackFrame.prototype = {\n getFunctionName: function () {\n return this.functionName;\n },\n setFunctionName: function (v) {\n this.functionName = String(v);\n },\n\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== '[object Array]') {\n throw new TypeError('Args must be an Array');\n }\n this.args = v;\n },\n\n // NOTE: Property name may be misleading as it includes the path,\n // but it somewhat mirrors V8's JavaScriptStackTraceApi\n // https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi and Gecko's\n // http://mxr.mozilla.org/mozilla-central/source/xpcom/base/nsIException.idl#14\n getFileName: function () {\n return this.fileName;\n },\n setFileName: function (v) {\n this.fileName = String(v);\n },\n\n getLineNumber: function () {\n return this.lineNumber;\n },\n setLineNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Line Number must be a Number');\n }\n this.lineNumber = Number(v);\n },\n\n getColumnNumber: function () {\n return this.columnNumber;\n },\n setColumnNumber: function (v) {\n if (!_isNumber(v)) {\n throw new TypeError('Column Number must be a Number');\n }\n this.columnNumber = Number(v);\n },\n\n getSource: function () {\n return this.source;\n },\n setSource: function (v) {\n this.source = String(v);\n },\n\n toString: function() {\n var functionName = this.getFunctionName() || '{anonymous}';\n var args = '(' + (this.getArgs() || []).join(',') + ')';\n var fileName = this.getFileName() ? ('@' + this.getFileName()) : '';\n var lineNumber = _isNumber(this.getLineNumber()) ? (':' + this.getLineNumber()) : '';\n var columnNumber = _isNumber(this.getColumnNumber()) ? (':' + this.getColumnNumber()) : '';\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n\n return StackFrame;\n}));\n","var _ = require('./utility');\n\nfunction itemToPayload(item, options, callback) {\n var payloadOptions = options.payload || {};\n if (payloadOptions.body) {\n delete payloadOptions.body;\n }\n\n var data = _.merge(item.data, payloadOptions);\n if (item._isUncaught) {\n data._isUncaught = true;\n }\n if (item._originalArgs) {\n data._originalArgs = item._originalArgs;\n }\n callback(null, data);\n}\n\nfunction addTelemetryData(item, options, callback) {\n if (item.telemetryEvents) {\n _.set(item, 'data.body.telemetry', item.telemetryEvents);\n }\n callback(null, item);\n}\n\nfunction addMessageWithError(item, options, callback) {\n if (!item.message) {\n callback(null, item);\n return;\n }\n var tracePath = 'data.body.trace_chain.0';\n var trace = _.get(item, tracePath);\n if (!trace) {\n tracePath = 'data.body.trace';\n trace = _.get(item, tracePath);\n }\n if (trace) {\n if (!(trace.exception && trace.exception.description)) {\n _.set(item, tracePath+'.exception.description', item.message);\n callback(null, item);\n return;\n }\n var extra = _.get(item, tracePath+'.extra') || {};\n var newExtra = _.merge(extra, {message: item.message});\n _.set(item, tracePath+'.extra', newExtra);\n }\n callback(null, item);\n}\n\nfunction userTransform(logger) {\n return function(item, options, callback) {\n var newItem = _.merge(item);\n try {\n if (_.isFunction(options.transform)) {\n options.transform(newItem.data, item);\n }\n } catch (e) {\n options.transform = null;\n logger.error('Error while calling custom transform() function. Removing custom transform().', e);\n callback(null, item);\n return;\n }\n callback(null, newItem);\n }\n}\n\nfunction addConfigToPayload(item, options, callback) {\n if (!options.sendConfig) {\n return callback(null, item);\n }\n var configKey = '_rollbarConfig';\n var custom = _.get(item, 'data.custom') || {};\n custom[configKey] = options;\n item.data.custom = custom;\n callback(null, item);\n}\n\nfunction addConfiguredOptions(item, options, callback) {\n delete options._configuredOptions.accessToken;\n item.data.notifier.configured_options = options._configuredOptions;\n callback(null, item);\n}\n\nfunction addDiagnosticKeys(item, options, callback) {\n var diagnostic = {}\n\n if (_.get(item, 'err._isAnonymous')) {\n diagnostic.is_anonymous = true;\n }\n\n if (item.err) {\n try {\n diagnostic.raw_error = {\n message: item.err.message,\n name: item.err.name,\n constructor_name: item.err.constructor && item.err.constructor.name,\n filename: item.err.fileName,\n line: item.err.lineNumber,\n column: item.err.columnNumber,\n stack: item.err.stack\n };\n } catch (e) {\n diagnostic.raw_error = { failed: String(e) };\n }\n }\n\n item.data.notifier.diagnostic = _.merge(item.data.notifier.diagnostic, diagnostic);\n callback(null, item);\n}\n\nmodule.exports = {\n itemToPayload: itemToPayload,\n addTelemetryData: addTelemetryData,\n addMessageWithError: addMessageWithError,\n userTransform: userTransform,\n addConfigToPayload: addConfigToPayload,\n addConfiguredOptions: addConfiguredOptions,\n addDiagnosticKeys: addDiagnosticKeys\n};\n","var _ = require('../utility');\n\nfunction checkIgnore(item, settings) {\n if (_.get(settings, 'plugins.jquery.ignoreAjaxErrors')) {\n return !_.get(item, 'body.message.extra.isAjax');\n }\n return true;\n}\n\nmodule.exports = {\n checkIgnore: checkIgnore\n};\n","var _ = require('./utility');\n\nfunction checkLevel(item, settings) {\n var level = item.level;\n var levelVal = _.LEVELS[level] || 0;\n var reportLevel = settings.reportLevel;\n var reportLevelVal = _.LEVELS[reportLevel] || 0;\n\n if (levelVal < reportLevelVal) {\n return false;\n }\n return true;\n}\n\nfunction userCheckIgnore(logger) {\n return function(item, settings) {\n var isUncaught = !!item._isUncaught;\n delete item._isUncaught;\n var args = item._originalArgs;\n delete item._originalArgs;\n try {\n if (_.isFunction(settings.onSendCallback)) {\n settings.onSendCallback(isUncaught, args, item);\n }\n } catch (e) {\n settings.onSendCallback = null;\n logger.error('Error while calling onSendCallback, removing', e);\n }\n try {\n if (_.isFunction(settings.checkIgnore) && settings.checkIgnore(isUncaught, args, item)) {\n return false;\n }\n } catch (e) {\n settings.checkIgnore = null;\n logger.error('Error while calling custom checkIgnore(), removing', e);\n }\n return true;\n }\n}\n\nfunction urlIsNotBlacklisted(logger) {\n return function(item, settings) {\n return !urlIsOnAList(item, settings, 'blacklist', logger);\n }\n}\n\nfunction urlIsWhitelisted(logger) {\n return function(item, settings) {\n return urlIsOnAList(item, settings, 'whitelist', logger);\n }\n}\n\nfunction matchFrames(trace, list, black) {\n if (!trace) { return !black }\n\n var frames = trace.frames;\n\n if (!frames || frames.length === 0) { return !black; }\n\n var frame, filename, url, urlRegex;\n var listLength = list.length;\n var frameLength = frames.length;\n for (var i = 0; i < frameLength; i++) {\n frame = frames[i];\n filename = frame.filename;\n\n if (!_.isType(filename, 'string')) { return !black; }\n\n for (var j = 0; j < listLength; j++) {\n url = list[j];\n urlRegex = new RegExp(url);\n\n if (urlRegex.test(filename)) {\n return true;\n }\n }\n }\n return false;\n}\n\nfunction urlIsOnAList(item, settings, whiteOrBlack, logger) {\n // whitelist is the default\n var black = false;\n if (whiteOrBlack === 'blacklist') {\n black = true;\n }\n\n var list, traces;\n try {\n list = black ? settings.hostBlackList : settings.hostWhiteList;\n traces = _.get(item, 'body.trace_chain') || [_.get(item, 'body.trace')];\n\n // These two checks are important to come first as they are defaults\n // in case the list is missing or the trace is missing or not well-formed\n if (!list || list.length === 0) {\n return !black;\n }\n if (traces.length === 0 || !traces[0]) {\n return !black;\n }\n\n var tracesLength = traces.length;\n for (var i = 0; i < tracesLength; i++) {\n if(matchFrames(traces[i], list, black)) {\n return true;\n }\n }\n } catch (e)\n /* istanbul ignore next */\n {\n if (black) {\n settings.hostBlackList = null;\n } else {\n settings.hostWhiteList = null;\n }\n var listName = black ? 'hostBlackList' : 'hostWhiteList';\n logger.error('Error while reading your configuration\\'s ' + listName + ' option. Removing custom ' + listName + '.', e);\n return !black;\n }\n return false;\n}\n\nfunction messageIsIgnored(logger) {\n return function(item, settings) {\n var exceptionMessage, i, ignoredMessages,\n len, messageIsIgnored, rIgnoredMessage,\n body, traceMessage, bodyMessage;\n\n try {\n messageIsIgnored = false;\n ignoredMessages = settings.ignoredMessages;\n\n if (!ignoredMessages || ignoredMessages.length === 0) {\n return true;\n }\n\n body = item.body;\n traceMessage = _.get(body, 'trace.exception.message');\n bodyMessage = _.get(body, 'message.body');\n\n exceptionMessage = traceMessage || bodyMessage;\n\n if (!exceptionMessage){\n return true;\n }\n\n len = ignoredMessages.length;\n for (i = 0; i < len; i++) {\n rIgnoredMessage = new RegExp(ignoredMessages[i], 'gi');\n messageIsIgnored = rIgnoredMessage.test(exceptionMessage);\n\n if (messageIsIgnored) {\n break;\n }\n }\n } catch(e)\n /* istanbul ignore next */\n {\n settings.ignoredMessages = null;\n logger.error('Error while reading your configuration\\'s ignoredMessages option. Removing custom ignoredMessages.');\n }\n\n return !messageIsIgnored;\n }\n}\n\nmodule.exports = {\n checkLevel: checkLevel,\n userCheckIgnore: userCheckIgnore,\n urlIsNotBlacklisted: urlIsNotBlacklisted,\n urlIsWhitelisted: urlIsWhitelisted,\n messageIsIgnored: messageIsIgnored\n};\n","var _ = require('../utility');\nvar urlparser = require('./url');\nvar domUtil = require('./domUtility');\n\nvar defaults = {\n network: true,\n networkResponseHeaders: false,\n networkResponseBody: false,\n networkRequestBody: false,\n log: true,\n dom: true,\n navigation: true,\n connectivity: true\n};\n\nfunction replace(obj, name, replacement, replacements, type) {\n var orig = obj[name];\n obj[name] = replacement(orig);\n if (replacements) {\n replacements[type].push([obj, name, orig]);\n }\n}\n\nfunction restore(replacements, type) {\n var b;\n while (replacements[type].length) {\n b = replacements[type].shift();\n b[0][b[1]] = b[2];\n }\n}\n\nfunction nameFromDescription(description) {\n if (!description || !description.attributes) { return null; }\n var attrs = description.attributes;\n for (var a = 0; a < attrs.length; ++a) {\n if (attrs[a].key === 'name') {\n return attrs[a].value;\n }\n }\n return null;\n}\n\nfunction defaultValueScrubber(scrubFields) {\n var patterns = [];\n for (var i = 0; i < scrubFields.length; ++i) {\n patterns.push(new RegExp(scrubFields[i], 'i'));\n }\n return function(description) {\n var name = nameFromDescription(description);\n if (!name) { return false; }\n for (var i = 0; i < patterns.length; ++i) {\n if (patterns[i].test(name)) {\n return true;\n }\n }\n return false;\n };\n}\n\nfunction Instrumenter(options, telemeter, rollbar, _window, _document) {\n var autoInstrument = options.autoInstrument;\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n this.telemetryScrubber = options.telemetryScrubber;\n this.defaultValueScrubber = defaultValueScrubber(options.scrubFields);\n this.telemeter = telemeter;\n this.rollbar = rollbar;\n this._window = _window || {};\n this._document = _document || {};\n this.replacements = {\n network: [],\n log: [],\n navigation: [],\n connectivity: []\n };\n this.eventRemovers = {\n dom: [],\n connectivity: []\n };\n\n this._location = this._window.location;\n this._lastHref = this._location && this._location.href;\n}\n\nInstrumenter.prototype.configure = function(options) {\n var autoInstrument = options.autoInstrument;\n var oldSettings = _.merge(this.autoInstrument);\n if (options.enabled === false || autoInstrument === false) {\n this.autoInstrument = {};\n } else {\n if (!_.isType(autoInstrument, 'object')) {\n autoInstrument = defaults;\n }\n this.autoInstrument = _.merge(defaults, autoInstrument);\n }\n this.instrument(oldSettings);\n if (options.scrubTelemetryInputs !== undefined) {\n this.scrubTelemetryInputs = !!options.scrubTelemetryInputs;\n }\n if (options.telemetryScrubber !== undefined) {\n this.telemetryScrubber = options.telemetryScrubber;\n }\n};\n\nInstrumenter.prototype.instrument = function(oldSettings) {\n if (this.autoInstrument.network && !(oldSettings && oldSettings.network)) {\n this.instrumentNetwork();\n } else if (!this.autoInstrument.network && oldSettings && oldSettings.network) {\n this.deinstrumentNetwork();\n }\n\n if (this.autoInstrument.log && !(oldSettings && oldSettings.log)) {\n this.instrumentConsole();\n } else if (!this.autoInstrument.log && oldSettings && oldSettings.log) {\n this.deinstrumentConsole();\n }\n\n if (this.autoInstrument.dom && !(oldSettings && oldSettings.dom)) {\n this.instrumentDom();\n } else if (!this.autoInstrument.dom && oldSettings && oldSettings.dom) {\n this.deinstrumentDom();\n }\n\n if (this.autoInstrument.navigation && !(oldSettings && oldSettings.navigation)) {\n this.instrumentNavigation();\n } else if (!this.autoInstrument.navigation && oldSettings && oldSettings.navigation) {\n this.deinstrumentNavigation();\n }\n\n if (this.autoInstrument.connectivity && !(oldSettings && oldSettings.connectivity)) {\n this.instrumentConnectivity();\n } else if (!this.autoInstrument.connectivity && oldSettings && oldSettings.connectivity) {\n this.deinstrumentConnectivity();\n }\n};\n\nInstrumenter.prototype.deinstrumentNetwork = function() {\n restore(this.replacements, 'network');\n};\n\nInstrumenter.prototype.instrumentNetwork = function() {\n var self = this;\n\n function wrapProp(prop, xhr) {\n if (prop in xhr && _.isFunction(xhr[prop])) {\n replace(xhr, prop, function(orig) {\n return self.rollbar.wrap(orig);\n });\n }\n }\n\n if ('XMLHttpRequest' in this._window) {\n var xhrp = this._window.XMLHttpRequest.prototype;\n replace(xhrp, 'open', function(orig) {\n return function(method, url) {\n if (_.isType(url, 'string')) {\n this.__rollbar_xhr = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'network');\n\n replace(xhrp, 'send', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(data) {\n /* eslint-enable no-unused-vars */\n var xhr = this;\n\n function onreadystatechangeHandler() {\n if (xhr.__rollbar_xhr) {\n if (xhr.__rollbar_xhr.status_code === null) {\n xhr.__rollbar_xhr.status_code = 0;\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n requestData = data;\n }\n xhr.__rollbar_event = self.telemeter.captureNetwork(xhr.__rollbar_xhr, 'xhr', undefined, requestData);\n }\n if (xhr.readyState < 2) {\n xhr.__rollbar_xhr.start_time_ms = _.now();\n }\n if (xhr.readyState > 3) {\n xhr.__rollbar_xhr.end_time_ms = _.now();\n\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n var header, i;\n if (headersConfig === true) {\n var allHeaders = xhr.getAllResponseHeaders();\n if (allHeaders) {\n var arr = allHeaders.trim().split(/[\\r\\n]+/);\n var parts, value;\n for (i=0; i < arr.length; i++) {\n parts = arr[i].split(': ');\n header = parts.shift();\n value = parts.join(': ');\n headers[header] = value;\n }\n }\n } else {\n for (i=0; i < headersConfig.length; i++) {\n header = headersConfig[i];\n headers[header] = xhr.getResponseHeader(header);\n }\n }\n } catch (e) {\n /* we ignore the errors here that could come from different\n * browser issues with the xhr methods */\n }\n }\n var body = null;\n if (self.autoInstrument.networkResponseBody) {\n try {\n body = xhr.responseText;\n } catch (e) {\n /* ignore errors from reading responseText */\n }\n }\n var response = null;\n if (body || headers) {\n response = {};\n if (body) {\n response.body = body;\n }\n if (headers) {\n response.headers = headers;\n }\n }\n if (response) {\n xhr.__rollbar_xhr.response = response;\n }\n try {\n var code = xhr.status;\n code = code === 1223 ? 204 : code;\n xhr.__rollbar_xhr.status_code = code;\n xhr.__rollbar_event.level = self.telemeter.levelFromStatus(code);\n } catch (e) {\n /* ignore possible exception from xhr.status */\n }\n }\n }\n }\n\n wrapProp('onload', xhr);\n wrapProp('onerror', xhr);\n wrapProp('onprogress', xhr);\n\n if ('onreadystatechange' in xhr && _.isFunction(xhr.onreadystatechange)) {\n replace(xhr, 'onreadystatechange', function(orig) {\n return self.rollbar.wrap(orig, undefined, onreadystatechangeHandler);\n });\n } else {\n xhr.onreadystatechange = onreadystatechangeHandler;\n }\n return orig.apply(this, arguments);\n }\n }, this.replacements, 'network');\n }\n\n if ('fetch' in this._window) {\n replace(this._window, 'fetch', function(orig) {\n /* eslint-disable no-unused-vars */\n return function(fn, t) {\n /* eslint-enable no-unused-vars */\n var args = new Array(arguments.length);\n for (var i=0, len=args.length; i < len; i++) {\n args[i] = arguments[i];\n }\n var input = args[0];\n var method = 'GET';\n var url;\n if (_.isType(input, 'string')) {\n url = input;\n } else if (input) {\n url = input.url;\n if (input.method) {\n method = input.method;\n }\n }\n if (args[1] && args[1].method) {\n method = args[1].method;\n }\n var metadata = {\n method: method,\n url: url,\n status_code: null,\n start_time_ms: _.now(),\n end_time_ms: null\n };\n var requestData = null;\n if (self.autoInstrument.networkRequestBody) {\n if (args[1] && args[1].body) {\n requestData = args[1].body;\n } else if (args[0] && !_.isType(args[0], 'string') && args[0].body) {\n requestData = args[0].body;\n }\n }\n self.telemeter.captureNetwork(metadata, 'fetch', undefined, requestData);\n return orig.apply(this, args).then(function (resp) {\n metadata.end_time_ms = _.now();\n metadata.status_code = resp.status;\n var headers = null;\n if (self.autoInstrument.networkResponseHeaders) {\n var headersConfig = self.autoInstrument.networkResponseHeaders;\n headers = {};\n try {\n if (headersConfig === true) {\n // This is unsupported in IE so we can't do it\n /*\n var allHeaders = resp.headers.entries();\n for (var pair of allHeaders) {\n headers[pair[0]] = pair[1];\n }\n */\n } else {\n for (var i=0; i < headersConfig.length; i++) {\n var header = headersConfig[i];\n headers[header] = resp.headers.get(header);\n }\n }\n } catch (e) {\n /* ignore probable IE errors */\n }\n }\n var response = null;\n if (headers) {\n response = {\n headers: headers\n };\n }\n if (response) {\n metadata.response = response;\n }\n return resp;\n });\n };\n }, this.replacements, 'network');\n }\n};\n\nInstrumenter.prototype.deinstrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n var b;\n while (this.replacements['log'].length) {\n b = this.replacements['log'].shift();\n this._window.console[b[0]] = b[1];\n }\n};\n\nInstrumenter.prototype.instrumentConsole = function() {\n if (!('console' in this._window && this._window.console.log)) {\n return;\n }\n\n var self = this;\n var c = this._window.console;\n\n function wrapConsole(method) {\n var orig = c[method];\n var origConsole = c;\n var level = method === 'warn' ? 'warning' : method;\n c[method] = function() {\n var args = Array.prototype.slice.call(arguments);\n var message = _.formatArgsAsString(args);\n self.telemeter.captureLog(message, level);\n if (orig) {\n Function.prototype.apply.call(orig, origConsole, args);\n }\n };\n self.replacements['log'].push([method, orig]);\n }\n var methods = ['debug','info','warn','error','log'];\n for (var i=0, len=methods.length; i < len; i++) {\n wrapConsole(methods[i]);\n }\n};\n\nInstrumenter.prototype.deinstrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n this.removeListeners('dom');\n};\n\nInstrumenter.prototype.instrumentDom = function() {\n if (!('addEventListener' in this._window || 'attachEvent' in this._window)) {\n return;\n }\n var clickHandler = this.handleClick.bind(this);\n var blurHandler = this.handleBlur.bind(this);\n this.addListener('dom', this._window, 'click', 'onclick', clickHandler, true);\n this.addListener('dom', this._window, 'blur', 'onfocusout', blurHandler, true);\n};\n\nInstrumenter.prototype.handleClick = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n var hasTag = e && e.tagName;\n var anchorOrButton = domUtil.isDescribedElement(e, 'a') || domUtil.isDescribedElement(e, 'button');\n if (hasTag && (anchorOrButton || domUtil.isDescribedElement(e, 'input', ['button', 'submit']))) {\n this.captureDomEvent('click', e);\n } else if (domUtil.isDescribedElement(e, 'input', ['checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value, e.checked);\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleBlur = function(evt) {\n try {\n var e = domUtil.getElementFromEvent(evt, this._document);\n if (e && e.tagName) {\n if (domUtil.isDescribedElement(e, 'textarea')) {\n this.captureDomEvent('input', e, e.value);\n } else if (domUtil.isDescribedElement(e, 'select') && e.options && e.options.length) {\n this.handleSelectInputChanged(e);\n } else if (domUtil.isDescribedElement(e, 'input') && !domUtil.isDescribedElement(e, 'input', ['button', 'submit', 'hidden', 'checkbox', 'radio'])) {\n this.captureDomEvent('input', e, e.value);\n }\n }\n } catch (exc) {\n // TODO: Not sure what to do here\n }\n};\n\nInstrumenter.prototype.handleSelectInputChanged = function(elem) {\n if (elem.multiple) {\n for (var i = 0; i < elem.options.length; i++) {\n if (elem.options[i].selected) {\n this.captureDomEvent('input', elem, elem.options[i].value);\n }\n }\n } else if (elem.selectedIndex >= 0 && elem.options[elem.selectedIndex]) {\n this.captureDomEvent('input', elem, elem.options[elem.selectedIndex].value);\n }\n};\n\nInstrumenter.prototype.captureDomEvent = function(subtype, element, value, isChecked) {\n if (value !== undefined) {\n if (this.scrubTelemetryInputs || (domUtil.getElementType(element) === 'password')) {\n value = '[scrubbed]';\n } else {\n var description = domUtil.describeElement(element);\n if (this.telemetryScrubber) {\n if (this.telemetryScrubber(description)) {\n value = '[scrubbed]';\n }\n } else if (this.defaultValueScrubber(description)) {\n value = '[scrubbed]';\n }\n }\n }\n var elementString = domUtil.elementArrayToString(domUtil.treeToArray(element));\n this.telemeter.captureDom(subtype, elementString, value, isChecked);\n};\n\nInstrumenter.prototype.deinstrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n restore(this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.instrumentNavigation = function() {\n var chrome = this._window.chrome;\n var chromePackagedApp = chrome && chrome.app && chrome.app.runtime;\n // See https://github.com/angular/angular.js/pull/13945/files\n var hasPushState = !chromePackagedApp && this._window.history && this._window.history.pushState;\n if (!hasPushState) {\n return;\n }\n var self = this;\n replace(this._window, 'onpopstate', function(orig) {\n return function() {\n var current = self._location.href;\n self.handleUrlChange(self._lastHref, current);\n if (orig) {\n orig.apply(this, arguments);\n }\n };\n }, this.replacements, 'navigation');\n\n replace(this._window.history, 'pushState', function(orig) {\n return function() {\n var url = arguments.length > 2 ? arguments[2] : undefined;\n if (url) {\n self.handleUrlChange(self._lastHref, url + '');\n }\n return orig.apply(this, arguments);\n };\n }, this.replacements, 'navigation');\n};\n\nInstrumenter.prototype.handleUrlChange = function(from, to) {\n var parsedHref = urlparser.parse(this._location.href);\n var parsedTo = urlparser.parse(to);\n var parsedFrom = urlparser.parse(from);\n this._lastHref = to;\n if (parsedHref.protocol === parsedTo.protocol && parsedHref.host === parsedTo.host) {\n to = parsedTo.path + (parsedTo.hash || '');\n }\n if (parsedHref.protocol === parsedFrom.protocol && parsedHref.host === parsedFrom.host) {\n from = parsedFrom.path + (parsedFrom.hash || '');\n }\n this.telemeter.captureNavigation(from, to);\n};\n\nInstrumenter.prototype.deinstrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.removeListeners('connectivity');\n } else {\n restore(this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.instrumentConnectivity = function() {\n if (!('addEventListener' in this._window || 'body' in this._document)) {\n return;\n }\n if (this._window.addEventListener) {\n this.addListener('connectivity', this._window, 'online', undefined, function() {\n this.telemeter.captureConnectivityChange('online');\n }.bind(this), true);\n this.addListener('connectivity', this._window, 'offline', undefined, function() {\n this.telemeter.captureConnectivityChange('offline');\n }.bind(this), true);\n } else {\n var self = this;\n replace(this._document.body, 'ononline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('online');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n replace(this._document.body, 'onoffline', function(orig) {\n return function() {\n self.telemeter.captureConnectivityChange('offline');\n if (orig) {\n orig.apply(this, arguments);\n }\n }\n }, this.replacements, 'connectivity');\n }\n};\n\nInstrumenter.prototype.addListener = function(section, obj, type, altType, handler, capture) {\n if (obj.addEventListener) {\n obj.addEventListener(type, handler, capture);\n this.eventRemovers[section].push(function() {\n obj.removeEventListener(type, handler, capture);\n });\n } else if (altType) {\n obj.attachEvent(altType, handler);\n this.eventRemovers[section].push(function() {\n obj.detachEvent(altType, handler);\n });\n }\n};\n\nInstrumenter.prototype.removeListeners = function(section) {\n var r;\n while (this.eventRemovers[section].length) {\n r = this.eventRemovers[section].shift();\n r();\n }\n};\n\nmodule.exports = Instrumenter;\n","function getElementType(e) {\n return (e.getAttribute('type') || '').toLowerCase();\n}\n\nfunction isDescribedElement(element, type, subtypes) {\n if (element.tagName.toLowerCase() !== type.toLowerCase()) {\n return false;\n }\n if (!subtypes) {\n return true;\n }\n element = getElementType(element);\n for (var i = 0; i < subtypes.length; i++) {\n if (subtypes[i] === element) {\n return true;\n }\n }\n return false;\n}\n\nfunction getElementFromEvent(evt, doc) {\n if (evt.target) {\n return evt.target;\n }\n if (doc && doc.elementFromPoint) {\n return doc.elementFromPoint(evt.clientX, evt.clientY);\n }\n return undefined;\n}\n\nfunction treeToArray(elem) {\n var MAX_HEIGHT = 5;\n var out = [];\n var nextDescription;\n for (var height = 0; elem && height < MAX_HEIGHT; height++) {\n nextDescription = describeElement(elem);\n if (nextDescription.tagName === 'html') {\n break;\n }\n out.unshift(nextDescription);\n elem = elem.parentNode;\n }\n return out;\n}\n\nfunction elementArrayToString(a) {\n var MAX_LENGTH = 80;\n var separator = ' > ', separatorLength = separator.length;\n var out = [], len = 0, nextStr, totalLength;\n\n for (var i = a.length - 1; i >= 0; i--) {\n nextStr = descriptionToString(a[i]);\n totalLength = len + (out.length * separatorLength) + nextStr.length;\n if (i < a.length - 1 && totalLength >= MAX_LENGTH + 3) {\n out.unshift('...');\n break;\n }\n out.unshift(nextStr);\n len += nextStr.length;\n }\n return out.join(separator);\n}\n\nfunction descriptionToString(desc) {\n if (!desc || !desc.tagName) {\n return '';\n }\n var out = [desc.tagName];\n if (desc.id) {\n out.push('#' + desc.id);\n }\n if (desc.classes) {\n out.push('.' + desc.classes.join('.'));\n }\n for (var i = 0; i < desc.attributes.length; i++) {\n out.push('[' + desc.attributes[i].key + '=\"' + desc.attributes[i].value + '\"]');\n }\n\n return out.join('');\n}\n\n/**\n * Input: a dom element\n * Output: null if tagName is falsey or input is falsey, else\n * {\n * tagName: String,\n * id: String | undefined,\n * classes: [String] | undefined,\n * attributes: [\n * {\n * key: OneOf(type, name, title, alt),\n * value: String\n * }\n * ]\n * }\n */\nfunction describeElement(elem) {\n if (!elem || !elem.tagName) {\n return null;\n }\n var out = {}, className, key, attr, i;\n out.tagName = elem.tagName.toLowerCase();\n if (elem.id) {\n out.id = elem.id;\n }\n className = elem.className;\n if (className && (typeof className === 'string')) {\n out.classes = className.split(/\\s+/);\n }\n var attributes = ['type', 'name', 'title', 'alt'];\n out.attributes = [];\n for (i = 0; i < attributes.length; i++) {\n key = attributes[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.attributes.push({key: key, value: attr});\n }\n }\n return out;\n}\n\nmodule.exports = {\n describeElement: describeElement,\n descriptionToString: descriptionToString,\n elementArrayToString: elementArrayToString,\n treeToArray: treeToArray,\n getElementFromEvent: getElementFromEvent,\n isDescribedElement: isDescribedElement,\n getElementType: getElementType\n};\n"],"sourceRoot":""} \ No newline at end of file diff --git a/examples/chrome_extension/background.js b/examples/chrome_extension/background.js index 9798dbc53..083929018 100644 --- a/examples/chrome_extension/background.js +++ b/examples/chrome_extension/background.js @@ -11,7 +11,7 @@ var _rollbarConfig = { }; // Rollbar Snippet -!function(r){var e={};function o(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return r[n].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=r,o.c=e,o.d=function(r,e,n){o.o(r,e)||Object.defineProperty(r,e,{enumerable:!0,get:n})},o.r=function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})},o.t=function(r,e){if(1&e&&(r=o(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var t in r)o.d(n,t,function(e){return r[e]}.bind(null,t));return n},o.n=function(r){var e=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(e,"a",e),e},o.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},o.p="",o(o.s=0)}([function(r,e,o){var n=o(1),t=o(4);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.12.1/rollbar.min.js",_rollbarConfig.async=void 0===_rollbarConfig.async||_rollbarConfig.async;var a=n.setupShim(window,_rollbarConfig),l=t(_rollbarConfig);window.rollbar=n.Rollbar,a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,l)},function(r,e,o){var n=o(2);function t(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var a=0;function l(r,e){this.options=r,this._rollbarOldOnError=null;var o=a++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var i=o(3),s=function(r,e){return new l(r,e)},d=function(r){return new i(s,r)};function c(r){return t(function(){var e=Array.prototype.slice.call(arguments,0),o={shim:this,method:r,args:e,ts:new Date};window._rollbarShims[this.shimId()].messages.push(o)})}l.prototype.loadFull=function(r,e,o,n,a){var l=!1,i=e.createElement("script"),s=e.getElementsByTagName("script")[0],d=s.parentNode;i.crossOrigin="",i.src=n.rollbarJsUrl,o||(i.async=!0),i.onload=i.onreadystatechange=t(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{d.removeChild(i)}catch(r){}l=!0,function(){var e;if(void 0===r._rollbarDidLoad){e=new Error("rollbar.js did not load");for(var o,n,t,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(t=n.args||[],i=0;i diff --git a/examples/snippet.html b/examples/snippet.html index 4641833d4..d0cf51be6 100644 --- a/examples/snippet.html +++ b/examples/snippet.html @@ -13,7 +13,7 @@ diff --git a/examples/test.html b/examples/test.html index d880cdcf2..0c619521c 100644 --- a/examples/test.html +++ b/examples/test.html @@ -35,7 +35,7 @@ diff --git a/examples/universal-browser/test.html b/examples/universal-browser/test.html index c07799359..5421bbafc 100644 --- a/examples/universal-browser/test.html +++ b/examples/universal-browser/test.html @@ -35,7 +35,7 @@