From 4b485fe5c6e145ea8aaee430838928194c576bea Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Sat, 2 Mar 2024 16:13:23 -0300 Subject: [PATCH 1/9] Integrate prettier to the project and ci --- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++++----- .prettierignore | 13 +++++++++++++ .vscode/settings.json | 39 +++++++++++++++++++++++++++++++++++++++ package-lock.json | 22 ++++++++++++++++++++++ package.json | 1 + prettier.config.js | 7 +++++++ 6 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 .prettierignore create mode 100644 .vscode/settings.json create mode 100644 prettier.config.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e58eedb37..f2c81e0a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,22 +10,46 @@ on: jobs: build: runs-on: ubuntu-20.04 + strategy: matrix: - node-version: [10, 12, 14, 16] + include: + - node: 14 + npm: 8 + - node: 16 + npm: 8 + - node: 18 + npm: 9 + - node: 20 + npm: 10 + - node: 21 + npm: 10 steps: - - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 with: submodules: recursive - - name: Install node.js - uses: actions/setup-node@v2-beta + - name: Set up node ${{ matrix.node }} + uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node }} + + - name: Update npm + run: npm install -g npm@^${{ matrix.npm }} - name: npm install run: npm install + - name: Lint + uses: wearerequired/lint-action@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + prettier: true + eslint: true + eslint_args: '--max-warnings 0' + eslint_extensions: js + - name: Run tests run: npm run test_ci diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..8c090b74e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,13 @@ +.github +.next +.yalc +build +bundles +coverage +dist +lib +node_modules +out +public +release +vendor diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 000000000..9c5e96fe7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,39 @@ +{ + "[github-actions-workflow]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[javascript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[javascriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[json5]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[jsonc]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescript]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "[typescriptreact]": { + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true, + "editor.formatOnSaveMode": "file", + "editor.tabSize": 2, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "files.trimTrailingWhitespace": true, + "prettier.useEditorConfig": false +} diff --git a/package-lock.json b/package-lock.json index aef2ea67b..048c0675f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -64,6 +64,7 @@ "natives": "^1.1.6", "nock": "^11.9.1", "node-libs-browser": "^0.5.2", + "prettier": "^3.2.5", "requirejs": "^2.1.20", "script-loader": "0.6.1", "sinon": "^8.1.1", @@ -7614,6 +7615,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz", @@ -15473,6 +15489,12 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prettier": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "dev": true + }, "pretty-bytes": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-3.0.1.tgz", diff --git a/package.json b/package.json index 2848f7dfc..649fa06f4 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "natives": "^1.1.6", "nock": "^11.9.1", "node-libs-browser": "^0.5.2", + "prettier": "^3.2.5", "requirejs": "^2.1.20", "script-loader": "0.6.1", "sinon": "^8.1.1", diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 000000000..1bf3666c3 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1,7 @@ +/** + * @type {import('prettier').Config} + */ +module.exports = { + trailingComma: 'all', + singleQuote: true, +}; From 171ae4b5fb1a88159d6e168b2ce917ab7190a895 Mon Sep 17 00:00:00 2001 From: Matias Pequeno Date: Sat, 2 Mar 2024 21:54:26 -0300 Subject: [PATCH 2/9] Prettierify all sources, html, config files and markdowns --- .lgtm.yml | 14 +- CHANGELOG.md | 156 +- Gruntfile.js | 84 +- README.md | 5 +- bower.json | 4 +- defaults.js | 22 +- docs/extension-exceptions.md | 65 +- docs/migration_v0_to_v1.md | 79 +- examples/angular2/angular.json | 33 +- examples/angular2/e2e/protractor.conf.js | 18 +- examples/angular2/e2e/src/app.e2e-spec.ts | 8 +- examples/angular2/e2e/tsconfig.e2e.json | 8 +- .../angular2/src/app/app-routing.module.ts | 4 +- examples/angular2/src/app/app.component.html | 6 +- .../angular2/src/app/app.component.spec.ts | 12 +- examples/angular2/src/app/app.component.ts | 7 +- examples/angular2/src/app/app.module.ts | 14 +- examples/angular2/src/app/rollbar.ts | 8 +- .../src/environments/environment.prod.ts | 2 +- .../angular2/src/environments/environment.ts | 2 +- examples/angular2/src/index.html | 20 +- examples/angular2/src/karma.conf.js | 8 +- examples/angular2/src/main.ts | 5 +- examples/angular2/src/polyfills.ts | 3 +- examples/angular2/src/test.ts | 4 +- examples/angular2/src/tsconfig.app.json | 5 +- examples/angular2/src/tsconfig.spec.json | 15 +- examples/angular2/src/tslint.json | 14 +- examples/angular2/tsconfig.json | 9 +- examples/angular2/tslint.json | 38 +- examples/bower/README.md | 17 +- examples/bower/index.html | 16 +- examples/browser_extension_v2/README.md | 9 +- examples/browser_extension_v2/background.js | 407 +- examples/browser_extension_v2/config.js | 9 +- examples/browser_extension_v2/manifest.json | 16 +- examples/browser_extension_v2/rollbar.min.js | 4330 +++++++++++++++- examples/browser_extension_v3/README.md | 6 +- examples/browser_extension_v3/config.js | 3 +- examples/browser_extension_v3/rollbar.min.js | 4448 ++++++++++++++++- .../browser_extension_v3/service-worker.js | 6 +- examples/browserify/README.md | 5 +- examples/browserify/all.js | 1355 ++++- examples/browserify/index.js | 2 +- examples/csp-errors.html | 13 +- examples/error.html | 100 +- examples/extension-exceptions/test.html | 113 +- examples/functions.js | 2 +- examples/include_custom_object.html | 34 +- examples/itemsPerMinute.html | 436 +- examples/no-conflict/README.md | 4 +- examples/no-conflict/server.js | 6 +- examples/no-conflict/test.html | 440 +- examples/no-conflict/tool.js | 8 +- examples/no-conflict/webpack.config.js | 58 +- examples/node-dist/index.js | 18 +- examples/node-typescript/src/index.ts | 5 +- examples/node-typescript/tsconfig.json | 8 +- examples/react/src/TestError.js | 4 +- examples/react/src/index.html | 20 +- examples/react/src/index.js | 24 +- examples/react/webpack.config.js | 18 +- examples/requirejs/README.md | 51 +- examples/requirejs/test.html | 25 +- examples/script.html | 6 +- examples/snippet.html | 436 +- examples/test.html | 440 +- examples/universal-browser/README.md | 4 +- examples/universal-browser/server.js | 14 +- .../test-with-non-default-options.html | 437 +- examples/universal-browser/test.html | 451 +- examples/universal-node/README.md | 6 +- examples/universal-node/app/App.js | 10 +- examples/universal-node/app/index.tpl.html | 6 +- examples/universal-node/other.js | 4 +- examples/universal-node/server.js | 45 +- examples/universal-node/webpack.config.js | 116 +- examples/vuejs3/index.html | 8 +- examples/vuejs3/src/rollbar.config.js | 6 +- examples/vuejs3/vite.config.js | 18 +- examples/webpack/src/index.html | 40 +- examples/webpack/src/index.js | 8 +- examples/webpack/webpack.config.js | 6 +- index.d.ts | 501 +- karma.conf.js | 30 +- src/api.js | 31 +- src/apiUtility.js | 20 +- src/browser/core.js | 168 +- src/browser/defaults/scrubFields.js | 6 +- src/browser/detection.js | 15 +- src/browser/domUtility.js | 26 +- src/browser/globalSetup.js | 18 +- src/browser/logger.js | 2 +- src/browser/plugins/jquery.js | 70 +- src/browser/predicates.js | 2 +- src/browser/rollbar.js | 2 +- src/browser/rollbarWrapper.js | 13 +- src/browser/shim.js | 62 +- src/browser/snippet_callback.js | 10 +- src/browser/telemetry.js | 919 ++-- src/browser/transforms.js | 73 +- src/browser/transport.js | 107 +- src/browser/transport/fetch.js | 30 +- src/browser/transport/xhr.js | 42 +- src/browser/url.js | 24 +- src/browser/wrapGlobals.js | 35 +- src/defaults.js | 4 +- src/errorParser.js | 25 +- src/merge.js | 55 +- src/notifier.js | 29 +- src/predicates.js | 66 +- src/queue.js | 110 +- src/rateLimiter.js | 77 +- src/react-native/logger.js | 2 +- src/react-native/rollbar.js | 114 +- src/react-native/transforms.js | 22 +- src/react-native/transport.js | 78 +- src/rollbar.js | 35 +- src/scrub.js | 1 - src/server/locals.js | 108 +- src/server/logger.js | 8 +- src/server/parser.js | 119 +- src/server/rollbar.js | 188 +- src/server/sourceMap/stackTrace.js | 51 +- src/server/telemetry.js | 98 +- src/server/telemetry/urlHelpers.js | 23 +- src/server/transforms.js | 58 +- src/server/transport.js | 94 +- src/telemetry.js | 120 +- src/transforms.js | 54 +- src/truncation.js | 13 +- src/utility.js | 141 +- src/utility/headers.js | 86 +- src/utility/traverse.js | 2 +- test/api.test.js | 60 +- test/apiUtility.test.js | 87 +- test/browser.core.test.js | 272 +- test/browser.domUtility.test.js | 87 +- test/browser.predicates.test.js | 26 +- test/browser.rollbar.test.js | 1100 ++-- test/browser.telemetry.test.js | 83 +- test/browser.transforms.test.js | 274 +- test/browser.transport.test.js | 100 +- test/browser.url.test.js | 23 +- test/examples/angular2.test.js | 30 +- test/examples/react.test.js | 26 +- test/examples/universalBrowser.test.js | 24 +- test/examples/universalBrowserConfig.test.js | 26 +- test/examples/webpack.test.js | 30 +- test/fixtures/locals.fixtures.js | 371 +- test/notifier.test.js | 168 +- test/predicates.test.js | 474 +- test/queue.test.js | 444 +- test/rateLimiter.test.js | 92 +- test/react-native.rollbar.test.js | 264 +- test/react-native.transforms.test.js | 44 +- test/react-native.transport.test.js | 34 +- test/server.lambda.test.js | 123 +- test/server.locals.test.js | 512 +- test/server.parser.test.js | 58 +- test/server.predicates.test.js | 88 +- test/server.rollbar.test.js | 570 ++- test/server.telemetry.test.js | 264 +- test/server.transforms.test.js | 816 +-- test/server.transport.test.js | 220 +- test/telemetry.test.js | 83 +- test/transforms.test.js | 134 +- test/truncation.test.js | 108 +- test/utility.test.js | 488 +- webpack.config.js | 88 +- 170 files changed, 20747 insertions(+), 5680 deletions(-) diff --git a/.lgtm.yml b/.lgtm.yml index 061c733f4..e72db1933 100644 --- a/.lgtm.yml +++ b/.lgtm.yml @@ -1,8 +1,8 @@ path_classifiers: - generated: - - release - - dist - docs: - - examples - test: - - test + generated: + - release + - dist + docs: + - examples + test: + - test diff --git a/CHANGELOG.md b/CHANGELOG.md index d1b9e8f98..d716945f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,7 +24,6 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co The boolean configuration options `captureEmail` and `captureUsername` can be used to change this behaviour. - ## v2.3.6 - Updates for React Native @@ -46,26 +45,26 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co ## v2.3.2 -- Be defensive about navigator not existing on window -[#514](https://github.com/rollbar/rollbar.js/pull/514) +- Be defensive about navigator not existing on window + [#514](https://github.com/rollbar/rollbar.js/pull/514) -- Proper scrubbing -[#510](https://github.com/rollbar/rollbar.js/pull/510) +- Proper scrubbing + [#510](https://github.com/rollbar/rollbar.js/pull/510) -- Be defensive when accessing event properties -[#503](https://github.com/rollbar/rollbar.js/pull/503) +- Be defensive when accessing event properties + [#503](https://github.com/rollbar/rollbar.js/pull/503) - Add environment to options type enhancement -[#499](https://github.com/rollbar/rollbar.js/pull/499) + [#499](https://github.com/rollbar/rollbar.js/pull/499) -- call the transform in the options on the server side too -[#498](https://github.com/rollbar/rollbar.js/pull/498) +- call the transform in the options on the server side too + [#498](https://github.com/rollbar/rollbar.js/pull/498) -- fixes errMsg.match is not a function error -[#492](https://github.com/rollbar/rollbar.js/pull/492) +- fixes errMsg.match is not a function error + [#492](https://github.com/rollbar/rollbar.js/pull/492) -- Call callback even if logging same as last error -[#490](https://github.com/rollbar/rollbar.js/pull/490) +- Call callback even if logging same as last error + [#490](https://github.com/rollbar/rollbar.js/pull/490) ## v2.3.1 @@ -105,16 +104,20 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co - Fix some typescript declaration issues ## v2.2.7 + - Ensure scrubbing has the right value for telemetry inputs if `scrubTelemetryInputs` is true. - Fix memory leak related to network requests ## v2.2.6 + - Fix blacklist issue ## v2.2.5 + - Revert `isNative` check for replacing JSON functions ## v2.2.4 + - Fix a "race" condition in how wait works - Add two options to control scrubbing of telemetry input events: `scrubTelemetryInputs` and `telemetryScrubber`. @@ -126,9 +129,11 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co rather than an integer. ## v2.2.3 + - Actually make collecting network telemetry on by default ## v2.2.2 + - Fix bug in network telemetry that was wrapping onreadystatechage in correctly - Enable collecting network telemetry by default - Fix stack overflow issue due to scrubbing of self-referential objects @@ -137,43 +142,48 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co - Make the typescript type declarations better ## v2.2.1 + - Disable collection of network telemetry data by default ## v2.2.0 + - Telemetry data is now collected by default in the browser. See [README.md](https://github.com/rollbar/rollbar.js#telemetry) for information and configuration details. - Fix some typos in the typescript declarations ## v2.1.3 + - Actually change version number in package.json and build all relevant files ## v2.1.2 + - Actually send the client-side UUID with the item - Fix typos in typescript declaration ## v2.1.1 -- Allow more flexibility of request objects -[#346](https://github.com/rollbar/rollbar.js/pull/346) -- Address issue with handleItemWithError possible not calling the callback -[#345](https://github.com/rollbar/rollbar.js/pull/345) -- Fixed a typo in README.md -[#343](https://github.com/rollbar/rollbar.js/pull/343) -- unify configuration options -[#341](https://github.com/rollbar/rollbar.js/pull/341) -- add some intervals to keep the event loop running when wait is called -[#338](https://github.com/rollbar/rollbar.js/pull/338) -- [Fixes #336] Propagate message -[#337](https://github.com/rollbar/rollbar.js/pull/337) -- [Fixes #269] get rid of rollbar wrapper stack frames -[#335](https://github.com/rollbar/rollbar.js/pull/335) -- first pass at a typescript declaration file -[#334](https://github.com/rollbar/rollbar.js/pull/334) -- Fix #331 Verbose logging was using the wrong key structure -[#332](https://github.com/rollbar/rollbar.js/pull/332) +- Allow more flexibility of request objects + [#346](https://github.com/rollbar/rollbar.js/pull/346) +- Address issue with handleItemWithError possible not calling the callback + [#345](https://github.com/rollbar/rollbar.js/pull/345) +- Fixed a typo in README.md + [#343](https://github.com/rollbar/rollbar.js/pull/343) +- unify configuration options + [#341](https://github.com/rollbar/rollbar.js/pull/341) +- add some intervals to keep the event loop running when wait is called + [#338](https://github.com/rollbar/rollbar.js/pull/338) +- [Fixes #336] Propagate message + [#337](https://github.com/rollbar/rollbar.js/pull/337) +- [Fixes #269] get rid of rollbar wrapper stack frames + [#335](https://github.com/rollbar/rollbar.js/pull/335) +- first pass at a typescript declaration file + [#334](https://github.com/rollbar/rollbar.js/pull/334) +- Fix #331 Verbose logging was using the wrong key structure + [#332](https://github.com/rollbar/rollbar.js/pull/332) ## v2.1.0 + - Use the upstream version of console-polyfill: [#306](https://github.com/rollbar/rollbar.js/pull/306) - The verbose option still existed but didn't do anything, this adds back the functionality to output some information to the console: [#311](https://github.com/rollbar/rollbar.js/pull/311) @@ -197,10 +207,12 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co match what we allow in the browser: [#329](https://github.com/rollbar/rollbar.js/pull/329) ## v2.0.4 + - Fixes a small typo in the unhandled rejection handler. (pr#303) -- Updated the no-conflict example to use the new noconflict bundle and updated docs. +- Updated the no-conflict example to use the new noconflict bundle and updated docs. ## v2.0.3 + - Decreased NPM package size by removing examples and coverage directories. (pr#276) - Handle unordered params on the server side. (pr#286) - Fixes a server-side bug which failed to report an error if the request did not contain a `headers` key. (pr#288) @@ -210,13 +222,16 @@ The change log has moved to this repo's [GitHub Releases Page](https://github.co - Added a no-conflict bundle for the browser. (pr#295) ## v2.0.2 + - Added/updated docs on how to use rollbar.js with React, Angular 1 & 2, Ember, Backbone.js - Fixed a bug which was not respecting the `enabled` flag. (pr#280) ## v2.0.1 + - Maintenance release - No new features or bugfixes ## v2.0.0 + This release is the first where the library supports both browser and node environments from the same package. We decided to deprecate the `rollbar-browser` npm package in favor of using the `rollbar` npm package for all javascript environments. This single codebase now handles both @@ -247,6 +262,7 @@ be noticable. However, there are a few cases where one might run in to trouble. the convenience instance located at `window.Rollbar` will be setup as this handler. **v1.9.4** + - Updated to the newest version of console-polyfill (pr#244) - Log functions now return an object with the uuid as one of the keys (pr#236) - Fix issue related to Object.assign which caused problems on IE8 (pr#246) @@ -255,16 +271,20 @@ be noticable. However, there are a few cases where one might run in to trouble. `[object Object]` (pr#249) **v1.9.3** + - Serve rollbar.js from CDNJS **v1.9.2** + - Fix bug which would break `Rollbar.wrap()` if a string was thrown. (pr#222) **v1.9.1** + - Re-add rollbar.snippet.js to the Bower distribution. (pr#196) - This re-adds `dist/rollbar.snippet.js` to be backwards compatible with v1.8.5 **v1.9.0** + - Added support for arrays as custom data. (pr#194) - Documentation added for disabling Rollbar in the presence of ad blockers. (pr#190) - Added support for unhandled rejections from Promises. (pr#192) @@ -278,21 +298,27 @@ be noticable. However, there are a few cases where one might run in to trouble. - `src` **v1.8.5** + - Support retrying after being in offline mode. (pr#186) **v1.8.4** + - Check messages body for ignored messages. (pr#180) **v1.8.3** + - Fix a bug introduced in 1.8.0 where payload options were being removed by calls to `configure()`. (pr#176) **v1.8.2** + - Using the latest error-stack-parser from NPM. (pr#171) **v1.8.1** + - Changed the error-stack-parser dependency to use git+https. (pr#168) **v1.8.0** + - Fixed a few bugs in IE9, IE8 which were not recognozing `Error` instances properly. (pr#164) - Changed the behavior of `.global()` to only store options that we know how to process. (pr#164) - Refactored the code to remove custom polyfills. (pr#164) @@ -300,24 +326,30 @@ be noticable. However, there are a few cases where one might run in to trouble. - Fixed a bug in the jQuery plugin which would cause an error to be thrown in the internal `checkIgnore()` function. (pr#161) **v1.7.5** + - Fix bug when checking window.onerror.belongsToShim. **v1.7.4** + - Don't save shim's onerror when we are building globalnotifier. This fixes tests using window.onerror on a browser console - Fix Default endpoint on docs/configuration.md **v1.7.3** + - Added a named AMD module to the list of build targets. (pr#151) **v1.7.2** + - Bumped version so that NPM lists 1.7.2 as the latest, (was pointing to 1.6.0) (issue#148) **v1.7.1** + - Integrated karma tests. (pr#130) - Added warning message for common issue with `loadFull()` **v1.7.0** + - Fixed a bug that was not recognizing custom Error subclasses as valid errors. (pr#142) - Added documentation for the `hostWhiteList` option. (pr#138) - Changed the default uncaught error level to "error" instead of "warning". @@ -326,14 +358,17 @@ be noticable. However, there are a few cases where one might run in to trouble. asynchronously. This option is set to `true` by default. **v1.6.1** + - Updated bower.json to contain only a single .js entry. (issue#126) **v1.6.0** + - Fixed a bug that caused IE 8 to not properly initialize `window.Rollbar`. (pr#129) - Fixed the `XDomainRequest` code to work properly in IE 8. - Updated error parsing to provide more useful information for IE 8 errors **v1.5.0** + - Published rollbar.js to npmjs.com as rollbar-browser. (pr#127) - Fixes a bug where thrown non-error objects were not properly handled. (pr#125) - Fixes a bug that was logging an incorrect message when the notifier was disabled. (pr#124) @@ -341,158 +376,204 @@ be noticable. However, there are a few cases where one might run in to trouble. - Lots of code cleanup and smaller minified file size. **v1.4.4** + - Remove the `window.onload` event handler from the snippet and just create the script tag for the full rollbar.js source directly. (pr#120) **v1.4.3** + - Fixed a bug that would cause the notifier to crash when run in a Selenium test. (pr#117) - Force the notifier to always use HTTPS when communicating with api.rollbar.com. (pr#116) **v1.4.2** + - Fixed a bug that occurred in FF when Rollbar logged an internal error or if verbose mode was turned on. (pr#105) **v1.4.1** + - Fixed a bug that would load the wrong AMD module if a custom "rollbar" module was already defined. - Customers should copy and paste the new snippet into their code. **v1.4.0** + - Fix a bug, (introduced in v1.3) that caused Rollbar to generate an error when used with RequireJS. - Customers should copy and paste the new snippet into their code. **v1.3.0** + - Add more strict JSHint options and fix errors/warnings. **v1.3.0-rc.4** + - Fixes IE8 bug where JSON was not defined. **v1.3.0-rc.3** + - Remove polyfill. **v1.3.0-rc.2** + - Fix main values in bower.json. **v1.3.0-rc.1** + - Fixes for IE8+ **v1.3.0-alpha.5** + - Fix rollbar.umd.min.js URL in the snippet - Remove sourceMappingURL comment due to browser bug concerns **v1.3.0-alpha.4** + - Update CHANGELOG.md. **v1.3.0-alpha.3** + - Remove repeated timer to send enqueued payloads. - Change argument name in Stack() to fix uglify bug. -- Change __DEFAULT_ROLLBARJS_URL__ to use https. -- Set window._globalRollbarOptions when calling .configure(). +- Change **DEFAULT_ROLLBARJS_URL** to use https. +- Set window.\_globalRollbarOptions when calling .configure(). **v1.3.0-alpha.2** + - Update missing dist/ files. **v1.3.0-alpha.1** + - Build the library using webpack. - Replace tracekit and use error-stack-parser. **1.2.2** + - Added `nojson` distribution, for use on sites with a Content Security Policy that disallows `unsafe-eval`. (The standard distributions ship with a built-in JSON implementation, since external libraries, such as MooTools, sometimes break the brower's built-in JSON.) If you know that the built-in JSON is not being modified in your application, or you are disallowing `unsafe-eval`, use this distribution. **1.2.1** + - Fixed bug where the global notifier not being used to atch event listener exceptions. (pr#70) **1.2.0** + - Fixed AMD build to now return the notifier instance from the `init()` method. **1.1.16 - EDIT: This version has been removed due to finding a bug that broke backward compatibility.** + - Optimized the AMD build to not create a Notifier instance until the `init()` method is called. **1.1.15** + - Fix a bug where custom context functions that returned `undefined` were causing `Rollbar.wrap()` to throw an error. **1.1.14** + - Fix a bug in IE8 where DOMException was being used even though it's not defined, (#62). **1.1.13** + - Add `responseText` and `statusText` to the data reported by the jQuery ajax plugin, (pr#61). **1.1.12** + - Fixes a bug where `DOMException` objects were not recognized as error objects. (#55). **1.1.11** + - Fixes a bug where wrapped functions were crashing when a `null` callback was given to `removeEventListener()`, (pr#50). **1.1.10** + - Pulls in the latest JSON-js changes that do not call `.toJSON()` if the method exists already. This was breaking because MooTools v1.2.4 sets `.toJSON()` to use a broken JSON stringify implementation. **1.1.9** + - Always use the custom JSON implementation since some users are initializing a library that will overwrite a working `JSON.stringify()` with a broken one after Rollbar has checked for `JSON.stringify()` correctness. **1.1.8** + - Added a callback function to `loadFull()` to support Segment.io's plugin model. **1.1.7** + - Added `verbose` and `logFunction` options, (pr#42). **1.1.6** + - Added a `_wrappedSource` key to exceptions caught by the `wrap()` method to record the source of the wrapped function. **1.1.5** + - Added a `context` parameter to `Rollbar.wrap()`, (#26). - Added a `transform` option to allow the user to read/modify the payload before we send it to Rollbar, (#41 #43). **1.1.4** + - Added the `enabled` flag to determine when we should enqueue payloads to be sent, (#28). **1.1.3** + - Fixed a bug that was causing a stack overflow error in IE8, (#38). - Shaved off a few bytes from the snippet's size. **1.1.2** + - Fixed a bug that was causing `Rollbar.configure()` to incorrectly handle overwriting array configuration. - Added in support for a `ignoredMessages` configuration option, (pr#35). - Fixed a bug that was causing some `EventListener` objects to not be unbound, (pr#33). - Updated the snippet with fixes. **1.1.1** + - Fixed a bug with default rate limits. The defaults were not applied unless Rollbar.global() was called. **1.1.0** + - Add support for AMD JS loaders and refactor rollbar.require.js into rollbar.amd.js and rollbar.commonjs.js. **1.0.0-rc.11** + - Add support for whitelisting host names/domains, (pr#31). **1.0.0-rc.10** + - Add support for using rollbar with Webpack/Browserify via `require("rollbar.require.min.js")` with examples. **1.0.0-rc.9** + - Fixed a bug that caused a wrapped async handler to break if there was no callback provided. **1.0.0-rc.8** + - Fixed a bug that created/used a global variable. **1.0.0-rc.7** + - Change default reportLevel to `debug`. Previously, calls to `Rollbar.info` and `Rollbar.debug` were filtered out under the default configuration; now they are let through. **1.0.0-rc.6** + - Fixed a bug where items were sent in reverse order when queued - Add `maxItems` global option. If defined, at most this many items per pageview will be sent. Default `0`, meaning "no limit". **1.0.0-rc.5** + - Fix invalid payload generated when a non-Error object is passed as the error (#20) - Pass correct window.onerror args to original onerror (#23) - jQuery plugin: ignore status 0 events (#22) - Fix issue where callbacks to `.debug()`, etc. were not called if reportLevel filters the item (#24) **1.0.0-rc.4** + - Fix snippet in IE8 (change `map` to a for loop) **1.0.0-rc.3** + - Remove source maps from build process (no user-facing changes) **1.0.0-rc.2** + - Send access token as a request header in browsers that support XMLHttpRequest **1.0.0-rc.1** + - Fix bug where we were attempting to wrap an object instead of a function. - https://github.com/rollbar/rollbar.js/pull/17 - Fix bug in jQuery plugin that wasn't passing along the jQuery object. @@ -501,17 +582,21 @@ be noticable. However, there are a few cases where one might run in to trouble. - https://github.com/rollbar/rollbar.js/blob/master/docs/migration_v0_to_v1.md **1.0.0-beta9** + - Fix api response JSON parsing on older browsers **1.0.0-beta8** + - Fix uncaught errors being ignored in some browsers - Default uncaught error level now `warning` instead of `error`, also configurable - Wrap `addEventListener` to get more rich stack trace info for uncaught exceptions **1.0.0-beta7** + - Use a custom JSON.stringify method if the existing one does not work properly. **1.0.0-beta4** + - Fix some documentation bugs - Changes made to the snippet to put `environment` in the `payload` key. - Remove the default `context` value and associated logic around it being either a string or a function. @@ -519,4 +604,5 @@ be noticable. However, there are a few cases where one might run in to trouble. ## Upgrade Instructions ### v1.0.x to v1.1.x + 1. Replace your rollbar snippet with the latest from the [rollbar.js quickstart docs](https://rollbar.com/docs/notifier/rollbar.js/) or from [the GitHub repo](https://github.com/rollbar/rollbar.js/blob/master/dist/rollbar.snippet.js). diff --git a/Gruntfile.js b/Gruntfile.js index d64ca5660..6e2e770b3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -2,7 +2,6 @@ * Build and test rollbar.js */ - 'use strict'; var glob = require('glob'); @@ -12,7 +11,6 @@ var fs = require('fs'); var webpackConfig = require('./webpack.config.js'); - function findTests(context) { if (context !== 'browser') { return {}; @@ -20,7 +18,7 @@ function findTests(context) { var files = glob.sync('test/**/!(server.)*.test.js'); var mapping = {}; - files.forEach(function(file) { + files.forEach(function (file) { var testName = path.basename(file, '.test.js'); mapping[testName] = file; }); @@ -39,19 +37,19 @@ function buildGruntKarmaConfig(singleRun, tests, reporters) { pattern: 'dist/**/*.js', included: false, served: true, - watched: false + watched: false, }, { pattern: 'src/**/*.js', included: false, served: true, - watched: false + watched: false, }, { pattern: 'examples/**/*.js', included: false, served: true, - watched: false + watched: false, }, // Examples HTML, set `included: true`, but they won't be executed or added @@ -60,9 +58,9 @@ function buildGruntKarmaConfig(singleRun, tests, reporters) { pattern: 'examples/**/*.html', included: true, served: true, - watched: false - } - ] + watched: false, + }, + ], }, }; @@ -72,20 +70,18 @@ function buildGruntKarmaConfig(singleRun, tests, reporters) { for (var testName in tests) { var testFile = tests[testName]; - var testConfig = config[testName] = {}; + var testConfig = (config[testName] = {}); // Special case for testing requirejs integration. // Include the requirejs module as a framework so // Karma will inclue it in the web page. if (testName === 'requirejs') { - testConfig.files = [ - {src: './dist/rollbar.umd.js', included: false} - ]; + testConfig.files = [{ src: './dist/rollbar.umd.js', included: false }]; // NOTE: requirejs should go first in case the subsequent libraries // check for the existence of `define()` testConfig.frameworks = ['requirejs', 'expect', 'mocha']; } else { - testConfig.files = [{src: [testFile]}]; + testConfig.files = [{ src: [testFile] }]; } // Special config for BrowserStack IE tests @@ -98,8 +94,7 @@ function buildGruntKarmaConfig(singleRun, tests, reporters) { return config; } - -module.exports = function(grunt) { +module.exports = function (grunt) { require('time-grunt')(grunt); var browserTests = findTests('browser'); @@ -119,7 +114,6 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-text-replace'); grunt.loadNpmTasks('grunt-vows'); - var rollbarJsSnippet = fs.readFileSync('dist/rollbar.snippet.js'); var rollbarjQuerySnippet = fs.readFileSync('dist/plugins/jquery.min.js'); @@ -129,46 +123,60 @@ module.exports = function(grunt) { vows: { all: { options: { - reporter: 'spec' + reporter: 'spec', }, - src: ['test/server.*.test.js'] - } + src: ['test/server.*.test.js'], + }, }, karma: buildGruntKarmaConfig(singleRun, browserTests, reporters), replace: { snippets: { - src: ['*.md', 'src/**/*.js', 'examples/*.+(html|js)', 'examples/*/*.+(html|js)', 'docs/**/*.md'], + src: [ + '*.md', + 'src/**/*.js', + 'examples/*.+(html|js)', + 'examples/*/*.+(html|js)', + 'docs/**/*.md', + ], overwrite: true, replacements: [ // Main rollbar snippet { - from: new RegExp('^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', 'm'), // eslint-disable-line no-control-regex - to: function(match, index, fullText, captures) { + from: new RegExp( + '^(.*// Rollbar Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar Snippet)', + 'm', + ), // eslint-disable-line no-control-regex + to: function (match, index, fullText, captures) { captures[1] = rollbarJsSnippet; return captures.join('\n'); - } + }, }, // jQuery rollbar plugin snippet { - from: new RegExp('^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', 'm'), // eslint-disable-line no-control-regex - to: function(match, index, fullText, captures) { + from: new RegExp( + '^(.*// Rollbar jQuery Snippet)[\n\r]+(.*[\n\r])*(.*// End Rollbar jQuery Snippet)', + 'm', + ), // eslint-disable-line no-control-regex + to: function (match, index, fullText, captures) { captures[1] = rollbarjQuerySnippet; return captures.join('\n'); - } + }, }, // README CI link { - from: new RegExp('(https://github\\.com/rollbar/rollbar\\.js/workflows/Rollbar\\.js%20CI/badge\\.svg\\?branch=v)([0-9a-zA-Z.-]+)'), - to: function(match, index, fullText, captures) { + from: new RegExp( + '(https://github\\.com/rollbar/rollbar\\.js/workflows/Rollbar\\.js%20CI/badge\\.svg\\?branch=v)([0-9a-zA-Z.-]+)', + ), + to: function (match, index, fullText, captures) { captures[1] = pkg.version; return captures.join(''); - } - } - ] - } - } + }, + }, + ], + }, + }, }); grunt.registerTask('build', ['webpack', 'replace:snippets']); @@ -176,12 +184,12 @@ module.exports = function(grunt) { grunt.registerTask('test', ['test-server', 'test-browser']); grunt.registerTask('release', ['build', 'copyrelease']); - grunt.registerTask('test-server', function(_target) { + grunt.registerTask('test-server', function (_target) { var tasks = ['vows']; grunt.task.run.apply(grunt.task, tasks); }); - grunt.registerTask('test-browser', function(target) { + grunt.registerTask('test-browser', function (target) { var karmaTask = 'karma' + (target ? ':' + target : ''); var tasks = [karmaTask]; grunt.task.run.apply(grunt.task, tasks); @@ -196,11 +204,11 @@ module.exports = function(grunt) { var minJs = 'dist/rollbar' + buildName + '.min.js'; var releaseJs = 'release/rollbar' + buildName + '-' + version + '.js'; - var releaseMinJs = 'release/rollbar' + buildName + '-' + version + '.min.js'; + var releaseMinJs = + 'release/rollbar' + buildName + '-' + version + '.min.js'; grunt.file.copy(js, releaseJs); grunt.file.copy(minJs, releaseMinJs); }); }); - }; diff --git a/README.md b/README.md index 2240f407c..61ad7be64 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,20 @@ [![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) - --- ## Key benefits of using Rollbar.js are: + - **Cross platform:** Rollbar.js supports both server-side and client-side Javascript, including frameworks such as React, Angular, Express, Next.js and more. - **Telemetry:** The telemetry timeline provides a list of “breadcrumbs” events that can help developers understand and fix problems in their client-side javascript. Learn more about telemetry. - **Automatic error grouping:** Rollbar aggregates Occurrences caused by the same error into Items that represent application issues. Learn more about reducing log noise. - **Advanced search:** Filter items by many different properties. Learn more about search. - **Customizable notifications:** Rollbar supports several messaging and incident management tools where your team can get notified about errors and important events by real-time alerts. Learn more about Rollbar notifications. - ## Setup Instructions 1. [Sign up for a Rollbar account](https://rollbar.com/signup). -2. For client-side Javascript, follow the [Browser Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-browser) instructions. For Node.js, follow the [Server Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-server). +2. For client-side Javascript, follow the [Browser Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-browser) instructions. For Node.js, follow the [Server Quick Start](https://docs.rollbar.com/docs/javascript#section-quick-start-server). ## Usage and Reference diff --git a/bower.json b/bower.json index 3277d005f..1dcfc3c43 100644 --- a/bower.json +++ b/bower.json @@ -1,9 +1,7 @@ { "name": "rollbar", "dependencies": {}, - "main": [ - "dist/rollbar.umd.js" - ], + "main": ["dist/rollbar.umd.js"], "ignore": [ "dist/*.nojson*", "dist/*.named-amd*", diff --git a/defaults.js b/defaults.js index 5b79ee295..c11950703 100644 --- a/defaults.js +++ b/defaults.js @@ -5,13 +5,25 @@ var version = pkg.version; module.exports = { __NOTIFIER_VERSION__: JSON.stringify(pkg.version), __JQUERY_PLUGIN_VERSION__: JSON.stringify(pkg.plugins.jquery.version), - __DEFAULT_SERVER_SCRUB_FIELDS__: JSON.stringify(pkg.defaults.server.scrubFields), - __DEFAULT_SERVER_SCRUB_HEADERS__: JSON.stringify(pkg.defaults.server.scrubHeaders), + __DEFAULT_SERVER_SCRUB_FIELDS__: JSON.stringify( + pkg.defaults.server.scrubFields, + ), + __DEFAULT_SERVER_SCRUB_HEADERS__: JSON.stringify( + pkg.defaults.server.scrubHeaders, + ), __DEFAULT_ENDPOINT__: JSON.stringify(pkg.defaults.endpoint), __DEFAULT_LOG_LEVEL__: JSON.stringify(pkg.defaults.logLevel), __DEFAULT_REPORT_LEVEL__: JSON.stringify(pkg.defaults.reportLevel), - __DEFAULT_UNCAUGHT_ERROR_LEVEL: JSON.stringify(pkg.defaults.uncaughtErrorLevel), - __DEFAULT_ROLLBARJS_URL__: JSON.stringify('https://' + pkg.cdn.host + '/rollbarjs/refs/tags/v' + version + '/rollbar.min.js'), + __DEFAULT_UNCAUGHT_ERROR_LEVEL: JSON.stringify( + pkg.defaults.uncaughtErrorLevel, + ), + __DEFAULT_ROLLBARJS_URL__: JSON.stringify( + 'https://' + + pkg.cdn.host + + '/rollbarjs/refs/tags/v' + + version + + '/rollbar.min.js', + ), __DEFAULT_MAX_ITEMS__: pkg.defaults.maxItems, - __DEFAULT_ITEMS_PER_MIN__: pkg.defaults.itemsPerMin + __DEFAULT_ITEMS_PER_MIN__: pkg.defaults.itemsPerMin, }; diff --git a/docs/extension-exceptions.md b/docs/extension-exceptions.md index 906bc16f8..9b7517870 100644 --- a/docs/extension-exceptions.md +++ b/docs/extension-exceptions.md @@ -7,7 +7,7 @@ For most websites, the path for dealing with browser extension originating excep ## Dealing with adblockers -The most common type of extension that can be problematic is adblockers. These extensions can disable loading +The most common type of extension that can be problematic is adblockers. These extensions can disable loading certain external scripts or remove elements from a page based on a simple set of heuristics. You can see a [full example](https://github.com/rollbar/rollbar.js/tree/master/examples/extension-exceptions/) @@ -24,7 +24,7 @@ Load Rollbar.js as normal. captureUncaught: true, payload: { environment: 'development', - } + }, }; ``` @@ -33,45 +33,50 @@ Add an html element with "bait" class names to be removed by adblockers. ```html -
+
``` Add functions to check for the presence and visibility of our bait div. ```js - function disableRollbar() { - Rollbar.configure({enabled: false}); - } - - function checkForAds() { - var bait = document.getElementById("blocker-bait"); +function disableRollbar() { + Rollbar.configure({ enabled: false }); +} - if (bait == null) { - disableRollbar(); - return; - } - - var baitStyles = window.getComputedStyle(bait); - if (baitStyles && ( - baitStyles.getPropertyValue('display') === 'none' || - baitStyles.getPropertyValue('visibility') === 'hidden')) { - disableRollbar(); - } - } +function checkForAds() { + var bait = document.getElementById('blocker-bait'); - function onLoadStartAdCheck() { - // Ad blockers generally execute just after load, let's delay ourselves to get behind it. - setTimeout(checkForAds, 1); + if (bait == null) { + disableRollbar(); + return; } - if (window.addEventListener !== undefined) { - window.addEventListener('load', onLoadStartAdCheck, false); - } else { - window.attachEvent('onload', onLoadStartAdCheck); + var baitStyles = window.getComputedStyle(bait); + if ( + baitStyles && + (baitStyles.getPropertyValue('display') === 'none' || + baitStyles.getPropertyValue('visibility') === 'hidden') + ) { + disableRollbar(); } +} + +function onLoadStartAdCheck() { + // Ad blockers generally execute just after load, let's delay ourselves to get behind it. + setTimeout(checkForAds, 1); +} + +if (window.addEventListener !== undefined) { + window.addEventListener('load', onLoadStartAdCheck, false); +} else { + window.attachEvent('onload', onLoadStartAdCheck); +} ``` -The above approach is likely to work in the majority of cases, *but it is not foolproof*. Extensions and their +The above approach is likely to work in the majority of cases, _but it is not foolproof_. Extensions and their behavior evolve over time and nothing stops a user from opening their console and modifying / executing code as well. A practical approach involves incrementally adjusting your detection as new exceptions occur in large numbers. diff --git a/docs/migration_v0_to_v1.md b/docs/migration_v0_to_v1.md index 2e4327123..48bb03c1a 100644 --- a/docs/migration_v0_to_v1.md +++ b/docs/migration_v0_to_v1.md @@ -7,19 +7,20 @@ ### Change the config object: ```js -var _rollbarParams = {"server.environment": "production"}; -_rollbarParams["notifier.snippet_version"] = "2"; var _rollbar=["POST_CLIENT_ITEM_ACCESS_TOKEN", _rollbarParams]; +var _rollbarParams = { 'server.environment': 'production' }; +_rollbarParams['notifier.snippet_version'] = '2'; +var _rollbar = ['POST_CLIENT_ITEM_ACCESS_TOKEN', _rollbarParams]; ``` -to +to ```js var _rollbarConfig = { - accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN", + accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN', captureUncaught: true, payload: { - environment: "production" - } + environment: 'production', + }, }; ``` @@ -29,21 +30,21 @@ e.g. ```js var _rollbarParams = { - checkIgnore: function(msg, url, lineNo, colNo, error) { + checkIgnore: function (msg, url, lineNo, colNo, error) { // don't ignore anything (default) return false; }, - context: "home#index", + context: 'home#index', itemsPerMinute: 60, - level: "error", + level: 'error', person: { id: 12345, - username: "johndoe", - email: "johndoe@example.com" + username: 'johndoe', + email: 'johndoe@example.com', }, - "server.branch": "develop", - "server.environment": "staging", - "server.host": "web1" + 'server.branch': 'develop', + 'server.environment': 'staging', + 'server.host': 'web1', }; ``` @@ -51,28 +52,28 @@ should be changed to ```js var _rollbarConfig = { - accessToken: "POST_CLIENT_ITEM_ACCESS_TOKEN", + accessToken: 'POST_CLIENT_ITEM_ACCESS_TOKEN', captureUncaught: true, - checkIgnore: function(msg, url, lineNo, colNo, error) { + checkIgnore: function (msg, url, lineNo, colNo, error) { // don't ignore anything (default) return false; }, itemsPerMinute: 60, - logLevel: "error", + logLevel: 'error', payload: { - environment: "production", - context: "home#index", + environment: 'production', + context: 'home#index', person: { id: 12345, - username: "johndoe", - email: "johndoe@example.com" + username: 'johndoe', + email: 'johndoe@example.com', }, server: { - branch: "develop", - environment: "staging", - host: "web1" - } - } + branch: 'develop', + environment: 'staging', + host: 'web1', + }, + }, }; ``` @@ -80,7 +81,6 @@ var _rollbarConfig = { For the latest snippet, see the instructions here: [https://rollbar.com/docs/notifier/rollbar.js/](https://rollbar.com/docs/notifier/rollbar.js/). - ## Update references to `_rollbar.push()` The v1 notifier has a more intuitive interface for recording errors and generic logging. @@ -118,19 +118,18 @@ try { } ``` - ### Recording a log message From ```js -_rollbar.push("Some log message"); +_rollbar.push('Some log message'); ``` to ```js -Rollbar.info("Some log message"); +Rollbar.info('Some log message'); ``` #### Including custom data @@ -138,13 +137,17 @@ Rollbar.info("Some log message"); From ```js -_rollbar.push({level: "warning", msg: "Some warning message", point: {x: 5, y: 10}}); +_rollbar.push({ + level: 'warning', + msg: 'Some warning message', + point: { x: 5, y: 10 }, +}); ``` to ```js -Rollbar.warning("Some warning message", {point: {x: 5, y: 10}}); +Rollbar.warning('Some warning message', { point: { x: 5, y: 10 } }); ``` #### Using callbacks @@ -155,11 +158,11 @@ From try { doSomething(); } catch (e) { - _rollbar.push(e, function(err, uuid) { + _rollbar.push(e, function (err, uuid) { if (err !== null) { - console.error("Could not report an exception to Rollbar, error: " + err); + console.error('Could not report an exception to Rollbar, error: ' + err); } else { - console.log("Reported exception to Rollbar, uuid: " + uuid); + console.log('Reported exception to Rollbar, uuid: ' + uuid); } }); } @@ -171,11 +174,11 @@ to try { doSomething(); } catch (e) { - Rollbar.log(e, function(err, uuid) { + Rollbar.log(e, function (err, uuid) { if (err !== null) { - console.error("Could not report an exception to Rollbar, error: " + err); + console.error('Could not report an exception to Rollbar, error: ' + err); } else { - console.log("Reported exception to Rollbar, uuid: " + uuid); + console.log('Reported exception to Rollbar, uuid: ' + uuid); } }); } diff --git a/examples/angular2/angular.json b/examples/angular2/angular.json index 88b3a7c0d..3d993ee20 100644 --- a/examples/angular2/angular.json +++ b/examples/angular2/angular.json @@ -18,13 +18,8 @@ "main": "src/main.ts", "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.app.json", - "assets": [ - "src/favicon.ico", - "src/assets" - ], - "styles": [ - "src/styles.css" - ], + "assets": ["src/favicon.ico", "src/assets"], + "styles": ["src/styles.css"], "scripts": [], "es5BrowserSupport": true }, @@ -79,26 +74,16 @@ "polyfills": "src/polyfills.ts", "tsConfig": "src/tsconfig.spec.json", "karmaConfig": "src/karma.conf.js", - "styles": [ - "src/styles.css" - ], + "styles": ["src/styles.css"], "scripts": [], - "assets": [ - "src/favicon.ico", - "src/assets" - ] + "assets": ["src/favicon.ico", "src/assets"] } }, "lint": { "builder": "@angular-devkit/build-angular:tslint", "options": { - "tsConfig": [ - "src/tsconfig.app.json", - "src/tsconfig.spec.json" - ], - "exclude": [ - "**/node_modules/**" - ] + "tsConfig": ["src/tsconfig.app.json", "src/tsconfig.spec.json"], + "exclude": ["**/node_modules/**"] } } } @@ -124,13 +109,11 @@ "builder": "@angular-devkit/build-angular:tslint", "options": { "tsConfig": "e2e/tsconfig.e2e.json", - "exclude": [ - "**/node_modules/**" - ] + "exclude": ["**/node_modules/**"] } } } } }, "defaultProject": "my-app" -} \ No newline at end of file +} diff --git a/examples/angular2/e2e/protractor.conf.js b/examples/angular2/e2e/protractor.conf.js index 86776a391..98bba7090 100644 --- a/examples/angular2/e2e/protractor.conf.js +++ b/examples/angular2/e2e/protractor.conf.js @@ -5,11 +5,9 @@ const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { allScriptsTimeout: 11000, - specs: [ - './src/**/*.e2e-spec.ts' - ], + specs: ['./src/**/*.e2e-spec.ts'], capabilities: { - 'browserName': 'chrome' + browserName: 'chrome', }, directConnect: true, baseUrl: 'http://localhost:4200/', @@ -17,12 +15,14 @@ exports.config = { jasmineNodeOpts: { showColors: true, defaultTimeoutInterval: 30000, - print: function() {} + print: function () {}, }, onPrepare() { require('ts-node').register({ - project: require('path').join(__dirname, './tsconfig.e2e.json') + project: require('path').join(__dirname, './tsconfig.e2e.json'), }); - jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); - } -}; \ No newline at end of file + jasmine + .getEnv() + .addReporter(new SpecReporter({ spec: { displayStacktrace: true } })); + }, +}; diff --git a/examples/angular2/e2e/src/app.e2e-spec.ts b/examples/angular2/e2e/src/app.e2e-spec.ts index 3b79f7c47..12ba22b16 100644 --- a/examples/angular2/e2e/src/app.e2e-spec.ts +++ b/examples/angular2/e2e/src/app.e2e-spec.ts @@ -16,8 +16,10 @@ describe('workspace-project App', () => { afterEach(async () => { // Assert that there are no errors emitted from the browser const logs = await browser.manage().logs().get(logging.Type.BROWSER); - expect(logs).not.toContain(jasmine.objectContaining({ - level: logging.Level.SEVERE, - } as logging.Entry)); + expect(logs).not.toContain( + jasmine.objectContaining({ + level: logging.Level.SEVERE, + } as logging.Entry), + ); }); }); diff --git a/examples/angular2/e2e/tsconfig.e2e.json b/examples/angular2/e2e/tsconfig.e2e.json index a6dd62202..22e04cb18 100644 --- a/examples/angular2/e2e/tsconfig.e2e.json +++ b/examples/angular2/e2e/tsconfig.e2e.json @@ -4,10 +4,6 @@ "outDir": "../out-tsc/app", "module": "commonjs", "target": "es5", - "types": [ - "jasmine", - "jasminewd2", - "node" - ] + "types": ["jasmine", "jasminewd2", "node"] } -} \ No newline at end of file +} diff --git a/examples/angular2/src/app/app-routing.module.ts b/examples/angular2/src/app/app-routing.module.ts index d425c6f56..11c2e8407 100644 --- a/examples/angular2/src/app/app-routing.module.ts +++ b/examples/angular2/src/app/app-routing.module.ts @@ -5,6 +5,6 @@ const routes: Routes = []; @NgModule({ imports: [RouterModule.forRoot(routes)], - exports: [RouterModule] + exports: [RouterModule], }) -export class AppRoutingModule { } +export class AppRoutingModule {} diff --git a/examples/angular2/src/app/app.component.html b/examples/angular2/src/app/app.component.html index b0c533d70..62e304ba1 100644 --- a/examples/angular2/src/app/app.component.html +++ b/examples/angular2/src/app/app.component.html @@ -1,8 +1,6 @@ -
-

- Rollbar example for Angular 2+ -

+
+

Rollbar example for Angular 2+

diff --git a/examples/angular2/src/app/app.component.spec.ts b/examples/angular2/src/app/app.component.spec.ts index 3fe58ce0f..b9031c734 100644 --- a/examples/angular2/src/app/app.component.spec.ts +++ b/examples/angular2/src/app/app.component.spec.ts @@ -5,12 +5,8 @@ import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async(() => { TestBed.configureTestingModule({ - imports: [ - RouterTestingModule - ], - declarations: [ - AppComponent - ], + imports: [RouterTestingModule], + declarations: [AppComponent], }).compileComponents(); })); @@ -30,6 +26,8 @@ describe('AppComponent', () => { const fixture = TestBed.createComponent(AppComponent); fixture.detectChanges(); const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to my-app!'); + expect(compiled.querySelector('h1').textContent).toContain( + 'Welcome to my-app!', + ); }); }); diff --git a/examples/angular2/src/app/app.component.ts b/examples/angular2/src/app/app.component.ts index 2fbc3e4f7..5fd4783e1 100644 --- a/examples/angular2/src/app/app.component.ts +++ b/examples/angular2/src/app/app.component.ts @@ -5,10 +5,13 @@ import * as Rollbar from 'rollbar'; @Component({ selector: 'app-root', templateUrl: './app.component.html', - styleUrls: ['./app.component.css'] + styleUrls: ['./app.component.css'], }) export class AppComponent { - constructor(@Inject(RollbarService) private rollbar: Rollbar, private ngZone: NgZone) { + constructor( + @Inject(RollbarService) private rollbar: Rollbar, + private ngZone: NgZone, + ) { // Used by rollbar.js tests window['angularAppComponent'] = this; } diff --git a/examples/angular2/src/app/app.module.ts b/examples/angular2/src/app/app.module.ts index 9b6427d67..dec95454c 100644 --- a/examples/angular2/src/app/app.module.ts +++ b/examples/angular2/src/app/app.module.ts @@ -5,19 +5,13 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; import { RollbarService, rollbarFactory, RollbarErrorHandler } from './rollbar'; - @NgModule({ - declarations: [ - AppComponent - ], - imports: [ - BrowserModule, - AppRoutingModule - ], + declarations: [AppComponent], + imports: [BrowserModule, AppRoutingModule], providers: [ { provide: ErrorHandler, useClass: RollbarErrorHandler }, - { provide: RollbarService, useFactory: rollbarFactory } + { provide: RollbarService, useFactory: rollbarFactory }, ], - bootstrap: [AppComponent] + bootstrap: [AppComponent], }) export class AppModule {} diff --git a/examples/angular2/src/app/rollbar.ts b/examples/angular2/src/app/rollbar.ts index 38e2f2a1d..9cabd196d 100644 --- a/examples/angular2/src/app/rollbar.ts +++ b/examples/angular2/src/app/rollbar.ts @@ -3,10 +3,10 @@ import { Injectable, Inject, InjectionToken, - ErrorHandler + ErrorHandler, } from '@angular/core'; -const rollbarConfig:Rollbar.Configuration = { +const rollbarConfig: Rollbar.Configuration = { accessToken: 'POST_CLIENT_ITEM_TOKEN', captureUncaught: true, captureUnhandledRejections: true, @@ -16,7 +16,7 @@ const rollbarConfig:Rollbar.Configuration = { wrapGlobalEventHandlers: false, scrubRequestBody: true, exitOnUncaughtException: false, - stackTraceLimit: 20 + stackTraceLimit: 20, }; export const RollbarService = new InjectionToken('rollbar'); @@ -25,7 +25,7 @@ export const RollbarService = new InjectionToken('rollbar'); export class RollbarErrorHandler implements ErrorHandler { constructor(@Inject(RollbarService) private rollbar: Rollbar) {} - handleError(err:any) : void { + handleError(err: any): void { this.rollbar.error(err.originalError || err); } } diff --git a/examples/angular2/src/environments/environment.prod.ts b/examples/angular2/src/environments/environment.prod.ts index 3612073bc..c9669790b 100644 --- a/examples/angular2/src/environments/environment.prod.ts +++ b/examples/angular2/src/environments/environment.prod.ts @@ -1,3 +1,3 @@ export const environment = { - production: true + production: true, }; diff --git a/examples/angular2/src/environments/environment.ts b/examples/angular2/src/environments/environment.ts index 7b4f817ad..99c3763ca 100644 --- a/examples/angular2/src/environments/environment.ts +++ b/examples/angular2/src/environments/environment.ts @@ -3,7 +3,7 @@ // The list of file replacements can be found in `angular.json`. export const environment = { - production: false + production: false, }; /* diff --git a/examples/angular2/src/index.html b/examples/angular2/src/index.html index 0450fa57c..06a1b03e7 100644 --- a/examples/angular2/src/index.html +++ b/examples/angular2/src/index.html @@ -1,14 +1,14 @@ - - - MyApp - + + + MyApp + - - - - - - + + + + + + diff --git a/examples/angular2/src/karma.conf.js b/examples/angular2/src/karma.conf.js index 5934e22d1..c5f0bfc23 100644 --- a/examples/angular2/src/karma.conf.js +++ b/examples/angular2/src/karma.conf.js @@ -10,15 +10,15 @@ module.exports = function (config) { require('karma-chrome-launcher'), require('karma-jasmine-html-reporter'), require('karma-coverage-istanbul-reporter'), - require('@angular-devkit/build-angular/plugins/karma') + require('@angular-devkit/build-angular/plugins/karma'), ], client: { - clearContext: false // leave Jasmine Spec Runner output visible in browser + clearContext: false, // leave Jasmine Spec Runner output visible in browser }, coverageIstanbulReporter: { dir: require('path').join(__dirname, '../coverage/my-app'), reports: ['html', 'lcovonly', 'text-summary'], - fixWebpackSourcePaths: true + fixWebpackSourcePaths: true, }, reporters: ['progress', 'kjhtml'], port: 9876, @@ -27,6 +27,6 @@ module.exports = function (config) { autoWatch: true, browsers: ['Chrome'], singleRun: false, - restartOnFileChange: true + restartOnFileChange: true, }); }; diff --git a/examples/angular2/src/main.ts b/examples/angular2/src/main.ts index c7b673cf4..d9a2e7e4a 100644 --- a/examples/angular2/src/main.ts +++ b/examples/angular2/src/main.ts @@ -8,5 +8,6 @@ if (environment.production) { enableProdMode(); } -platformBrowserDynamic().bootstrapModule(AppModule) - .catch(err => console.error(err)); +platformBrowserDynamic() + .bootstrapModule(AppModule) + .catch((err) => console.error(err)); diff --git a/examples/angular2/src/polyfills.ts b/examples/angular2/src/polyfills.ts index 75d639398..d15a1152a 100644 --- a/examples/angular2/src/polyfills.ts +++ b/examples/angular2/src/polyfills.ts @@ -55,8 +55,7 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. - +import 'zone.js/dist/zone'; // Included with Angular CLI. /*************************************************************************************************** * APPLICATION IMPORTS diff --git a/examples/angular2/src/test.ts b/examples/angular2/src/test.ts index 16317897b..b6d614daa 100644 --- a/examples/angular2/src/test.ts +++ b/examples/angular2/src/test.ts @@ -4,7 +4,7 @@ import 'zone.js/dist/zone-testing'; import { getTestBed } from '@angular/core/testing'; import { BrowserDynamicTestingModule, - platformBrowserDynamicTesting + platformBrowserDynamicTesting, } from '@angular/platform-browser-dynamic/testing'; declare const require: any; @@ -12,7 +12,7 @@ declare const require: any; // First, initialize the Angular testing environment. getTestBed().initTestEnvironment( BrowserDynamicTestingModule, - platformBrowserDynamicTesting() + platformBrowserDynamicTesting(), ); // Then we find all the tests. const context = require.context('./', true, /\.spec\.ts$/); diff --git a/examples/angular2/src/tsconfig.app.json b/examples/angular2/src/tsconfig.app.json index 190fd300b..fb7c566bc 100644 --- a/examples/angular2/src/tsconfig.app.json +++ b/examples/angular2/src/tsconfig.app.json @@ -4,8 +4,5 @@ "outDir": "../out-tsc/app", "types": [] }, - "exclude": [ - "test.ts", - "**/*.spec.ts" - ] + "exclude": ["test.ts", "**/*.spec.ts"] } diff --git a/examples/angular2/src/tsconfig.spec.json b/examples/angular2/src/tsconfig.spec.json index de7733630..70add2d52 100644 --- a/examples/angular2/src/tsconfig.spec.json +++ b/examples/angular2/src/tsconfig.spec.json @@ -2,17 +2,8 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": "../out-tsc/spec", - "types": [ - "jasmine", - "node" - ] + "types": ["jasmine", "node"] }, - "files": [ - "test.ts", - "polyfills.ts" - ], - "include": [ - "**/*.spec.ts", - "**/*.d.ts" - ] + "files": ["test.ts", "polyfills.ts"], + "include": ["**/*.spec.ts", "**/*.d.ts"] } diff --git a/examples/angular2/src/tslint.json b/examples/angular2/src/tslint.json index aa7c3eeb7..ca6ba8c9e 100644 --- a/examples/angular2/src/tslint.json +++ b/examples/angular2/src/tslint.json @@ -1,17 +1,7 @@ { "extends": "../tslint.json", "rules": { - "directive-selector": [ - true, - "attribute", - "app", - "camelCase" - ], - "component-selector": [ - true, - "element", - "app", - "kebab-case" - ] + "directive-selector": [true, "attribute", "app", "camelCase"], + "component-selector": [true, "element", "app", "kebab-case"] } } diff --git a/examples/angular2/tsconfig.json b/examples/angular2/tsconfig.json index 951c1748c..08df71159 100644 --- a/examples/angular2/tsconfig.json +++ b/examples/angular2/tsconfig.json @@ -12,12 +12,7 @@ "importHelpers": true, "strictNullChecks": true, "target": "es5", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ] + "typeRoots": ["node_modules/@types"], + "lib": ["es2018", "dom"] } } diff --git a/examples/angular2/tslint.json b/examples/angular2/tslint.json index 868ecba0d..5aadf5b50 100644 --- a/examples/angular2/tslint.json +++ b/examples/angular2/tslint.json @@ -1,24 +1,16 @@ { "extends": "tslint:recommended", - "rulesDirectory": [ - "codelyzer" - ], + "rulesDirectory": ["codelyzer"], "rules": { "array-type": false, "arrow-parens": false, "deprecation": { "severity": "warn" }, - "import-blacklist": [ - true, - "rxjs/Rx" - ], + "import-blacklist": [true, "rxjs/Rx"], "interface-name": false, "max-classes-per-file": false, - "max-line-length": [ - true, - 140 - ], + "max-line-length": [true, 140], "member-access": false, "member-ordering": [ true, @@ -32,34 +24,18 @@ } ], "no-consecutive-blank-lines": false, - "no-console": [ - true, - "debug", - "info", - "time", - "timeEnd", - "trace" - ], + "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], "no-empty": false, - "no-inferrable-types": [ - true, - "ignore-params" - ], + "no-inferrable-types": [true, "ignore-params"], "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, "no-use-before-declare": true, "no-var-requires": false, - "object-literal-key-quotes": [ - true, - "as-needed" - ], + "object-literal-key-quotes": [true, "as-needed"], "object-literal-sort-keys": false, "ordered-imports": false, - "quotemark": [ - true, - "single" - ], + "quotemark": [true, "single"], "trailing-comma": false, "no-output-on-prefix": true, "use-input-property-decorator": true, diff --git a/examples/bower/README.md b/examples/bower/README.md index d4ad721f0..e50a59beb 100644 --- a/examples/bower/README.md +++ b/examples/bower/README.md @@ -1,33 +1,38 @@ # Using Rollbar with [Bower](http://bower.io/) - Install rollbar.js + ``` bower install rollbar --save ``` + - Add the `_rollbarConfig` configuration to the `` of your page. + ```html ``` + - Include the Rollbar snippet just below `_rollbarConfig`. + ```html diff --git a/examples/bower/index.html b/examples/bower/index.html index efa96fd43..259ddd053 100644 --- a/examples/bower/index.html +++ b/examples/bower/index.html @@ -2,24 +2,24 @@ diff --git a/examples/browser_extension_v2/README.md b/examples/browser_extension_v2/README.md index 85029aa29..dea1da339 100644 --- a/examples/browser_extension_v2/README.md +++ b/examples/browser_extension_v2/README.md @@ -5,9 +5,9 @@ and in the content script of a Chrome/Chromium or Firefox manifest v2 extension. To load and run this demo: -* Add your Rolllbar client token (config.js for client script, background.js for background script.) -* Enable developer mode for extensions in Chrome -* Click 'Load unpacked extension', and select this folder to load. +- Add your Rolllbar client token (config.js for client script, background.js for background script.) +- Enable developer mode for extensions in Chrome +- Click 'Load unpacked extension', and select this folder to load. The background script outputs to a separate console accessed from the extensions panel in Chrome. @@ -18,16 +18,19 @@ Firefox has slightly different manifest.json requirements. This example is writt so that the same manifest.json can be used across all browsers. ### content_security_policy + According to the browser extension spec, it should be OK to only set `default-src`. This won't work for Firefox, which requires setting both `script-src` and `object-src`. This example uses the Firefox compatible content security policy, since it also works fine on Chrome and Edge. ### background.persistent + Firefox emits a warning when the `background.persistent` key is set false. This example sets the key true, as this setting works across all browsers. ### Rollbar configuration + There are some limitations on Firefox in the content script. The background script is not affected by these limitations. diff --git a/examples/browser_extension_v2/background.js b/examples/browser_extension_v2/background.js index ebbfae367..843064ad9 100644 --- a/examples/browser_extension_v2/background.js +++ b/examples/browser_extension_v2/background.js @@ -7,11 +7,414 @@ console.log('Background extension is running.'); var _rollbarConfig = { accessToken: 'ROLLBAR_CLIENT_TOKEN', captureUncaught: true, - captureUnhandledRejections: true + captureUnhandledRejections: true, }; // 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){"use strict";var n=o(1),t=o(5);_rollbarConfig=_rollbarConfig||{},_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdn.rollbar.com/rollbarjs/refs/tags/v2.26.3/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){"use strict";var n=o(2),t=o(3);function a(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}var l=0;function i(r,e){this.options=r,this._rollbarOldOnError=null;var o=l++;this.shimId=function(){return o},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[o]={handler:e,messages:[]})}var s=o(4),d=function(r,e){return new i(r,e)},c=function(r){return new s(d,r)};function u(r){return a((function(){var e=this,o=Array.prototype.slice.call(arguments,0),n={shim:e,method:r,args:o,ts:new Date};window._rollbarShims[this.shimId()].messages.push(n)}))}i.prototype.loadFull=function(r,e,o,n,t){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=a((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,a,l,i=0;o=r._rollbarShims[i++];)for(o=o.messages||[];n=o.shift();)for(a=n.args||[],i=0;ia)?(s=e.path,e.path=s.substring(0,a)+i+"&"+s.substring(a+1)):-1!==u?(s=e.path,e.path=s.substring(0,u)+i+s.substring(u)):e.path=e.path+i},createItem:function(t,e,r,n,o){for(var i,a,u,c,p,f,m=[],g=[],v=0,b=t.length;v0&&(u||(u=d({})),u.extraArgs=d(m));var k={message:i,err:a,custom:u,timestamp:y(),callback:c,notifier:r,diagnostic:{},uuid:l()};return function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(k,u),n&&p&&(k.request=p),o&&(k.lambdaContext=o),k._originalArgs=t,k.diagnostic.original_arg_types=g,k},addErrorContext:function(t,e){var r=t.data.custom||{},o=!1;try{for(var i=0;i2){var o=n.slice(0,3),i=o[2].indexOf("/");-1!==i&&(o[2]=o[2].substring(0,i));r=o.concat("0000:0000:0000:0000:0000").join(":")}}else r=null}catch(t){r=null}else r=null;t.user_ip=r}},formatArgsAsString:function(t){var e,r,n,o=[];for(e=0,r=t.length;e500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")},formatUrl:function(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r},get:function(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o=1&&r>e}function s(t,e,r,n,o,i,s){var a=null;return r&&(r=new Error(r)),r||n||(a=function(t,e,r,n,o){var i,s=e.environment||e.payload&&e.payload.environment;i=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.";var a={body:{message:{body:i,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:s,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(a.platform="browser",a.framework="browser-js",a.notifier.name="rollbar-browser-js"):"server"===t?(a.framework=e.framework||"node-js",a.notifier.name=e.notifier.name):"react-native"===t&&(a.framework=e.framework||"react-native",a.notifier.name=e.notifier.name);return a}(t,e,o,i,s)),{error:r,shouldSend:n,payload:a}}o.globalSettings={startTime:n.now(),maxItems:void 0,itemsPerMinute:void 0},o.prototype.configureGlobal=function(t){void 0!==t.startTime&&(o.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(o.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(o.globalSettings.itemsPerMinute=t.itemsPerMinute)},o.prototype.shouldSend=function(t,e){var r=(e=e||n.now())-this.startTime;(r<0||r>=6e4)&&(this.startTime=e,this.perMinCounter=0);var a=o.globalSettings.maxItems,u=o.globalSettings.itemsPerMinute;if(i(t,a,this.counter))return s(this.platform,this.platformOptions,a+" max items reached",!1);if(i(t,u,this.perMinCounter))return s(this.platform,this.platformOptions,u+" items per minute reached",!1);this.counter++,this.perMinCounter++;var c=!i(t,a,this.counter),l=c;return c=c&&!i(t,u,this.perMinCounter),s(this.platform,this.platformOptions,null,c,a,u,l)},o.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e},t.exports=o},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e,r=n.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)};t.exports=function t(){var e,r,n,o,s,a={},u=null,c=arguments.length;for(e=0;ethis.options.maxRetries&&(o=!1))}o?this._retryApiRequest(e,r):r(t)},o.prototype._retryApiRequest=function(t,e){this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;this.retryQueue.length;){var t=this.retryQueue.shift();this._makeApiRequest(t.item,t.callback)}}.bind(this),this.options.retryInterval))},o.prototype._dequeuePendingRequest=function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())},o.prototype._maybeLog=function(t,e){if(this.logger&&this.options.verbose){var r=e;if(r=(r=r||n.get(t,"body.trace.exception.message"))||n.get(t,"body.trace_chain.0.exception.message"))return void this.logger.error(r);(r=n.get(t,"body.message.body"))&&this.logger.log(r)}},o.prototype._maybeCallWait=function(){return!(!n.isFunction(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length)&&(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),!0)},t.exports=o},function(t,e,r){"use strict";var n=r(0);function o(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}o.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=n.merge(e,t),this},o.prototype.addTransform=function(t){return n.isFunction(t)&&this.transforms.push(t),this},o.prototype.log=function(t,e){if(e&&n.isFunction(e)||(e=function(){}),!this.options.enabled)return e(new Error("Rollbar is not enabled"));this.queue.addPendingItem(t);var r=t.err;this._applyTransforms(t,function(n,o){if(n)return this.queue.removePendingItem(t),e(n,null);this.queue.addItem(o,e,r,t)}.bind(this))},o.prototype._applyTransforms=function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,s=function(t,a){t?e(t,null):++r!==n?o[r](a,i,s):e(null,a)};s(null,t)},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(15),i={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,r,n,o){this.options=t,this.transport=e,this.url=r,this.truncation=n,this.jsonBackup=o,this.accessToken=t.accessToken,this.transportOptions=a(t,r)}function a(t,e){return o.getTransportFromOptions(t,i,e)}s.prototype.postItem=function(t,e){var r=o.transportOptions(this.transportOptions,"POST"),n=o.buildPayload(this.accessToken,t,this.jsonBackup);this.transport.post(this.accessToken,r,n,e)},s.prototype.buildJsonPayload=function(t,e){var r,i=o.buildPayload(this.accessToken,t,this.jsonBackup);return(r=this.truncation?this.truncation.truncate(i):n.stringify(i)).error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var r=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=n.merge(e,t),this.transportOptions=a(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,r){"use strict";var n=r(0);t.exports={buildPayload:function(t,e,r){if(!n.isType(e.context,"string")){var o=n.stringify(e.context,r);o.error?e.context="Error: could not serialize 'context'":e.context=o.value||"",e.context.length>255&&(e.context=e.context.substr(0,255))}return{access_token:t,data:e}},getTransportFromOptions:function(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,s=e.path,a=e.search,u=t.timeout,c=t.proxy;if(t.endpoint){var l=r.parse(t.endpoint);n=l.hostname,o=l.protocol,i=l.port,s=l.pathname,a=l.search}return{timeout:u,hostname:n,protocol:o,port:i,path:s,search:a,proxy:c}},transportOptions:function(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,s=t.timeout;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:s,protocol:r,hostname:o,path:i,port:n,method:e}},appendPathToPath:function(t,e){var r=/\/$/.test(t),n=/^\//.test(e);return r&&n?e=e.substring(1):r||n||(e="/"+e),t+e}}},function(t,e){!function(t){"use strict";t.console||(t.console={});for(var e,r,n=t.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=i.pop();)n[e]||(n[e]={});for(;r=s.pop();)n[r]||(n[r]=o)}("undefined"==typeof window?this:window)},function(t,e,r){"use strict";var n={ieVersion:function(){if("undefined"!=typeof document){for(var t=3,e=document.createElement("div"),r=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]>4?t:void 0}}};t.exports=n},function(t,e,r){"use strict";function n(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}t.exports={captureUncaughtExceptions:function(t,e,r){if(t){var o;if("function"==typeof e._rollbarOldOnError)o=e._rollbarOldOnError;else if(t.onerror){for(o=t.onerror;o._rollbarOldOnError;)o=o._rollbarOldOnError;e._rollbarOldOnError=o}e.handleAnonymousErrors();var i=function(){var r=Array.prototype.slice.call(arguments,0);n(t,e,o,r)};r&&(i._rollbarOldOnError=o),t.onerror=i}},captureUnhandledRejections:function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}}},function(t,e,r){"use strict";var n=r(0),o=r(1);function i(t){this.truncation=t}function s(){var t="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,e=t&&t.Zone&&t.Zone.current,r=Array.prototype.slice.call(arguments);if(e&&"angular"===e._name){var n=e._parent;n.run((function(){a.apply(void 0,r)}))}else a.apply(void 0,r)}function a(t,e,r,i,s,a,c){if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,(function(t){}),(function(t){e(new Error(t))}))}(i,s);var l;if(!(l=a?a():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e=400&&t.status<600}(l)){if(403===l.status){var e=t.value&&t.value.message;o.error(e)}s(new Error(String(l.status)))}else{s(u("XHR response had no status code (likely connection failure)"))}}}catch(t){var r;r=t&&t.stack?t:new Error(t),s(r)}var i};l.open(r,e,!0),l.setRequestHeader&&(l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("X-Rollbar-Access-Token",t)),n.isFiniteNumber(c)&&(l.timeout=c),l.onreadystatechange=p,l.send(i)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return s(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===e.substring(0,5)&&(e="http"+e.substring(5));var f=new XDomainRequest;f.onprogress=function(){},f.ontimeout=function(){s(u("Request timed out","ETIMEDOUT"))},f.onerror=function(){s(new Error("Error during request"))},f.onload=function(){var t=n.jsonParse(f.responseText);s(t.error,t.value)},f.open(r,e,!0),f.send(i)}else s(new Error("Cannot find a method to transport a request"))}}catch(t){s(t)}}function u(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}i.prototype.get=function(t,e,r,o,i){o&&n.isFunction(o)||(o=function(){}),n.addParamsAndAccessTokenToPath(t,e,r);s(t,n.formatUrl(e),"GET",null,o,i,e.timeout)},i.prototype.post=function(t,e,r,o,i){if(o&&n.isFunction(o)||(o=function(){}),!r)return o(new Error("Cannot send empty request"));var a;if((a=this.truncation?this.truncation.truncate(r):n.stringify(r)).error)return o(a.error);var u=a.value;s(t,n.formatUrl(e),"POST",u,o,i,e.timeout)},i.prototype.postJsonPayload=function(t,e,r,o,i){o&&n.isFunction(o)||(o=function(){});s(t,n.formatUrl(e),"POST",r,o,i,e.timeout)},t.exports=i},function(t,e,r){"use strict";var n=r(0),o=r(3),i=r(1);function s(t,e,r){var o=t.message,i=t.custom;o||(o="Item sent with null or missing arguments.");var s={body:o};i&&(s.extra=n.merge(i)),n.set(t,"data.body",{message:s}),r(null,t)}function a(t){var e=t.stackInfo.stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function u(t,e,r){var i=t&&t.data.description,s=t&&t.custom,u=a(t),l=o.guessErrorClass(e.message),p={exception:{class:c(e,l[0],r),message:l[1]}};if(i&&(p.exception.description=i),u){var f,h,d,m,g,v,y,b;for(0===u.length&&(p.exception.stack=e.rawStack,p.exception.raw=String(e.rawException)),p.frames=[],y=0;y-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(\),.*$)/g,""));var r=e.replace(/^\s+/,"").replace(/\(eval code/g,"("),n=r.match(/ (\((.+):(\d+):(\d+)\)$)/),o=(r=n?r.replace(n[0],""):r).split(/\s+/).slice(1),i=this.extractLocation(n?n[1]:o.pop()),s=o.join(" ")||void 0,a=["eval",""].indexOf(i[0])>-1?void 0:i[0];return new t({functionName:s,fileName:a,lineNumber:i[1],columnNumber:i[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(t){return!t.match(n)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(r,""));return new t({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[],i=2,s=n.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(r=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new t({functionName:s,args:a,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}}})?n.apply(e,o):n)||(t.exports=i)}()},function(t,e,r){var n,o,i;!function(r,s){"use strict";o=[],void 0===(i="function"==typeof(n=function(){function t(t){return t.charAt(0).toUpperCase()+t.substring(1)}function e(t){return function(){return this[t]}}var r=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],o=["fileName","functionName","source"],i=r.concat(n,o,["args"],["evalOrigin"]);function s(e){if(e)for(var r=0;ro&&(i=this.maxQueueSize-o),this.maxQueueSize=o,this.queue.splice(0,i)},o.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(n.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},o.prototype.capture=function(t,e,r,o,s){var a={level:i(t,r),type:t,timestamp_ms:s||n.now(),body:e,source:"client"};o&&(a.uuid=o);try{if(n.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a},o.prototype.captureEvent=function(t,e,r,n){return this.capture(t,e,r,n)},o.prototype.captureError=function(t,e,r,n){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,r,n)},o.prototype.captureLog=function(t,e,r,n){return this.capture("log",{message:t},e,r,n)},o.prototype.captureNetwork=function(t,e,r,n){e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,r)},o.prototype.levelFromStatus=function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"},o.prototype.captureDom=function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)},o.prototype.captureNavigation=function(t,e,r){return this.capture("navigation",{from:t,to:e},"info",r)},o.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},o.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},o.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},o.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},o.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(4),i=r(2),s=r(30),a={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function u(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])}function c(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function l(t,e,r,o,i){this.options=t;var s=t.autoInstrument;!1===t.enabled||!1===s?this.autoInstrument={}:(n.isType(s,"object")||(s=a),this.autoInstrument=n.merge(a,s)),this.scrubTelemetryInputs=!!t.scrubTelemetryInputs,this.telemetryScrubber=t.telemetryScrubber,this.defaultValueScrubber=function(t){for(var e=[],r=0;r3)){i.__rollbar_xhr.end_time_ms=n.now();var e=null;if(i.__rollbar_xhr.response_content_type=i.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var r=t.autoInstrument.networkResponseHeaders;e={};try{var s,a;if(!0===r){var u=i.getAllResponseHeaders();if(u){var c,l,p=u.trim().split(/[\r\n]+/);for(a=0;a=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}},l.prototype.deinstrumentConsole=function(){if("console"in this._window&&this._window.console.log)for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]},l.prototype.instrumentConsole=function(){if("console"in this._window&&this._window.console.log){var t=this,e=this._window.console,r=["debug","info","warn","error","log"];try{for(var o=0,i=r.length;o=0&&t.options[t.selectedIndex]&&this.captureDomEvent("input",t,t.options[t.selectedIndex].value)},l.prototype.captureDomEvent=function(t,e,r,n){if(void 0!==r)if(this.scrubTelemetryInputs||"password"===s.getElementType(e))r="[scrubbed]";else{var o=s.describeElement(e);this.telemetryScrubber?this.telemetryScrubber(o)&&(r="[scrubbed]"):this.defaultValueScrubber(o)&&(r="[scrubbed]")}var i=s.elementArrayToString(s.treeToArray(e));this.telemeter.captureDom(t,i,r,n)},l.prototype.deinstrumentNavigation=function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&c(this.replacements,"navigation")},l.prototype.instrumentNavigation=function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;u(this._window,"onpopstate",(function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}}),this.replacements,"navigation"),u(this._window.history,"pushState",(function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,r+""),t.apply(this,arguments)}}),this.replacements,"navigation")}},l.prototype.handleUrlChange=function(t,e){var r=i.parse(this._location.href),n=i.parse(e),o=i.parse(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e)},l.prototype.deinstrumentConnectivity=function(){("addEventListener"in this._window||"body"in this._document)&&(this._window.addEventListener?this.removeListeners("connectivity"):c(this.replacements,"connectivity"))},l.prototype.instrumentConnectivity=function(){if("addEventListener"in this._window||"body"in this._document)if(this._window.addEventListener)this.addListener("connectivity",this._window,"online",void 0,function(){this.telemeter.captureConnectivityChange("online")}.bind(this),!0),this.addListener("connectivity",this._window,"offline",void 0,function(){this.telemeter.captureConnectivityChange("offline")}.bind(this),!0);else{var t=this;u(this._document.body,"ononline",(function(e){return function(){t.telemeter.captureConnectivityChange("online"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity"),u(this._document.body,"onoffline",(function(e){return function(){t.telemeter.captureConnectivityChange("offline"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity")}},l.prototype.handleCspEvent=function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error"),this.handleCspError(e)},l.prototype.handleCspError=function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)},l.prototype.deinstrumentContentSecurityPolicy=function(){"addEventListener"in this._document&&this.removeListeners("contentsecuritypolicy")},l.prototype.instrumentContentSecurityPolicy=function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,"securitypolicyviolation",null,t,!1)}},l.prototype.addListener=function(t,e,r,n,o,i){e.addEventListener?(e.addEventListener(r,o,i),this.eventRemovers[t].push((function(){e.removeEventListener(r,o,i)}))):n&&(e.attachEvent(n,o),this.eventRemovers[t].push((function(){e.detachEvent(n,o)})))},l.prototype.removeListeners=function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()},t.exports=l},function(t,e,r){"use strict";function n(t){return(t.getAttribute("type")||"").toLowerCase()}function o(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));for(var r=0;r=0;a--){if(e=o(t[a]),r=s+i.length*n+e.length,a=83){i.unshift("...");break}i.unshift(e),s+=e.length}return i.join(" > ")},treeToArray:function(t){for(var e,r=[],n=0;t&&n<5&&"html"!==(e=i(t)).tagName;n++)r.unshift(e),t=t.parentNode;return r},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,r){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!r)return!0;t=n(t);for(var o=0;o2*e?t.slice(0,e).concat(t.slice(r-e)):t}function a(t,e,r){r=void 0===r?30:r;var o,i=t.data.body;if(i.trace_chain)for(var a=i.trace_chain,u=0;ut?e.slice(0,t-3).concat("..."):e}function c(t,e,r){return[e=o(e,(function e(r,i,s){switch(n.typeName(i)){case"string":return u(t,i);case"object":case"array":return o(i,e,s);default:return i}})),n.stringify(e,r)]}function l(t){return t.exception&&(delete t.exception.description,t.exception.message=u(255,t.exception.message)),t.frames=s(t.frames,1),t}function p(t,e){var r=t.data.body;if(r.trace_chain)for(var o=r.trace_chain,i=0;ie}t.exports={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,s,u=[i,a,c.bind(null,1024),c.bind(null,512),c.bind(null,256),p];n=u.shift();)if(t=(o=n(t,e))[0],(s=o[1]).error||!f(s.value,r))return s;return s},raw:i,truncateFrames:a,truncateStrings:c,maybeTruncateValue:u}}]); +!(function (t) { + var e = {}; + function r(n) { + if (e[n]) return e[n].exports; + var o = (e[n] = { i: n, l: !1, exports: {} }); + return t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; + } + (r.m = t), + (r.c = e), + (r.d = function (t, e, n) { + r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); + }), + (r.r = function (t) { + 'undefined' != typeof Symbol && + Symbol.toStringTag && + Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), + Object.defineProperty(t, '__esModule', { value: !0 }); + }), + (r.t = function (t, e) { + if ((1 & e && (t = r(t)), 8 & e)) return t; + if (4 & e && 'object' == typeof t && t && t.__esModule) return t; + var n = Object.create(null); + if ( + (r.r(n), + Object.defineProperty(n, 'default', { enumerable: !0, value: t }), + 2 & e && 'string' != typeof t) + ) + for (var o in t) + r.d( + n, + o, + function (e) { + return t[e]; + }.bind(null, o), + ); + return n; + }), + (r.n = function (t) { + var e = + t && t.__esModule + ? function () { + return t.default; + } + : function () { + return t; + }; + return r.d(e, 'a', e), e; + }), + (r.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (r.p = ''), + r((r.s = 6)); +})([ + function (t, e, r) { + 'use strict'; + var n = r(11), + o = {}; + function i(t, e) { + return e === s(t); + } + function s(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 i(t, 'function'); + } + function u(t) { + var e = Function.prototype.toString + .call(Object.prototype.hasOwnProperty) + .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace( + /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, + '$1.*?', + ), + r = RegExp('^' + e + '$'); + return c(t) && r.test(t); + } + function c(t) { + var e = typeof t; + return null != t && ('object' == e || 'function' == e); + } + function l() { + var t = y(); + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace( + /[xy]/g, + function (e) { + var r = (t + 16 * Math.random()) % 16 | 0; + return ( + (t = Math.floor(t / 16)), ('x' === e ? r : (7 & r) | 8).toString(16) + ); + }, + ); + } + var p = { + strictMode: !1, + key: [ + 'source', + 'protocol', + 'authority', + 'userInfo', + 'user', + 'password', + 'host', + 'port', + 'relative', + 'path', + 'directory', + 'file', + 'query', + 'anchor', + ], + q: { name: 'queryKey', parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, + parser: { + strict: + /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, + loose: + /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, + }, + }; + function f(t, e) { + var r, n; + try { + r = o.stringify(t); + } catch (o) { + if (e && a(e)) + try { + r = e(t); + } catch (t) { + n = t; + } + else n = o; + } + return { error: n, value: r }; + } + function h(t, e) { + return function (r, n) { + try { + e(r, n); + } catch (e) { + t.error(e); + } + }; + } + function d(t) { + return (function t(e, r) { + var n, + o, + a, + u = {}; + try { + for (o in e) + (n = e[o]) && (i(n, 'object') || i(n, 'array')) + ? r.includes(n) + ? (u[o] = 'Removed circular reference: ' + s(n)) + : ((a = r.slice()).push(n), (u[o] = t(n, a))) + : (u[o] = n); + } catch (t) { + u = 'Failed cloning custom data: ' + t.message; + } + return u; + })(t, [t]); + } + var m = ['log', 'network', 'dom', 'navigation', 'error', 'manual'], + g = ['critical', 'error', 'warning', 'info', 'debug']; + function v(t, e) { + for (var r = 0; r < t.length; ++r) if (t[r] === e) return !0; + return !1; + } + function y() { + return Date.now ? +Date.now() : +new Date(); + } + t.exports = { + addParamsAndAccessTokenToPath: function (t, e, r) { + (r = r || {}).access_token = t; + var n, + o = []; + for (n in r) + Object.prototype.hasOwnProperty.call(r, n) && + o.push([n, r[n]].join('=')); + var i = '?' + o.sort().join('&'); + (e = e || {}).path = e.path || ''; + var s, + a = e.path.indexOf('?'), + u = e.path.indexOf('#'); + -1 !== a && (-1 === u || u > a) + ? ((s = e.path), + (e.path = s.substring(0, a) + i + '&' + s.substring(a + 1))) + : -1 !== u + ? ((s = e.path), (e.path = s.substring(0, u) + i + s.substring(u))) + : (e.path = e.path + i); + }, + createItem: function (t, e, r, n, o) { + for ( + var i, a, u, c, p, f, m = [], g = [], v = 0, b = t.length; + v < b; + ++v + ) { + var w = s((f = t[v])); + switch ((g.push(w), w)) { + case 'undefined': + break; + case 'string': + i ? m.push(f) : (i = f); + break; + case 'function': + c = h(e, f); + break; + case 'date': + m.push(f); + break; + case 'error': + case 'domexception': + case 'exception': + a ? m.push(f) : (a = f); + break; + case 'object': + case 'array': + if ( + f instanceof Error || + ('undefined' != typeof DOMException && + f instanceof DOMException) + ) { + a ? m.push(f) : (a = f); + break; + } + if (n && 'object' === w && !p) { + for (var _ = 0, x = n.length; _ < x; ++_) + if (void 0 !== f[n[_]]) { + p = f; + break; + } + if (p) break; + } + u ? m.push(f) : (u = f); + break; + default: + if ( + f instanceof Error || + ('undefined' != typeof DOMException && + f instanceof DOMException) + ) { + a ? m.push(f) : (a = f); + break; + } + m.push(f); + } + } + u && (u = d(u)), + m.length > 0 && (u || (u = d({})), (u.extraArgs = d(m))); + var k = { + message: i, + err: a, + custom: u, + timestamp: y(), + callback: c, + notifier: r, + diagnostic: {}, + uuid: l(), + }; + return ( + (function (t, e) { + e && void 0 !== e.level && ((t.level = e.level), delete e.level); + e && + void 0 !== e.skipFrames && + ((t.skipFrames = e.skipFrames), delete e.skipFrames); + })(k, u), + n && p && (k.request = p), + o && (k.lambdaContext = o), + (k._originalArgs = t), + (k.diagnostic.original_arg_types = g), + k + ); + }, + addErrorContext: function (t, e) { + var r = t.data.custom || {}, + o = !1; + try { + for (var i = 0; i < e.length; ++i) + e[i].hasOwnProperty('rollbarContext') && + ((r = n(r, d(e[i].rollbarContext))), (o = !0)); + o && (t.data.custom = r); + } catch (e) { + t.diagnostic.error_context = 'Failed: ' + e.message; + } + }, + createTelemetryEvent: function (t) { + for (var e, r, n, o, i = 0, a = t.length; i < a; ++i) { + switch (s((o = t[i]))) { + case 'string': + !e && v(m, o) ? (e = o) : !n && v(g, o) && (n = o); + break; + case 'object': + r = o; + } + } + return { type: e || 'manual', metadata: r || {}, level: n }; + }, + filterIp: function (t, e) { + if (t && t.user_ip && !0 !== e) { + var r = t.user_ip; + if (e) + try { + var n; + if (-1 !== r.indexOf('.')) + (n = r.split('.')).pop(), n.push('0'), (r = n.join('.')); + else if (-1 !== r.indexOf(':')) { + if ((n = r.split(':')).length > 2) { + var o = n.slice(0, 3), + i = o[2].indexOf('/'); + -1 !== i && (o[2] = o[2].substring(0, i)); + r = o.concat('0000:0000:0000:0000:0000').join(':'); + } + } else r = null; + } catch (t) { + r = null; + } + else r = null; + t.user_ip = r; + } + }, + formatArgsAsString: function (t) { + var e, + r, + n, + o = []; + for (e = 0, r = t.length; e < r; ++e) { + switch (s((n = t[e]))) { + case 'object': + (n = (n = f(n)).error || n.value).length > 500 && + (n = n.substr(0, 497) + '...'); + break; + case 'null': + n = 'null'; + break; + case 'undefined': + n = 'undefined'; + break; + case 'symbol': + n = n.toString(); + } + o.push(n); + } + return o.join(' '); + }, + formatUrl: function (t, e) { + if ( + (!(e = e || t.protocol) && + t.port && + (80 === t.port ? (e = 'http:') : 443 === t.port && (e = 'https:')), + (e = e || 'https:'), + !t.hostname) + ) + return null; + var r = e + '//' + t.hostname; + return t.port && (r = r + ':' + t.port), t.path && (r += t.path), r; + }, + get: function (t, e) { + if (t) { + var r = e.split('.'), + n = t; + try { + for (var o = 0, i = r.length; o < i; ++o) n = n[r[o]]; + } catch (t) { + n = void 0; + } + return n; + } + }, + handleOptions: function (t, e, r, o) { + var i = n(t, e, r); + return ( + (i = (function (t, e) { + t.hostWhiteList && + !t.hostSafeList && + ((t.hostSafeList = t.hostWhiteList), + (t.hostWhiteList = void 0), + e && e.log('hostWhiteList is deprecated. Use hostSafeList.')); + t.hostBlackList && + !t.hostBlockList && + ((t.hostBlockList = t.hostBlackList), + (t.hostBlackList = void 0), + e && e.log('hostBlackList is deprecated. Use hostBlockList.')); + return t; + })(i, o)), + !e || + e.overwriteScrubFields || + (e.scrubFields && + (i.scrubFields = (t.scrubFields || []).concat(e.scrubFields))), + i + ); + }, + isError: function (t) { + return i(t, 'error') || i(t, 'exception'); + }, + isFiniteNumber: function (t) { + return Number.isFinite(t); + }, + isFunction: a, + isIterable: function (t) { + var e = s(t); + return 'object' === e || 'array' === e; + }, + isNativeFunction: u, + isObject: c, + isString: function (t) { + return 'string' == typeof t || t instanceof String; + }, + isType: i, + isPromise: function (t) { + return c(t) && i(t.then, 'function'); + }, + jsonParse: function (t) { + var e, r; + try { + e = o.parse(t); + } catch (t) { + r = t; + } + return { error: r, value: e }; + }, + LEVELS: { debug: 0, info: 1, warning: 2, error: 3, critical: 4 }, + makeUnhandledStackInfo: function (t, e, r, n, o, i, s, a) { + var u = { url: e || '', line: r, column: n }; + (u.func = a.guessFunctionName(u.url, u.line)), + (u.context = a.gatherContext(u.url, u.line)); + var c = + 'undefined' != typeof document && + document && + document.location && + document.location.href, + l = + 'undefined' != typeof window && + window && + window.navigator && + window.navigator.userAgent; + return { + mode: i, + message: o ? String(o) : t || s, + url: c, + stack: [u], + useragent: l, + }; + }, + merge: n, + now: y, + redact: function () { + return '********'; + }, + RollbarJSON: o, + sanitizeUrl: function (t) { + var e = (function (t) { + if (!i(t, 'string')) return; + for ( + var e = p, + r = e.parser[e.strictMode ? 'strict' : 'loose'].exec(t), + n = {}, + o = 0, + s = e.key.length; + o < s; + ++o + ) + n[e.key[o]] = r[o] || ''; + return ( + (n[e.q.name] = {}), + n[e.key[12]].replace(e.q.parser, function (t, r, o) { + r && (n[e.q.name][r] = o); + }), + n + ); + })(t); + return e + ? ('' === e.anchor && (e.source = e.source.replace('#', '')), + (t = e.source.replace('?' + e.query, ''))) + : '(unknown)'; + }, + set: function (t, e, r) { + if (t) { + var n = e.split('.'), + o = n.length; + if (!(o < 1)) + if (1 !== o) + try { + for (var i = t[n[0]] || {}, s = i, a = 1; a < o - 1; ++a) + (i[n[a]] = i[n[a]] || {}), (i = i[n[a]]); + (i[n[o - 1]] = r), (t[n[0]] = s); + } catch (t) { + return; + } + else t[n[0]] = r; + } + }, + setupJSON: function (t) { + (a(o.stringify) && a(o.parse)) || + (i(JSON, 'undefined') || + (t + ? (u(JSON.stringify) && (o.stringify = JSON.stringify), + u(JSON.parse) && (o.parse = JSON.parse)) + : (a(JSON.stringify) && (o.stringify = JSON.stringify), + a(JSON.parse) && (o.parse = JSON.parse))), + (a(o.stringify) && a(o.parse)) || (t && t(o))); + }, + stringify: f, + maxByteSize: function (t) { + for (var e = 0, r = t.length, n = 0; n < r; n++) { + var o = t.charCodeAt(n); + o < 128 ? (e += 1) : o < 2048 ? (e += 2) : o < 65536 && (e += 3); + } + return e; + }, + typeName: s, + uuid4: l, + }; + }, + function (t, e, r) { + 'use strict'; + r(16); + var n = r(17), + o = r(0); + t.exports = { + error: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.error(o.formatArgsAsString(t)) + : console.error.apply(console, t); + }, + info: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.info(o.formatArgsAsString(t)) + : console.info.apply(console, t); + }, + log: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.log(o.formatArgsAsString(t)) + : console.log.apply(console, t); + }, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + parse: function (t) { + var e, + r, + n = { + protocol: null, + auth: null, + host: null, + path: null, + hash: null, + href: t, + hostname: null, + port: null, + pathname: null, + search: null, + query: null, + }; + if ( + (-1 !== (e = t.indexOf('//')) + ? ((n.protocol = t.substring(0, e)), (r = e + 2)) + : (r = 0), + -1 !== (e = t.indexOf('@', r)) && + ((n.auth = t.substring(r, e)), (r = e + 1)), + -1 === (e = t.indexOf('/', r))) + ) { + if (-1 === (e = t.indexOf('?', r))) + return ( + -1 === (e = t.indexOf('#', r)) + ? (n.host = t.substring(r)) + : ((n.host = t.substring(r, e)), (n.hash = t.substring(e))), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + n + ); + (n.host = t.substring(r, e)), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + (r = e); + } else + (n.host = t.substring(r, e)), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + (r = e); + if ( + (-1 === (e = t.indexOf('#', r)) + ? (n.path = t.substring(r)) + : ((n.path = t.substring(r, e)), (n.hash = t.substring(e))), + n.path) + ) { + var o = n.path.split('?'); + (n.pathname = o[0]), + (n.query = o[1]), + (n.search = n.query ? '?' + n.query : null); + } + return n; + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(21), + o = new RegExp( + '^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ', + ); + function i() { + return null; + } + function s(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 a(t, e) { + return { + stack: (function () { + var r = []; + e = e || 0; + try { + r = n.parse(t); + } catch (t) { + r = []; + } + for (var o = [], i = e; i < r.length; i++) o.push(new s(r[i])); + return o; + })(), + message: t.message, + name: u(t), + rawStack: t.stack, + rawException: t, + }; + } + function u(t) { + var e = t.name && t.name.length && t.name, + r = + t.constructor.name && t.constructor.name.length && t.constructor.name; + return e && r ? ('Error' === e ? r : e) : e || r; + } + t.exports = { + guessFunctionName: function () { + return '?'; + }, + guessErrorClass: function (t) { + if (!t || !t.match) + return ['Unknown error. There was no error message to display.', '']; + var e = t.match(o), + r = '(unknown)'; + return ( + e && + ((r = e[e.length - 1]), + (t = (t = t.replace((e[e.length - 2] || '') + r + ':', '')).replace( + /(^[\s]+|[\s]+$)/g, + '', + ))), + [r, t] + ); + }, + gatherContext: i, + parse: function (t, e) { + var r = t; + if (r.nested || r.cause) { + for (var n = []; r; ) + n.push(new a(r, e)), (r = r.nested || r.cause), (e = 0); + return (n[0].traceChain = n), n[0]; + } + return new a(r, e); + }, + Stack: a, + Frame: s, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(5); + function i(t, e) { + var r = e.split('.'), + o = r.length - 1; + try { + for (var i = 0; i <= o; ++i) + i < o ? (t = t[r[i]]) : (t[r[i]] = n.redact()); + } catch (t) {} + } + t.exports = function (t, e, r) { + if (((e = e || []), r)) for (var s = 0; s < r.length; ++s) i(t, r[s]); + var a = (function (t) { + for (var e, r = [], n = 0; n < t.length; ++n) + (e = '^\\[?(%5[bB])?' + t[n] + '\\[?(%5[bB])?\\]?(%5[dD])?$'), + r.push(new RegExp(e, 'i')); + return r; + })(e), + u = (function (t) { + for (var e, r = [], n = 0; n < t.length; ++n) + (e = '\\[?(%5[bB])?' + t[n] + '\\[?(%5[bB])?\\]?(%5[dD])?'), + r.push(new RegExp('(' + e + '=)([^&\\n]+)', 'igm')); + return r; + })(e); + function c(t, e) { + return e + n.redact(); + } + return o(t, function t(e, r, i) { + var s = (function (t, e) { + var r; + for (r = 0; r < a.length; ++r) + if (a[r].test(t)) { + e = n.redact(); + break; + } + return e; + })(e, r); + return s === r + ? n.isType(r, 'object') || n.isType(r, 'array') + ? o(r, t, i) + : (function (t) { + var e; + if (n.isType(t, 'string')) + for (e = 0; e < u.length; ++e) t = t.replace(u[e], c); + return t; + })(s) + : s; + }); + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = function (t, e, r) { + var o, + i, + s, + a, + u = n.isType(t, 'object'), + c = n.isType(t, 'array'), + l = []; + if (((r = r || { obj: [], mapped: [] }), u)) { + if (((a = r.obj.indexOf(t)), u && -1 !== a)) + return r.mapped[a] || r.obj[a]; + r.obj.push(t), (a = r.obj.length - 1); + } + if (u) + for (o in t) Object.prototype.hasOwnProperty.call(t, o) && l.push(o); + else if (c) for (s = 0; s < t.length; ++s) l.push(s); + var p = u ? {} : [], + f = !0; + for (s = 0; s < l.length; ++s) + (i = t[(o = l[s])]), (p[o] = e(o, i, r)), (f = f && p[o] === t[o]); + return u && !f && (r.mapped[a] = p), f ? t : p; + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(7), + o = 'undefined' != typeof window && window._rollbarConfig, + i = (o && o.globalAlias) || 'Rollbar', + s = + 'undefined' != typeof window && + window[i] && + 'function' == typeof window[i].shimId && + void 0 !== window[i].shimId(); + if ( + ('undefined' == typeof window || + window._rollbarStartTime || + (window._rollbarStartTime = new Date().getTime()), + !s && o) + ) { + var a = new n(o); + window[i] = a; + } else + 'undefined' != typeof window + ? ((window.rollbar = n), (window._rollbarDidLoad = !0)) + : 'undefined' != typeof self && + ((self.rollbar = n), (self._rollbarDidLoad = !0)); + t.exports = n; + }, + function (t, e, r) { + 'use strict'; + var n = r(8), + o = r(28), + i = r(29), + s = r(31), + a = r(33), + u = r(4), + c = r(34); + n.setComponents({ + telemeter: o, + instrumenter: i, + polyfillJSON: s, + wrapGlobals: a, + scrub: u, + truncation: c, + }), + (t.exports = n); + }, + function (t, e, r) { + 'use strict'; + var n = r(9), + o = r(0), + i = r(14), + s = r(1), + a = r(18), + u = r(19), + c = r(2), + l = r(20), + p = r(23), + f = r(24), + h = r(25), + d = r(3); + function m(t, e) { + (this.options = o.handleOptions(x, t, null, s)), + (this.options._configuredOptions = t); + var r = this.components.telemeter, + a = this.components.instrumenter, + d = this.components.polyfillJSON; + (this.wrapGlobals = this.components.wrapGlobals), + (this.scrub = this.components.scrub); + var m = this.components.truncation, + g = new u(m), + v = new i(this.options, g, c, m); + r && (this.telemeter = new r(this.options)), + (this.client = + e || new n(this.options, v, s, this.telemeter, 'browser')); + var y = b(), + w = 'undefined' != typeof document && document; + (this.isChrome = y.chrome && y.chrome.runtime), + (this.anonymousErrorsPending = 0), + (function (t, e, r) { + t.addTransform(l.handleDomException) + .addTransform(l.handleItemWithError) + .addTransform(l.ensureItemHasSomethingToSay) + .addTransform(l.addBaseInfo) + .addTransform(l.addRequestInfo(r)) + .addTransform(l.addClientInfo(r)) + .addTransform(l.addPluginInfo(r)) + .addTransform(l.addBody) + .addTransform(p.addMessageWithError) + .addTransform(p.addTelemetryData) + .addTransform(p.addConfigToPayload) + .addTransform(l.addScrubber(e.scrub)) + .addTransform(p.userTransform(s)) + .addTransform(p.addConfiguredOptions) + .addTransform(p.addDiagnosticKeys) + .addTransform(p.itemToPayload); + })(this.client.notifier, this, y), + this.client.queue + .addPredicate(h.checkLevel) + .addPredicate(f.checkIgnore) + .addPredicate(h.userCheckIgnore(s)) + .addPredicate(h.urlIsNotBlockListed(s)) + .addPredicate(h.urlIsSafeListed(s)) + .addPredicate(h.messageIsIgnored(s)), + this.setupUnhandledCapture(), + a && + ((this.instrumenter = new a( + this.options, + this.client.telemeter, + this, + y, + w, + )), + this.instrumenter.instrument()), + o.setupJSON(d); + } + var g = null; + function v(t) { + var e = 'Rollbar is not initialized'; + s.error(e), t && t(new Error(e)); + } + function y(t) { + for (var e = 0, r = t.length; e < r; ++e) + if (o.isFunction(t[e])) return t[e]; + } + function b() { + return ( + ('undefined' != typeof window && window) || + ('undefined' != typeof self && self) + ); + } + (m.init = function (t, e) { + return g ? g.global(t).configure(t) : (g = new m(t, e)); + }), + (m.prototype.components = {}), + (m.setComponents = function (t) { + m.prototype.components = t; + }), + (m.prototype.global = function (t) { + return this.client.global(t), this; + }), + (m.global = function (t) { + if (g) return g.global(t); + v(); + }), + (m.prototype.configure = function (t, e) { + var r = this.options, + n = {}; + return ( + e && (n = { payload: e }), + (this.options = o.handleOptions(r, t, n, s)), + (this.options._configuredOptions = o.handleOptions( + r._configuredOptions, + t, + n, + )), + this.client.configure(this.options, e), + this.instrumenter && this.instrumenter.configure(this.options), + this.setupUnhandledCapture(), + this + ); + }), + (m.configure = function (t, e) { + if (g) return g.configure(t, e); + v(); + }), + (m.prototype.lastError = function () { + return this.client.lastError; + }), + (m.lastError = function () { + if (g) return g.lastError(); + v(); + }), + (m.prototype.log = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.log(t), { uuid: e }; + }), + (m.log = function () { + if (g) return g.log.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.debug = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.debug(t), { uuid: e }; + }), + (m.debug = function () { + if (g) return g.debug.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.info = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.info(t), { uuid: e }; + }), + (m.info = function () { + if (g) return g.info.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.warn = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.warn(t), { uuid: e }; + }), + (m.warn = function () { + if (g) return g.warn.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.warning = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.warning(t), { uuid: e }; + }), + (m.warning = function () { + if (g) return g.warning.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.error = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.error(t), { uuid: e }; + }), + (m.error = function () { + if (g) return g.error.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.critical = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.critical(t), { uuid: e }; + }), + (m.critical = function () { + if (g) return g.critical.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.buildJsonPayload = function (t) { + return this.client.buildJsonPayload(t); + }), + (m.buildJsonPayload = function () { + if (g) return g.buildJsonPayload.apply(g, arguments); + v(); + }), + (m.prototype.sendJsonPayload = function (t) { + return this.client.sendJsonPayload(t); + }), + (m.sendJsonPayload = function () { + if (g) return g.sendJsonPayload.apply(g, arguments); + v(); + }), + (m.prototype.setupUnhandledCapture = function () { + var t = b(); + this.unhandledExceptionsInitialized || + ((this.options.captureUncaught || + this.options.handleUncaughtExceptions) && + (a.captureUncaughtExceptions(t, this), + this.wrapGlobals && + this.options.wrapGlobalEventHandlers && + this.wrapGlobals(t, this), + (this.unhandledExceptionsInitialized = !0))), + this.unhandledRejectionsInitialized || + ((this.options.captureUnhandledRejections || + this.options.handleUnhandledRejections) && + (a.captureUnhandledRejections(t, this), + (this.unhandledRejectionsInitialized = !0))); + }), + (m.prototype.handleUncaughtException = function (t, e, r, n, i, s) { + if ( + this.options.captureUncaught || + this.options.handleUncaughtExceptions + ) { + if ( + this.options.inspectAnonymousErrors && + this.isChrome && + null === i && + '' === e + ) + return 'anonymous'; + var a, + u = o.makeUnhandledStackInfo( + t, + e, + r, + n, + i, + 'onerror', + 'uncaught exception', + d, + ); + o.isError(i) + ? ((a = this._createItem([t, i, s]))._unhandledStackInfo = u) + : o.isError(e) + ? ((a = this._createItem([t, e, s]))._unhandledStackInfo = u) + : ((a = this._createItem([t, s])).stackInfo = u), + (a.level = this.options.uncaughtErrorLevel), + (a._isUncaught = !0), + this.client.log(a); + } + }), + (m.prototype.handleAnonymousErrors = function () { + if (this.options.inspectAnonymousErrors && this.isChrome) { + var t = this; + try { + Error.prepareStackTrace = function (e, r) { + if ( + t.options.inspectAnonymousErrors && + t.anonymousErrorsPending + ) { + if (((t.anonymousErrorsPending -= 1), !e)) return; + (e._isAnonymous = !0), + t.handleUncaughtException(e.message, null, null, null, e); + } + return e.stack; + }; + } catch (t) { + (this.options.inspectAnonymousErrors = !1), + this.error('anonymous error handler failed', t); + } + } + }), + (m.prototype.handleUnhandledRejection = function (t, e) { + if ( + this.options.captureUnhandledRejections || + this.options.handleUnhandledRejections + ) { + var r = 'unhandled rejection was null or undefined!'; + if (t) + if (t.message) r = t.message; + else { + var n = o.stringify(t); + n.value && (r = n.value); + } + var i, + s = (t && t._rollbarContext) || (e && e._rollbarContext); + o.isError(t) + ? (i = this._createItem([r, t, s])) + : ((i = this._createItem([r, t, s])).stackInfo = + o.makeUnhandledStackInfo( + r, + '', + 0, + 0, + null, + 'unhandledrejection', + '', + d, + )), + (i.level = this.options.uncaughtErrorLevel), + (i._isUncaught = !0), + (i._originalArgs = i._originalArgs || []), + i._originalArgs.push(e), + this.client.log(i); + } + }), + (m.prototype.wrap = function (t, e, r) { + try { + var n; + if ( + ((n = o.isFunction(e) + ? e + : function () { + return e || {}; + }), + !o.isFunction(t)) + ) + return t; + if (t._isWrap) return t; + if ( + !t._rollbar_wrapped && + ((t._rollbar_wrapped = function () { + r && o.isFunction(r) && r.apply(this, arguments); + try { + return t.apply(this, arguments); + } catch (r) { + var e = r; + throw ( + (e && + window._rollbarWrappedError !== e && + (o.isType(e, 'string') && (e = new String(e)), + (e._rollbarContext = n() || {}), + (e._rollbarContext._wrappedSource = t.toString()), + (window._rollbarWrappedError = e)), + e) + ); + } + }), + (t._rollbar_wrapped._isWrap = !0), + t.hasOwnProperty) + ) + for (var i in t) + t.hasOwnProperty(i) && + '_rollbar_wrapped' !== i && + (t._rollbar_wrapped[i] = t[i]); + return t._rollbar_wrapped; + } catch (e) { + return t; + } + }), + (m.wrap = function (t, e) { + if (g) return g.wrap(t, e); + v(); + }), + (m.prototype.captureEvent = function () { + var t = o.createTelemetryEvent(arguments); + return this.client.captureEvent(t.type, t.metadata, t.level); + }), + (m.captureEvent = function () { + if (g) return g.captureEvent.apply(g, arguments); + v(); + }), + (m.prototype.captureDomContentLoaded = function (t, e) { + return e || (e = new Date()), this.client.captureDomContentLoaded(e); + }), + (m.prototype.captureLoad = function (t, e) { + return e || (e = new Date()), this.client.captureLoad(e); + }), + (m.prototype.loadFull = function () { + s.info( + 'Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.', + ); + }), + (m.prototype._createItem = function (t) { + return o.createItem(t, s, this); + }); + var w = r(26), + _ = r(27), + x = { + version: w.version, + scrubFields: _.scrubFields, + logLevel: w.logLevel, + reportLevel: w.reportLevel, + uncaughtErrorLevel: w.uncaughtErrorLevel, + endpoint: w.endpoint, + verbose: !1, + enabled: !0, + transmit: !0, + sendConfig: !1, + includeItemsInTelemetry: !0, + captureIp: !0, + inspectAnonymousErrors: !0, + ignoreDuplicateErrors: !0, + wrapGlobalEventHandlers: !1, + }; + t.exports = m; + }, + function (t, e, r) { + 'use strict'; + var n = r(10), + o = r(12), + i = r(13), + s = r(0); + function a(t, e, r, n, l) { + (this.options = s.merge(t)), + (this.logger = r), + a.rateLimiter.configureGlobal(this.options), + a.rateLimiter.setPlatformOptions(l, this.options), + (this.api = e), + (this.queue = new o(a.rateLimiter, e, r, this.options)); + var p = this.options.tracer || null; + c(p) + ? ((this.tracer = p), + (this.options.tracer = 'opentracing-tracer-enabled'), + (this.options._configuredOptions.tracer = + 'opentracing-tracer-enabled')) + : (this.tracer = null), + (this.notifier = new i(this.queue, this.options)), + (this.telemeter = n), + u(t), + (this.lastError = null), + (this.lastErrorHash = 'none'); + } + function u(t) { + t.stackTraceLimit && (Error.stackTraceLimit = t.stackTraceLimit); + } + function c(t) { + if (!t) return !1; + if (!t.scope || 'function' != typeof t.scope) return !1; + var e = t.scope(); + return !(!e || !e.active || 'function' != typeof e.active); + } + (a.rateLimiter = new n({ maxItems: 0, itemsPerMinute: 60 })), + (a.prototype.global = function (t) { + return a.rateLimiter.configureGlobal(t), this; + }), + (a.prototype.configure = function (t, e) { + var r = this.options, + n = {}; + e && (n = { payload: e }), (this.options = s.merge(r, t, n)); + var o = this.options.tracer || null; + return ( + c(o) + ? ((this.tracer = o), + (this.options.tracer = 'opentracing-tracer-enabled'), + (this.options._configuredOptions.tracer = + 'opentracing-tracer-enabled')) + : (this.tracer = null), + this.notifier && this.notifier.configure(this.options), + this.telemeter && this.telemeter.configure(this.options), + u(t), + this.global(this.options), + c(t.tracer) && (this.tracer = t.tracer), + this + ); + }), + (a.prototype.log = function (t) { + var e = this._defaultLogLevel(); + return this._log(e, t); + }), + (a.prototype.debug = function (t) { + this._log('debug', t); + }), + (a.prototype.info = function (t) { + this._log('info', t); + }), + (a.prototype.warn = function (t) { + this._log('warning', t); + }), + (a.prototype.warning = function (t) { + this._log('warning', t); + }), + (a.prototype.error = function (t) { + this._log('error', t); + }), + (a.prototype.critical = function (t) { + this._log('critical', t); + }), + (a.prototype.wait = function (t) { + this.queue.wait(t); + }), + (a.prototype.captureEvent = function (t, e, r) { + return this.telemeter && this.telemeter.captureEvent(t, e, r); + }), + (a.prototype.captureDomContentLoaded = function (t) { + return this.telemeter && this.telemeter.captureDomContentLoaded(t); + }), + (a.prototype.captureLoad = function (t) { + return this.telemeter && this.telemeter.captureLoad(t); + }), + (a.prototype.buildJsonPayload = function (t) { + return this.api.buildJsonPayload(t); + }), + (a.prototype.sendJsonPayload = function (t) { + this.api.postJsonPayload(t); + }), + (a.prototype._log = function (t, e) { + var r; + if ( + (e.callback && ((r = e.callback), delete e.callback), + this.options.ignoreDuplicateErrors && this._sameAsLastError(e)) + ) { + if (r) { + var n = new Error('ignored identical item'); + (n.item = e), r(n); + } + } else + try { + this._addTracingInfo(e), + (e.level = e.level || t), + this.telemeter && this.telemeter._captureRollbarItem(e), + (e.telemetryEvents = + (this.telemeter && this.telemeter.copyEvents()) || []), + this.notifier.log(e, r); + } catch (t) { + r && r(t), this.logger.error(t); + } + }), + (a.prototype._defaultLogLevel = function () { + return this.options.logLevel || 'debug'; + }), + (a.prototype._sameAsLastError = function (t) { + if (!t._isUncaught) return !1; + var e = (function (t) { + var e = t.message || '', + r = (t.err || {}).stack || String(t.err); + return e + '::' + r; + })(t); + return ( + this.lastErrorHash === e || + ((this.lastError = t.err), (this.lastErrorHash = e), !1) + ); + }), + (a.prototype._addTracingInfo = function (t) { + if (this.tracer) { + var e = this.tracer.scope().active(); + if ( + (function (t) { + if (!t || !t.context || 'function' != typeof t.context) return !1; + var e = t.context(); + if ( + !e || + !e.toSpanId || + !e.toTraceId || + 'function' != typeof e.toSpanId || + 'function' != typeof e.toTraceId + ) + return !1; + return !0; + })(e) + ) { + e.setTag('rollbar.error_uuid', t.uuid), + e.setTag('rollbar.has_error', !0), + e.setTag('error', !0), + e.setTag( + 'rollbar.item_url', + 'https://rollbar.com/item/uuid/?uuid=' + t.uuid, + ), + e.setTag( + 'rollbar.occurrence_url', + 'https://rollbar.com/occurrence/uuid/?uuid=' + t.uuid, + ); + var r = e.context().toSpanId(), + n = e.context().toTraceId(); + t.custom + ? ((t.custom.opentracing_span_id = r), + (t.custom.opentracing_trace_id = n)) + : (t.custom = { + opentracing_span_id: r, + opentracing_trace_id: n, + }); + } + } + }), + (t.exports = a); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t) { + (this.startTime = n.now()), + (this.counter = 0), + (this.perMinCounter = 0), + (this.platform = null), + (this.platformOptions = {}), + this.configureGlobal(t); + } + function i(t, e, r) { + return !t.ignoreRateLimit && e >= 1 && r > e; + } + function s(t, e, r, n, o, i, s) { + var a = null; + return ( + r && (r = new Error(r)), + r || + n || + (a = (function (t, e, r, n, o) { + var i, + s = e.environment || (e.payload && e.payload.environment); + i = o + ? 'item per minute limit reached, ignoring errors until timeout' + : 'maxItems has been hit, ignoring errors until reset.'; + var a = { + body: { + message: { body: i, extra: { maxItems: r, itemsPerMinute: n } }, + }, + language: 'javascript', + environment: s, + notifier: { + version: (e.notifier && e.notifier.version) || e.version, + }, + }; + 'browser' === t + ? ((a.platform = 'browser'), + (a.framework = 'browser-js'), + (a.notifier.name = 'rollbar-browser-js')) + : 'server' === t + ? ((a.framework = e.framework || 'node-js'), + (a.notifier.name = e.notifier.name)) + : 'react-native' === t && + ((a.framework = e.framework || 'react-native'), + (a.notifier.name = e.notifier.name)); + return a; + })(t, e, o, i, s)), + { error: r, shouldSend: n, payload: a } + ); + } + (o.globalSettings = { + startTime: n.now(), + maxItems: void 0, + itemsPerMinute: void 0, + }), + (o.prototype.configureGlobal = function (t) { + void 0 !== t.startTime && (o.globalSettings.startTime = t.startTime), + void 0 !== t.maxItems && (o.globalSettings.maxItems = t.maxItems), + void 0 !== t.itemsPerMinute && + (o.globalSettings.itemsPerMinute = t.itemsPerMinute); + }), + (o.prototype.shouldSend = function (t, e) { + var r = (e = e || n.now()) - this.startTime; + (r < 0 || r >= 6e4) && ((this.startTime = e), (this.perMinCounter = 0)); + var a = o.globalSettings.maxItems, + u = o.globalSettings.itemsPerMinute; + if (i(t, a, this.counter)) + return s( + this.platform, + this.platformOptions, + a + ' max items reached', + !1, + ); + if (i(t, u, this.perMinCounter)) + return s( + this.platform, + this.platformOptions, + u + ' items per minute reached', + !1, + ); + this.counter++, this.perMinCounter++; + var c = !i(t, a, this.counter), + l = c; + return ( + (c = c && !i(t, u, this.perMinCounter)), + s(this.platform, this.platformOptions, null, c, a, u, l) + ); + }), + (o.prototype.setPlatformOptions = function (t, e) { + (this.platform = t), (this.platformOptions = e); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = Object.prototype.hasOwnProperty, + o = Object.prototype.toString, + i = function (t) { + if (!t || '[object Object]' !== o.call(t)) return !1; + var e, + r = n.call(t, 'constructor'), + i = + t.constructor && + t.constructor.prototype && + n.call(t.constructor.prototype, 'isPrototypeOf'); + if (t.constructor && !r && !i) return !1; + for (e in t); + return void 0 === e || n.call(t, e); + }; + t.exports = function t() { + var e, + r, + n, + o, + s, + a = {}, + u = null, + c = arguments.length; + for (e = 0; e < c; e++) + if (null != (u = arguments[e])) + for (s in u) + (r = a[s]), + a !== (n = u[s]) && + (n && i(n) + ? ((o = r && i(r) ? r : {}), (a[s] = t(o, n))) + : void 0 !== n && (a[s] = n)); + return a; + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e, r, n) { + (this.rateLimiter = t), + (this.api = e), + (this.logger = r), + (this.options = n), + (this.predicates = []), + (this.pendingItems = []), + (this.pendingRequests = []), + (this.retryQueue = []), + (this.retryHandle = null), + (this.waitCallback = null), + (this.waitIntervalID = null); + } + (o.prototype.configure = function (t) { + this.api && this.api.configure(t); + var e = this.options; + return (this.options = n.merge(e, t)), this; + }), + (o.prototype.addPredicate = function (t) { + return n.isFunction(t) && this.predicates.push(t), this; + }), + (o.prototype.addPendingItem = function (t) { + this.pendingItems.push(t); + }), + (o.prototype.removePendingItem = function (t) { + var e = this.pendingItems.indexOf(t); + -1 !== e && this.pendingItems.splice(e, 1); + }), + (o.prototype.addItem = function (t, e, r, o) { + (e && n.isFunction(e)) || (e = function () {}); + var i = this._applyPredicates(t); + if (i.stop) return this.removePendingItem(o), void e(i.err); + if ( + (this._maybeLog(t, r), + this.removePendingItem(o), + this.options.transmit) + ) { + this.pendingRequests.push(t); + try { + this._makeApiRequest( + t, + function (r, n) { + this._dequeuePendingRequest(t), e(r, n); + }.bind(this), + ); + } catch (r) { + this._dequeuePendingRequest(t), e(r); + } + } else e(new Error('Transmit disabled')); + }), + (o.prototype.wait = function (t) { + n.isFunction(t) && + ((this.waitCallback = t), + this._maybeCallWait() || + (this.waitIntervalID && + (this.waitIntervalID = clearInterval(this.waitIntervalID)), + (this.waitIntervalID = setInterval( + function () { + this._maybeCallWait(); + }.bind(this), + 500, + )))); + }), + (o.prototype._applyPredicates = function (t) { + for (var e = null, r = 0, n = this.predicates.length; r < n; r++) + if (!(e = this.predicates[r](t, this.options)) || void 0 !== e.err) + return { stop: !0, err: e.err }; + return { stop: !1, err: null }; + }), + (o.prototype._makeApiRequest = function (t, e) { + var r = this.rateLimiter.shouldSend(t); + r.shouldSend + ? this.api.postItem( + t, + function (r, n) { + r ? this._maybeRetry(r, t, e) : e(r, n); + }.bind(this), + ) + : r.error + ? e(r.error) + : this.api.postItem(r.payload, e); + }); + var i = [ + 'ECONNRESET', + 'ENOTFOUND', + 'ESOCKETTIMEDOUT', + 'ETIMEDOUT', + 'ECONNREFUSED', + 'EHOSTUNREACH', + 'EPIPE', + 'EAI_AGAIN', + ]; + (o.prototype._maybeRetry = function (t, e, r) { + var o = !1; + if (this.options.retryInterval) { + for (var s = 0, a = i.length; s < a; s++) + if (t.code === i[s]) { + o = !0; + break; + } + o && + n.isFiniteNumber(this.options.maxRetries) && + ((e.retries = e.retries ? e.retries + 1 : 1), + e.retries > this.options.maxRetries && (o = !1)); + } + o ? this._retryApiRequest(e, r) : r(t); + }), + (o.prototype._retryApiRequest = function (t, e) { + this.retryQueue.push({ item: t, callback: e }), + this.retryHandle || + (this.retryHandle = setInterval( + function () { + for (; this.retryQueue.length; ) { + var t = this.retryQueue.shift(); + this._makeApiRequest(t.item, t.callback); + } + }.bind(this), + this.options.retryInterval, + )); + }), + (o.prototype._dequeuePendingRequest = function (t) { + var e = this.pendingRequests.indexOf(t); + -1 !== e && (this.pendingRequests.splice(e, 1), this._maybeCallWait()); + }), + (o.prototype._maybeLog = function (t, e) { + if (this.logger && this.options.verbose) { + var r = e; + if ( + (r = + (r = r || n.get(t, 'body.trace.exception.message')) || + n.get(t, 'body.trace_chain.0.exception.message')) + ) + return void this.logger.error(r); + (r = n.get(t, 'body.message.body')) && this.logger.log(r); + } + }), + (o.prototype._maybeCallWait = function () { + return ( + !( + !n.isFunction(this.waitCallback) || + 0 !== this.pendingItems.length || + 0 !== this.pendingRequests.length + ) && + (this.waitIntervalID && + (this.waitIntervalID = clearInterval(this.waitIntervalID)), + this.waitCallback(), + !0) + ); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e) { + (this.queue = t), + (this.options = e), + (this.transforms = []), + (this.diagnostic = {}); + } + (o.prototype.configure = function (t) { + this.queue && this.queue.configure(t); + var e = this.options; + return (this.options = n.merge(e, t)), this; + }), + (o.prototype.addTransform = function (t) { + return n.isFunction(t) && this.transforms.push(t), this; + }), + (o.prototype.log = function (t, e) { + if ( + ((e && n.isFunction(e)) || (e = function () {}), + !this.options.enabled) + ) + return e(new Error('Rollbar is not enabled')); + this.queue.addPendingItem(t); + var r = t.err; + this._applyTransforms( + t, + function (n, o) { + if (n) return this.queue.removePendingItem(t), e(n, null); + this.queue.addItem(o, e, r, t); + }.bind(this), + ); + }), + (o.prototype._applyTransforms = function (t, e) { + var r = -1, + n = this.transforms.length, + o = this.transforms, + i = this.options, + s = function (t, a) { + t ? e(t, null) : ++r !== n ? o[r](a, i, s) : e(null, a); + }; + s(null, t); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(15), + i = { + hostname: 'api.rollbar.com', + path: '/api/1/item/', + search: null, + version: '1', + protocol: 'https:', + port: 443, + }; + function s(t, e, r, n, o) { + (this.options = t), + (this.transport = e), + (this.url = r), + (this.truncation = n), + (this.jsonBackup = o), + (this.accessToken = t.accessToken), + (this.transportOptions = a(t, r)); + } + function a(t, e) { + return o.getTransportFromOptions(t, i, e); + } + (s.prototype.postItem = function (t, e) { + var r = o.transportOptions(this.transportOptions, 'POST'), + n = o.buildPayload(this.accessToken, t, this.jsonBackup); + this.transport.post(this.accessToken, r, n, e); + }), + (s.prototype.buildJsonPayload = function (t, e) { + var r, + i = o.buildPayload(this.accessToken, t, this.jsonBackup); + return (r = this.truncation + ? this.truncation.truncate(i) + : n.stringify(i)).error + ? (e && e(r.error), null) + : r.value; + }), + (s.prototype.postJsonPayload = function (t, e) { + var r = o.transportOptions(this.transportOptions, 'POST'); + this.transport.postJsonPayload(this.accessToken, r, t, e); + }), + (s.prototype.configure = function (t) { + var e = this.oldOptions; + return ( + (this.options = n.merge(e, t)), + (this.transportOptions = a(this.options, this.url)), + void 0 !== this.options.accessToken && + (this.accessToken = this.options.accessToken), + this + ); + }), + (t.exports = s); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = { + buildPayload: function (t, e, r) { + if (!n.isType(e.context, 'string')) { + var o = n.stringify(e.context, r); + o.error + ? (e.context = "Error: could not serialize 'context'") + : (e.context = o.value || ''), + e.context.length > 255 && (e.context = e.context.substr(0, 255)); + } + return { access_token: t, data: e }; + }, + getTransportFromOptions: function (t, e, r) { + var n = e.hostname, + o = e.protocol, + i = e.port, + s = e.path, + a = e.search, + u = t.timeout, + c = t.proxy; + if (t.endpoint) { + var l = r.parse(t.endpoint); + (n = l.hostname), + (o = l.protocol), + (i = l.port), + (s = l.pathname), + (a = l.search); + } + return { + timeout: u, + hostname: n, + protocol: o, + port: i, + path: s, + search: a, + proxy: c, + }; + }, + transportOptions: function (t, e) { + var r = t.protocol || 'https:', + n = t.port || ('http:' === r ? 80 : 'https:' === r ? 443 : void 0), + o = t.hostname, + i = t.path, + s = t.timeout; + return ( + t.search && (i += t.search), + t.proxy && + ((i = r + '//' + o + i), + (o = t.proxy.host || t.proxy.hostname), + (n = t.proxy.port), + (r = t.proxy.protocol || r)), + { timeout: s, protocol: r, hostname: o, path: i, port: n, method: e } + ); + }, + appendPathToPath: function (t, e) { + var r = /\/$/.test(t), + n = /^\//.test(e); + return r && n ? (e = e.substring(1)) : r || n || (e = '/' + e), t + e; + }, + }; + }, + function (t, e) { + !(function (t) { + 'use strict'; + t.console || (t.console = {}); + for ( + var e, + r, + n = t.console, + o = function () {}, + i = ['memory'], + s = + 'assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn'.split( + ',', + ); + (e = i.pop()); + + ) + n[e] || (n[e] = {}); + for (; (r = s.pop()); ) n[r] || (n[r] = o); + })('undefined' == typeof window ? this : window); + }, + function (t, e, r) { + 'use strict'; + var n = { + ieVersion: function () { + if ('undefined' != typeof document) { + for ( + var t = 3, + e = document.createElement('div'), + r = e.getElementsByTagName('i'); + (e.innerHTML = + '\x3c!--[if gt IE ' + ++t + ']> 4 ? t : void 0; + } + }, + }; + t.exports = n; + }, + function (t, e, r) { + 'use strict'; + function n(t, e, r, n) { + t._rollbarWrappedError && + (n[4] || (n[4] = t._rollbarWrappedError), + n[5] || (n[5] = t._rollbarWrappedError._rollbarContext), + (t._rollbarWrappedError = null)); + var o = e.handleUncaughtException.apply(e, n); + r && r.apply(t, n), 'anonymous' === o && (e.anonymousErrorsPending += 1); + } + t.exports = { + captureUncaughtExceptions: function (t, e, r) { + if (t) { + var o; + if ('function' == typeof e._rollbarOldOnError) + o = e._rollbarOldOnError; + else if (t.onerror) { + for (o = t.onerror; o._rollbarOldOnError; ) + o = o._rollbarOldOnError; + e._rollbarOldOnError = o; + } + e.handleAnonymousErrors(); + var i = function () { + var r = Array.prototype.slice.call(arguments, 0); + n(t, e, o, r); + }; + r && (i._rollbarOldOnError = o), (t.onerror = i); + } + }, + captureUnhandledRejections: function (t, e, r) { + if (t) { + 'function' == typeof t._rollbarURH && + t._rollbarURH.belongsToShim && + t.removeEventListener('unhandledrejection', t._rollbarURH); + var n = function (t) { + var r, n, o; + try { + r = t.reason; + } catch (t) { + r = void 0; + } + try { + n = t.promise; + } catch (t) { + n = '[unhandledrejection] error getting `promise` from event'; + } + try { + (o = t.detail), !r && o && ((r = o.reason), (n = o.promise)); + } catch (t) {} + r || (r = '[unhandledrejection] error getting `reason` from event'), + e && + e.handleUnhandledRejection && + e.handleUnhandledRejection(r, n); + }; + (n.belongsToShim = r), + (t._rollbarURH = n), + t.addEventListener('unhandledrejection', n); + } + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(1); + function i(t) { + this.truncation = t; + } + function s() { + var t = + ('undefined' != typeof window && window) || + ('undefined' != typeof self && self), + e = t && t.Zone && t.Zone.current, + r = Array.prototype.slice.call(arguments); + if (e && 'angular' === e._name) { + var n = e._parent; + n.run(function () { + a.apply(void 0, r); + }); + } else a.apply(void 0, r); + } + function a(t, e, r, i, s, a, c) { + if ('undefined' != typeof RollbarProxy) + return (function (t, e) { + new RollbarProxy().sendJsonPayload( + t, + function (t) {}, + function (t) { + e(new Error(t)); + }, + ); + })(i, s); + var l; + if ( + !(l = a + ? a() + : (function () { + var t, + e, + r = [ + function () { + return new XMLHttpRequest(); + }, + function () { + return new ActiveXObject('Msxml2.XMLHTTP'); + }, + function () { + return new ActiveXObject('Msxml3.XMLHTTP'); + }, + function () { + return new ActiveXObject('Microsoft.XMLHTTP'); + }, + ], + n = r.length; + for (e = 0; e < n; e++) + try { + t = r[e](); + break; + } catch (t) {} + return t; + })()) + ) + return s(new Error('No way to send a request')); + try { + try { + var p = function () { + try { + if (p && 4 === l.readyState) { + p = void 0; + var t = n.jsonParse(l.responseText); + if ((i = l) && i.status && 200 === i.status) + return void s(t.error, t.value); + if ( + (function (t) { + return ( + t && + n.isType(t.status, 'number') && + t.status >= 400 && + t.status < 600 + ); + })(l) + ) { + if (403 === l.status) { + var e = t.value && t.value.message; + o.error(e); + } + s(new Error(String(l.status))); + } else { + s( + u( + 'XHR response had no status code (likely connection failure)', + ), + ); + } + } + } catch (t) { + var r; + (r = t && t.stack ? t : new Error(t)), s(r); + } + var i; + }; + l.open(r, e, !0), + l.setRequestHeader && + (l.setRequestHeader('Content-Type', 'application/json'), + l.setRequestHeader('X-Rollbar-Access-Token', t)), + n.isFiniteNumber(c) && (l.timeout = c), + (l.onreadystatechange = p), + l.send(i); + } catch (t) { + if ('undefined' != typeof XDomainRequest) { + if (!window || !window.location) + return s( + new Error( + 'No window available during request, unknown environment', + ), + ); + 'http:' === window.location.href.substring(0, 5) && + 'https' === e.substring(0, 5) && + (e = 'http' + e.substring(5)); + var f = new XDomainRequest(); + (f.onprogress = function () {}), + (f.ontimeout = function () { + s(u('Request timed out', 'ETIMEDOUT')); + }), + (f.onerror = function () { + s(new Error('Error during request')); + }), + (f.onload = function () { + var t = n.jsonParse(f.responseText); + s(t.error, t.value); + }), + f.open(r, e, !0), + f.send(i); + } else s(new Error('Cannot find a method to transport a request')); + } + } catch (t) { + s(t); + } + } + function u(t, e) { + var r = new Error(t); + return (r.code = e || 'ENOTFOUND'), r; + } + (i.prototype.get = function (t, e, r, o, i) { + (o && n.isFunction(o)) || (o = function () {}), + n.addParamsAndAccessTokenToPath(t, e, r); + s(t, n.formatUrl(e), 'GET', null, o, i, e.timeout); + }), + (i.prototype.post = function (t, e, r, o, i) { + if (((o && n.isFunction(o)) || (o = function () {}), !r)) + return o(new Error('Cannot send empty request')); + var a; + if ( + (a = this.truncation ? this.truncation.truncate(r) : n.stringify(r)) + .error + ) + return o(a.error); + var u = a.value; + s(t, n.formatUrl(e), 'POST', u, o, i, e.timeout); + }), + (i.prototype.postJsonPayload = function (t, e, r, o, i) { + (o && n.isFunction(o)) || (o = function () {}); + s(t, n.formatUrl(e), 'POST', r, o, i, e.timeout); + }), + (t.exports = i); + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(3), + i = r(1); + function s(t, e, r) { + var o = t.message, + i = t.custom; + o || (o = 'Item sent with null or missing arguments.'); + var s = { body: o }; + i && (s.extra = n.merge(i)), + n.set(t, 'data.body', { message: s }), + r(null, t); + } + function a(t) { + var e = t.stackInfo.stack; + return ( + e && + 0 === e.length && + t._unhandledStackInfo && + t._unhandledStackInfo.stack && + (e = t._unhandledStackInfo.stack), + e + ); + } + function u(t, e, r) { + var i = t && t.data.description, + s = t && t.custom, + u = a(t), + l = o.guessErrorClass(e.message), + p = { exception: { class: c(e, l[0], r), message: l[1] } }; + if ((i && (p.exception.description = i), u)) { + var f, h, d, m, g, v, y, b; + for ( + 0 === u.length && + ((p.exception.stack = e.rawStack), + (p.exception.raw = String(e.rawException))), + p.frames = [], + y = 0; + y < u.length; + ++y + ) + (h = { + filename: (f = u[y]).url ? n.sanitizeUrl(f.url) : '(unknown)', + lineno: f.line || null, + method: f.func && '?' !== f.func ? f.func : '[anonymous]', + colno: f.column, + }), + r.sendFrameUrl && (h.url = f.url), + (h.method && + h.method.endsWith && + h.method.endsWith('_rollbar_wrapped')) || + ((d = m = g = null), + (v = f.context ? f.context.length : 0) && + ((b = Math.floor(v / 2)), + (m = f.context.slice(0, b)), + (d = f.context[b]), + (g = f.context.slice(b))), + d && (h.code = d), + (m || g) && + ((h.context = {}), + m && m.length && (h.context.pre = m), + g && g.length && (h.context.post = g)), + f.args && (h.args = f.args), + p.frames.push(h)); + p.frames.reverse(), s && (p.extra = n.merge(s)); + } + return p; + } + function c(t, e, r) { + return t.name ? t.name : r.guessErrorClass ? e : '(unknown)'; + } + t.exports = { + handleDomException: function (t, e, r) { + if (t.err && 'DOMException' === o.Stack(t.err).name) { + var n = new Error(); + (n.name = t.err.name), + (n.message = t.err.message), + (n.stack = t.err.stack), + (n.nested = t.err), + (t.err = n); + } + r(null, t); + }, + handleItemWithError: function (t, e, r) { + if (((t.data = t.data || {}), t.err)) + try { + (t.stackInfo = + t.err._savedStackTrace || o.parse(t.err, t.skipFrames)), + e.addErrorContext && + (function (t) { + var e = [], + r = t.err; + e.push(r); + for (; r.nested || r.cause; ) + (r = r.nested || r.cause), e.push(r); + n.addErrorContext(t, e); + })(t); + } catch (e) { + i.error('Error while parsing the error object.', e); + try { + t.message = + t.err.message || + t.err.description || + t.message || + String(t.err); + } catch (e) { + t.message = String(t.err) || String(e); + } + delete t.err; + } + r(null, t); + }, + ensureItemHasSomethingToSay: function (t, e, r) { + t.message || + t.stackInfo || + t.custom || + r(new Error('No message, stack info, or custom data'), null), + r(null, t); + }, + addBaseInfo: function (t, e, r) { + var o = (e.payload && e.payload.environment) || e.environment; + (t.data = n.merge(t.data, { + environment: o, + level: t.level, + endpoint: e.endpoint, + platform: 'browser', + framework: 'browser-js', + language: 'javascript', + server: {}, + uuid: t.uuid, + notifier: { name: 'rollbar-browser-js', version: e.version }, + custom: t.custom, + })), + r(null, t); + }, + addRequestInfo: function (t) { + return function (e, r, o) { + if (!t || !t.location) return o(null, e); + var i = '$remote_ip'; + r.captureIp ? !0 !== r.captureIp && (i += '_anonymize') : (i = null), + n.set(e, 'data.request', { + url: t.location.href, + query_string: t.location.search, + user_ip: i, + }), + o(null, e); + }; + }, + addClientInfo: function (t) { + return function (e, r, o) { + if (!t) return o(null, e); + var i = t.navigator || {}, + s = t.screen || {}; + n.set(e, 'data.client', { + runtime_ms: e.timestamp - t._rollbarStartTime, + timestamp: Math.round(e.timestamp / 1e3), + javascript: { + browser: i.userAgent, + language: i.language, + cookie_enabled: i.cookieEnabled, + screen: { width: s.width, height: s.height }, + }, + }), + o(null, e); + }; + }, + addPluginInfo: function (t) { + return function (e, r, o) { + if (!t || !t.navigator) return o(null, e); + for ( + var i, s = [], a = t.navigator.plugins || [], u = 0, c = a.length; + u < c; + ++u + ) + (i = a[u]), s.push({ name: i.name, description: i.description }); + n.set(e, 'data.client.javascript.plugins', s), o(null, e); + }; + }, + addBody: function (t, e, r) { + t.stackInfo + ? t.stackInfo.traceChain + ? (function (t, e, r) { + for ( + var o = t.stackInfo.traceChain, i = [], s = o.length, a = 0; + a < s; + a++ + ) { + var c = u(t, o[a], e); + i.push(c); + } + n.set(t, 'data.body', { trace_chain: i }), r(null, t); + })(t, e, r) + : (function (t, e, r) { + if (a(t)) { + var i = u(t, t.stackInfo, e); + n.set(t, 'data.body', { trace: i }), r(null, t); + } else { + var l = t.stackInfo, + p = o.guessErrorClass(l.message), + f = c(l, p[0], e), + h = p[1]; + (t.message = f + ': ' + h), s(t, e, r); + } + })(t, e, r) + : s(t, e, r); + }, + addScrubber: function (t) { + return function (e, r, n) { + if (t) { + var o = r.scrubFields || [], + i = r.scrubPaths || []; + e.data = t(e.data, o, i); + } + n(null, e); + }; + }, + }; + }, + function (t, e, r) { + var n, o, i; + !(function (s, a) { + 'use strict'; + (o = [r(22)]), + void 0 === + (i = + 'function' == + typeof (n = function (t) { + var e = /(^|@)\S+:\d+/, + r = /^\s*at .*(\S+:\d+|\(native\))/m, + n = /^(eval@)?(\[native code])?$/; + return { + parse: function (t) { + if ( + void 0 !== t.stacktrace || + void 0 !== t['opera#sourceloc'] + ) + return this.parseOpera(t); + if (t.stack && t.stack.match(r)) return this.parseV8OrIE(t); + if (t.stack) return this.parseFFOrSafari(t); + throw new Error('Cannot parse given Error object'); + }, + extractLocation: function (t) { + if (-1 === t.indexOf(':')) return [t]; + var e = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec( + t.replace(/[()]/g, ''), + ); + return [e[1], e[2] || void 0, e[3] || void 0]; + }, + parseV8OrIE: function (e) { + return e.stack + .split('\n') + .filter(function (t) { + return !!t.match(r); + }, this) + .map(function (e) { + e.indexOf('(eval ') > -1 && + (e = e + .replace(/eval code/g, 'eval') + .replace(/(\(eval at [^()]*)|(\),.*$)/g, '')); + var r = e + .replace(/^\s+/, '') + .replace(/\(eval code/g, '('), + n = r.match(/ (\((.+):(\d+):(\d+)\)$)/), + o = (r = n ? r.replace(n[0], '') : r) + .split(/\s+/) + .slice(1), + i = this.extractLocation(n ? n[1] : o.pop()), + s = o.join(' ') || void 0, + a = + ['eval', ''].indexOf(i[0]) > -1 + ? void 0 + : i[0]; + return new t({ + functionName: s, + fileName: a, + lineNumber: i[1], + columnNumber: i[2], + source: e, + }); + }, this); + }, + parseFFOrSafari: function (e) { + return e.stack + .split('\n') + .filter(function (t) { + return !t.match(n); + }, this) + .map(function (e) { + if ( + (e.indexOf(' > eval') > -1 && + (e = e.replace( + / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, + ':$1', + )), + -1 === e.indexOf('@') && -1 === e.indexOf(':')) + ) + return new t({ functionName: e }); + var r = /((.*".+"[^@]*)?[^@]*)(?:@)/, + n = e.match(r), + o = n && n[1] ? n[1] : void 0, + i = this.extractLocation(e.replace(r, '')); + return new t({ + functionName: o, + fileName: i[0], + lineNumber: i[1], + columnNumber: i[2], + source: e, + }); + }, this); + }, + parseOpera: function (t) { + return !t.stacktrace || + (t.message.indexOf('\n') > -1 && + t.message.split('\n').length > + t.stacktrace.split('\n').length) + ? this.parseOpera9(t) + : t.stack + ? this.parseOpera11(t) + : this.parseOpera10(t); + }, + parseOpera9: function (e) { + for ( + var r = /Line (\d+).*script (?:in )?(\S+)/i, + n = e.message.split('\n'), + o = [], + i = 2, + s = n.length; + i < s; + i += 2 + ) { + var a = r.exec(n[i]); + a && + o.push( + new t({ + fileName: a[2], + lineNumber: a[1], + source: n[i], + }), + ); + } + return o; + }, + parseOpera10: function (e) { + for ( + var r = + /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, + n = e.stacktrace.split('\n'), + o = [], + i = 0, + s = n.length; + i < s; + i += 2 + ) { + var a = r.exec(n[i]); + a && + o.push( + new t({ + functionName: a[3] || void 0, + fileName: a[2], + lineNumber: a[1], + source: n[i], + }), + ); + } + return o; + }, + parseOpera11: function (r) { + return r.stack + .split('\n') + .filter(function (t) { + return !!t.match(e) && !t.match(/^Error created at/); + }, this) + .map(function (e) { + var r, + n = e.split('@'), + o = this.extractLocation(n.pop()), + i = n.shift() || '', + s = + i + .replace(//, '$2') + .replace(/\([^)]*\)/g, '') || void 0; + i.match(/\(([^)]*)\)/) && + (r = i.replace(/^[^(]+\(([^)]*)\)$/, '$1')); + var a = + void 0 === r || '[arguments not available]' === r + ? void 0 + : r.split(','); + return new t({ + functionName: s, + args: a, + fileName: o[0], + lineNumber: o[1], + columnNumber: o[2], + source: e, + }); + }, this); + }, + }; + }) + ? n.apply(e, o) + : n) || (t.exports = i); + })(); + }, + function (t, e, r) { + var n, o, i; + !(function (r, s) { + 'use strict'; + (o = []), + void 0 === + (i = + 'function' == + typeof (n = function () { + function t(t) { + return t.charAt(0).toUpperCase() + t.substring(1); + } + function e(t) { + return function () { + return this[t]; + }; + } + var r = ['isConstructor', 'isEval', 'isNative', 'isToplevel'], + n = ['columnNumber', 'lineNumber'], + o = ['fileName', 'functionName', 'source'], + i = r.concat(n, o, ['args'], ['evalOrigin']); + function s(e) { + if (e) + for (var r = 0; r < i.length; r++) + void 0 !== e[i[r]] && this['set' + t(i[r])](e[i[r]]); + } + (s.prototype = { + 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; + }, + getEvalOrigin: function () { + return this.evalOrigin; + }, + setEvalOrigin: function (t) { + if (t instanceof s) this.evalOrigin = t; + else { + if (!(t instanceof Object)) + throw new TypeError( + 'Eval Origin must be an Object or StackFrame', + ); + this.evalOrigin = new s(t); + } + }, + toString: function () { + var t = this.getFileName() || '', + e = this.getLineNumber() || '', + r = this.getColumnNumber() || '', + n = this.getFunctionName() || ''; + return this.getIsEval() + ? t + ? '[eval] (' + t + ':' + e + ':' + r + ')' + : '[eval]:' + e + ':' + r + : n + ? n + ' (' + t + ':' + e + ':' + r + ')' + : t + ':' + e + ':' + r; + }, + }), + (s.fromString = function (t) { + var e = t.indexOf('('), + r = t.lastIndexOf(')'), + n = t.substring(0, e), + o = t.substring(e + 1, r).split(','), + i = t.substring(r + 1); + if (0 === i.indexOf('@')) + var a = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i, ''), + u = a[1], + c = a[2], + l = a[3]; + return new s({ + functionName: n, + args: o || void 0, + fileName: u, + lineNumber: c || void 0, + columnNumber: l || void 0, + }); + }); + for (var a = 0; a < r.length; a++) + (s.prototype['get' + t(r[a])] = e(r[a])), + (s.prototype['set' + t(r[a])] = (function (t) { + return function (e) { + this[t] = Boolean(e); + }; + })(r[a])); + for (var u = 0; u < n.length; u++) + (s.prototype['get' + t(n[u])] = e(n[u])), + (s.prototype['set' + t(n[u])] = (function (t) { + return function (e) { + if (((r = e), isNaN(parseFloat(r)) || !isFinite(r))) + throw new TypeError(t + ' must be a Number'); + var r; + this[t] = Number(e); + }; + })(n[u])); + for (var c = 0; c < o.length; c++) + (s.prototype['get' + t(o[c])] = e(o[c])), + (s.prototype['set' + t(o[c])] = (function (t) { + return function (e) { + this[t] = String(e); + }; + })(o[c])); + return s; + }) + ? n.apply(e, o) + : n) || (t.exports = i); + })(); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e) { + n.isFunction(t[e]) && (t[e] = t[e].toString()); + } + t.exports = { + itemToPayload: function (t, e, r) { + var o = e.payload || {}; + o.body && delete o.body; + var i = n.merge(t.data, o); + t._isUncaught && (i._isUncaught = !0), + t._originalArgs && (i._originalArgs = t._originalArgs), + r(null, i); + }, + addTelemetryData: function (t, e, r) { + t.telemetryEvents && n.set(t, 'data.body.telemetry', t.telemetryEvents), + r(null, t); + }, + addMessageWithError: function (t, e, r) { + if (t.message) { + var o = 'data.body.trace_chain.0', + i = n.get(t, o); + if ((i || ((o = 'data.body.trace'), (i = n.get(t, o))), i)) { + if (!i.exception || !i.exception.description) + return ( + n.set(t, o + '.exception.description', t.message), + void r(null, t) + ); + var s = n.get(t, o + '.extra') || {}, + a = n.merge(s, { message: t.message }); + n.set(t, o + '.extra', a); + } + r(null, t); + } else r(null, t); + }, + userTransform: function (t) { + return function (e, r, o) { + var i = n.merge(e), + s = null; + try { + n.isFunction(r.transform) && (s = r.transform(i.data, e)); + } catch (n) { + return ( + (r.transform = null), + t.error( + 'Error while calling custom transform() function. Removing custom transform().', + n, + ), + void o(null, e) + ); + } + n.isPromise(s) + ? s.then( + function (t) { + t && (i.data = t), o(null, i); + }, + function (t) { + o(t, e); + }, + ) + : o(null, i); + }; + }, + addConfigToPayload: function (t, e, r) { + if (!e.sendConfig) return r(null, t); + var o = n.get(t, 'data.custom') || {}; + (o._rollbarConfig = e), (t.data.custom = o), r(null, t); + }, + addConfiguredOptions: function (t, e, r) { + var n = e._configuredOptions; + o(n, 'transform'), + o(n, 'checkIgnore'), + o(n, 'onSendCallback'), + delete n.accessToken, + (t.data.notifier.configured_options = n), + r(null, t); + }, + addDiagnosticKeys: function (t, e, r) { + var o = n.merge(t.notifier.client.notifier.diagnostic, t.diagnostic); + if ( + (n.get(t, 'err._isAnonymous') && (o.is_anonymous = !0), + t._isUncaught && (o.is_uncaught = t._isUncaught), + t.err) + ) + try { + o.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) { + o.raw_error = { failed: String(t) }; + } + (t.data.notifier.diagnostic = n.merge(t.data.notifier.diagnostic, o)), + r(null, t); + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = { + checkIgnore: function (t, e) { + return ( + !n.get(e, 'plugins.jquery.ignoreAjaxErrors') || + !n.get(t, 'body.message.extra.isAjax') + ); + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e, r) { + if (!t) return !r; + var o, + i, + s = t.frames; + if (!s || 0 === s.length) return !r; + for (var a = e.length, u = s.length, c = 0; c < u; c++) { + if (((o = s[c].filename), !n.isType(o, 'string'))) return !r; + for (var l = 0; l < a; l++) + if (((i = e[l]), new RegExp(i).test(o))) return !0; + } + return !1; + } + function i(t, e, r, i) { + var s, + a, + u = !1; + 'blocklist' === r && (u = !0); + try { + if ( + ((s = u ? e.hostBlockList : e.hostSafeList), + (a = n.get(t, 'body.trace_chain') || [n.get(t, 'body.trace')]), + !s || 0 === s.length) + ) + return !u; + if (0 === a.length || !a[0]) return !u; + for (var c = a.length, l = 0; l < c; l++) if (o(a[l], s, u)) return !0; + } catch (t) { + u ? (e.hostBlockList = null) : (e.hostSafeList = null); + var p = u ? 'hostBlockList' : 'hostSafeList'; + return ( + i.error( + "Error while reading your configuration's " + + p + + ' option. Removing custom ' + + p + + '.', + t, + ), + !u + ); + } + return !1; + } + t.exports = { + checkLevel: function (t, e) { + var r = t.level, + o = n.LEVELS[r] || 0, + i = e.reportLevel; + return !(o < (n.LEVELS[i] || 0)); + }, + userCheckIgnore: function (t) { + return function (e, r) { + var o = !!e._isUncaught; + delete e._isUncaught; + var i = e._originalArgs; + delete e._originalArgs; + try { + n.isFunction(r.onSendCallback) && r.onSendCallback(o, i, e); + } catch (e) { + (r.onSendCallback = null), + t.error('Error while calling onSendCallback, removing', e); + } + try { + if (n.isFunction(r.checkIgnore) && r.checkIgnore(o, i, e)) + return !1; + } catch (e) { + (r.checkIgnore = null), + t.error('Error while calling custom checkIgnore(), removing', e); + } + return !0; + }; + }, + urlIsNotBlockListed: function (t) { + return function (e, r) { + return !i(e, r, 'blocklist', t); + }; + }, + urlIsSafeListed: function (t) { + return function (e, r) { + return i(e, r, 'safelist', t); + }; + }, + messageIsIgnored: function (t) { + return function (e, r) { + var o, i, s, a, u, c; + try { + if ((!1, !(s = r.ignoredMessages) || 0 === s.length)) return !0; + if ( + 0 === + (c = (function (t) { + var e = t.body, + r = []; + if (e.trace_chain) + for (var o = e.trace_chain, i = 0; i < o.length; i++) { + var s = o[i]; + r.push(n.get(s, 'exception.message')); + } + e.trace && r.push(n.get(e, 'trace.exception.message')); + e.message && r.push(n.get(e, 'message.body')); + return r; + })(e)).length + ) + return !0; + for (a = s.length, o = 0; o < a; o++) + for (u = new RegExp(s[o], 'gi'), i = 0; i < c.length; i++) + if (u.test(c[i])) return !1; + } catch (e) { + (r.ignoredMessages = null), + t.error( + "Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.", + ); + } + return !0; + }; + }, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + version: '2.25.0', + endpoint: 'api.rollbar.com/api/1/item/', + logLevel: 'debug', + reportLevel: 'debug', + uncaughtErrorLevel: 'error', + maxItems: 0, + itemsPerMin: 60, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + scrubFields: [ + 'pw', + 'pass', + 'passwd', + 'password', + 'secret', + 'confirm_password', + 'confirmPassword', + 'password_confirmation', + 'passwordConfirmation', + 'access_token', + 'accessToken', + 'X-Rollbar-Access-Token', + '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', + ], + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t) { + (this.queue = []), (this.options = n.merge(t)); + var e = this.options.maxTelemetryEvents || 100; + this.maxQueueSize = Math.max(0, Math.min(e, 100)); + } + function i(t, e) { + if (e) return e; + return { error: 'error', manual: 'info' }[t] || 'info'; + } + (o.prototype.configure = function (t) { + var e = this.options; + this.options = n.merge(e, t); + var r = this.options.maxTelemetryEvents || 100, + o = Math.max(0, Math.min(r, 100)), + i = 0; + this.maxQueueSize > o && (i = this.maxQueueSize - o), + (this.maxQueueSize = o), + this.queue.splice(0, i); + }), + (o.prototype.copyEvents = function () { + var t = Array.prototype.slice.call(this.queue, 0); + if (n.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; + }), + (o.prototype.capture = function (t, e, r, o, s) { + var a = { + level: i(t, r), + type: t, + timestamp_ms: s || n.now(), + body: e, + source: 'client', + }; + o && (a.uuid = o); + try { + if ( + n.isFunction(this.options.filterTelemetry) && + this.options.filterTelemetry(a) + ) + return !1; + } catch (t) { + this.options.filterTelemetry = null; + } + return this.push(a), a; + }), + (o.prototype.captureEvent = function (t, e, r, n) { + return this.capture(t, e, r, n); + }), + (o.prototype.captureError = function (t, e, r, n) { + var o = { message: t.message || String(t) }; + return ( + t.stack && (o.stack = t.stack), this.capture('error', o, e, r, n) + ); + }), + (o.prototype.captureLog = function (t, e, r, n) { + return this.capture('log', { message: t }, e, r, n); + }), + (o.prototype.captureNetwork = function (t, e, r, n) { + (e = e || 'xhr'), (t.subtype = t.subtype || e), n && (t.request = n); + var o = this.levelFromStatus(t.status_code); + return this.capture('network', t, o, r); + }), + (o.prototype.levelFromStatus = function (t) { + return t >= 200 && t < 400 + ? 'info' + : 0 === t || t >= 400 + ? 'error' + : 'info'; + }), + (o.prototype.captureDom = function (t, e, r, n, o) { + var i = { subtype: t, element: e }; + return ( + void 0 !== r && (i.value = r), + void 0 !== n && (i.checked = n), + this.capture('dom', i, 'info', o) + ); + }), + (o.prototype.captureNavigation = function (t, e, r) { + return this.capture('navigation', { from: t, to: e }, 'info', r); + }), + (o.prototype.captureDomContentLoaded = function (t) { + return this.capture( + 'navigation', + { subtype: 'DOMContentLoaded' }, + 'info', + void 0, + t && t.getTime(), + ); + }), + (o.prototype.captureLoad = function (t) { + return this.capture( + 'navigation', + { subtype: 'load' }, + 'info', + void 0, + t && t.getTime(), + ); + }), + (o.prototype.captureConnectivityChange = function (t, e) { + return this.captureNetwork({ change: t }, 'connectivity', e); + }), + (o.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; + }), + (o.prototype.push = function (t) { + this.queue.push(t), + this.queue.length > this.maxQueueSize && this.queue.shift(); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(4), + i = r(2), + s = r(30), + a = { + network: !0, + networkResponseHeaders: !1, + networkResponseBody: !1, + networkRequestHeaders: !1, + networkRequestBody: !1, + networkErrorOnHttp5xx: !1, + networkErrorOnHttp4xx: !1, + networkErrorOnHttp0: !1, + log: !0, + dom: !0, + navigation: !0, + connectivity: !0, + contentSecurityPolicy: !0, + errorOnContentSecurityPolicy: !1, + }; + function u(t, e, r, n, o) { + var i = t[e]; + (t[e] = r(i)), n && n[o].push([t, e, i]); + } + function c(t, e) { + for (var r; t[e].length; ) (r = t[e].shift())[0][r[1]] = r[2]; + } + function l(t, e, r, o, i) { + this.options = t; + var s = t.autoInstrument; + !1 === t.enabled || !1 === s + ? (this.autoInstrument = {}) + : (n.isType(s, 'object') || (s = a), + (this.autoInstrument = n.merge(a, s))), + (this.scrubTelemetryInputs = !!t.scrubTelemetryInputs), + (this.telemetryScrubber = t.telemetryScrubber), + (this.defaultValueScrubber = (function (t) { + for (var e = [], r = 0; r < t.length; ++r) + e.push(new RegExp(t[r], 'i')); + return function (t) { + var r = (function (t) { + if (!t || !t.attributes) return null; + for (var e = t.attributes, r = 0; r < e.length; ++r) + if ('name' === e[r].key) return e[r].value; + return null; + })(t); + if (!r) return !1; + for (var n = 0; n < e.length; ++n) if (e[n].test(r)) return !0; + return !1; + }; + })(t.scrubFields)), + (this.telemeter = e), + (this.rollbar = r), + (this.diagnostic = r.client.notifier.diagnostic), + (this._window = o || {}), + (this._document = i || {}), + (this.replacements = { + network: [], + log: [], + navigation: [], + connectivity: [], + }), + (this.eventRemovers = { + dom: [], + connectivity: [], + contentsecuritypolicy: [], + }), + (this._location = this._window.location), + (this._lastHref = this._location && this._location.href); + } + (l.prototype.configure = function (t) { + this.options = n.merge(this.options, t); + var e = t.autoInstrument, + r = n.merge(this.autoInstrument); + !1 === t.enabled || !1 === e + ? (this.autoInstrument = {}) + : (n.isType(e, 'object') || (e = a), + (this.autoInstrument = n.merge(a, e))), + this.instrument(r), + void 0 !== t.scrubTelemetryInputs && + (this.scrubTelemetryInputs = !!t.scrubTelemetryInputs), + void 0 !== t.telemetryScrubber && + (this.telemetryScrubber = t.telemetryScrubber); + }), + (l.prototype.instrument = function (t) { + !this.autoInstrument.network || (t && t.network) + ? !this.autoInstrument.network && + t && + t.network && + this.deinstrumentNetwork() + : this.instrumentNetwork(), + !this.autoInstrument.log || (t && t.log) + ? !this.autoInstrument.log && + t && + t.log && + this.deinstrumentConsole() + : this.instrumentConsole(), + !this.autoInstrument.dom || (t && t.dom) + ? !this.autoInstrument.dom && t && t.dom && this.deinstrumentDom() + : this.instrumentDom(), + !this.autoInstrument.navigation || (t && t.navigation) + ? !this.autoInstrument.navigation && + t && + t.navigation && + this.deinstrumentNavigation() + : this.instrumentNavigation(), + !this.autoInstrument.connectivity || (t && t.connectivity) + ? !this.autoInstrument.connectivity && + t && + t.connectivity && + this.deinstrumentConnectivity() + : this.instrumentConnectivity(), + !this.autoInstrument.contentSecurityPolicy || + (t && t.contentSecurityPolicy) + ? !this.autoInstrument.contentSecurityPolicy && + t && + t.contentSecurityPolicy && + this.deinstrumentContentSecurityPolicy() + : this.instrumentContentSecurityPolicy(); + }), + (l.prototype.deinstrumentNetwork = function () { + c(this.replacements, 'network'); + }), + (l.prototype.instrumentNetwork = function () { + var t = this; + function e(e, r) { + e in r && + n.isFunction(r[e]) && + u(r, e, function (e) { + return t.rollbar.wrap(e); + }); + } + if ('XMLHttpRequest' in this._window) { + var r = this._window.XMLHttpRequest.prototype; + u( + r, + 'open', + function (t) { + return function (e, r) { + return ( + n.isType(r, 'string') && + (this.__rollbar_xhr + ? ((this.__rollbar_xhr.method = e), + (this.__rollbar_xhr.url = r), + (this.__rollbar_xhr.status_code = null), + (this.__rollbar_xhr.start_time_ms = n.now()), + (this.__rollbar_xhr.end_time_ms = null)) + : (this.__rollbar_xhr = { + method: e, + url: r, + status_code: null, + start_time_ms: n.now(), + end_time_ms: null, + })), + t.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ), + u( + r, + 'setRequestHeader', + function (e) { + return function (r, o) { + return ( + this.__rollbar_xhr || (this.__rollbar_xhr = {}), + n.isType(r, 'string') && + n.isType(o, 'string') && + (t.autoInstrument.networkRequestHeaders && + (this.__rollbar_xhr.request_headers || + (this.__rollbar_xhr.request_headers = {}), + (this.__rollbar_xhr.request_headers[r] = o)), + 'content-type' === r.toLowerCase() && + (this.__rollbar_xhr.request_content_type = o)), + e.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ), + u( + r, + 'send', + function (r) { + return function (o) { + var i = this; + function s() { + if ( + i.__rollbar_xhr && + (null === i.__rollbar_xhr.status_code && + ((i.__rollbar_xhr.status_code = 0), + t.autoInstrument.networkRequestBody && + (i.__rollbar_xhr.request = o), + (i.__rollbar_event = t.captureNetwork( + i.__rollbar_xhr, + 'xhr', + void 0, + ))), + i.readyState < 2 && + (i.__rollbar_xhr.start_time_ms = n.now()), + i.readyState > 3) + ) { + i.__rollbar_xhr.end_time_ms = n.now(); + var e = null; + if ( + ((i.__rollbar_xhr.response_content_type = + i.getResponseHeader('Content-Type')), + t.autoInstrument.networkResponseHeaders) + ) { + var r = t.autoInstrument.networkResponseHeaders; + e = {}; + try { + var s, a; + if (!0 === r) { + var u = i.getAllResponseHeaders(); + if (u) { + var c, + l, + p = u.trim().split(/[\r\n]+/); + for (a = 0; a < p.length; a++) + (s = (c = p[a].split(': ')).shift()), + (l = c.join(': ')), + (e[s] = l); + } + } else + for (a = 0; a < r.length; a++) + e[(s = r[a])] = i.getResponseHeader(s); + } catch (t) {} + } + var f = null; + if (t.autoInstrument.networkResponseBody) + try { + f = i.responseText; + } catch (t) {} + var h = null; + (f || e) && + ((h = {}), + f && + (t.isJsonContentType( + i.__rollbar_xhr.response_content_type, + ) + ? (h.body = t.scrubJson(f)) + : (h.body = f)), + e && (h.headers = e)), + h && (i.__rollbar_xhr.response = h); + try { + var d = i.status; + (d = 1223 === d ? 204 : d), + (i.__rollbar_xhr.status_code = d), + (i.__rollbar_event.level = + t.telemeter.levelFromStatus(d)), + t.errorOnHttpStatus(i.__rollbar_xhr); + } catch (t) {} + } + } + return ( + e('onload', i), + e('onerror', i), + e('onprogress', i), + 'onreadystatechange' in i && + n.isFunction(i.onreadystatechange) + ? u(i, 'onreadystatechange', function (e) { + return t.rollbar.wrap(e, void 0, s); + }) + : (i.onreadystatechange = s), + i.__rollbar_xhr && + t.trackHttpErrors() && + (i.__rollbar_xhr.stack = new Error().stack), + r.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ); + } + 'fetch' in this._window && + u( + this._window, + 'fetch', + function (e) { + return function (r, o) { + for ( + var i = new Array(arguments.length), s = 0, a = i.length; + s < a; + s++ + ) + i[s] = arguments[s]; + var u, + c = i[0], + l = 'GET'; + n.isType(c, 'string') + ? (u = c) + : c && ((u = c.url), c.method && (l = c.method)), + i[1] && i[1].method && (l = i[1].method); + var p = { + method: l, + url: u, + status_code: null, + start_time_ms: n.now(), + end_time_ms: null, + }; + if (i[1] && i[1].headers) { + var f = new Headers(i[1].headers); + (p.request_content_type = f.get('Content-Type')), + t.autoInstrument.networkRequestHeaders && + (p.request_headers = t.fetchHeaders( + f, + t.autoInstrument.networkRequestHeaders, + )); + } + return ( + t.autoInstrument.networkRequestBody && + (i[1] && i[1].body + ? (p.request = i[1].body) + : i[0] && + !n.isType(i[0], 'string') && + i[0].body && + (p.request = i[0].body)), + t.captureNetwork(p, 'fetch', void 0), + t.trackHttpErrors() && (p.stack = new Error().stack), + e.apply(this, i).then(function (e) { + (p.end_time_ms = n.now()), + (p.status_code = e.status), + (p.response_content_type = e.headers.get('Content-Type')); + var r = null; + t.autoInstrument.networkResponseHeaders && + (r = t.fetchHeaders( + e.headers, + t.autoInstrument.networkResponseHeaders, + )); + var o = null; + return ( + t.autoInstrument.networkResponseBody && + 'function' == typeof e.text && + (o = e.clone().text()), + (r || o) && + ((p.response = {}), + o && + ('function' == typeof o.then + ? o.then(function (e) { + e && + t.isJsonContentType(p.response_content_type) + ? (p.response.body = t.scrubJson(e)) + : (p.response.body = e); + }) + : (p.response.body = o)), + r && (p.response.headers = r)), + t.errorOnHttpStatus(p), + e + ); + }) + ); + }; + }, + this.replacements, + 'network', + ); + }), + (l.prototype.captureNetwork = function (t, e, r) { + return ( + t.request && + this.isJsonContentType(t.request_content_type) && + (t.request = this.scrubJson(t.request)), + this.telemeter.captureNetwork(t, e, r) + ); + }), + (l.prototype.isJsonContentType = function (t) { + return !!( + t && + n.isType(t, 'string') && + t.toLowerCase().includes('json') + ); + }), + (l.prototype.scrubJson = function (t) { + return JSON.stringify(o(JSON.parse(t), this.options.scrubFields)); + }), + (l.prototype.fetchHeaders = function (t, e) { + var r = {}; + try { + var n; + if (!0 === e) { + if ('function' == typeof t.entries) + for (var o = t.entries(), i = o.next(); !i.done; ) + (r[i.value[0]] = i.value[1]), (i = o.next()); + } else + for (n = 0; n < e.length; n++) { + var s = e[n]; + r[s] = t.get(s); + } + } catch (t) {} + return r; + }), + (l.prototype.trackHttpErrors = function () { + return ( + this.autoInstrument.networkErrorOnHttp5xx || + this.autoInstrument.networkErrorOnHttp4xx || + this.autoInstrument.networkErrorOnHttp0 + ); + }), + (l.prototype.errorOnHttpStatus = function (t) { + var e = t.status_code; + if ( + (e >= 500 && this.autoInstrument.networkErrorOnHttp5xx) || + (e >= 400 && this.autoInstrument.networkErrorOnHttp4xx) || + (0 === e && this.autoInstrument.networkErrorOnHttp0) + ) { + var r = new Error('HTTP request failed with Status ' + e); + (r.stack = t.stack), this.rollbar.error(r, { skipFrames: 1 }); + } + }), + (l.prototype.deinstrumentConsole = function () { + if ('console' in this._window && this._window.console.log) + for (var t; this.replacements.log.length; ) + (t = this.replacements.log.shift()), + (this._window.console[t[0]] = t[1]); + }), + (l.prototype.instrumentConsole = function () { + if ('console' in this._window && this._window.console.log) { + var t = this, + e = this._window.console, + r = ['debug', 'info', 'warn', 'error', 'log']; + try { + for (var o = 0, i = r.length; o < i; o++) s(r[o]); + } catch (t) { + this.diagnostic.instrumentConsole = { error: t.message }; + } + } + function s(r) { + var o = e[r], + i = e, + s = 'warn' === r ? 'warning' : r; + (e[r] = function () { + var e = Array.prototype.slice.call(arguments), + r = n.formatArgsAsString(e); + t.telemeter.captureLog(r, s), + o && Function.prototype.apply.call(o, i, e); + }), + t.replacements.log.push([r, o]); + } + }), + (l.prototype.deinstrumentDom = function () { + ('addEventListener' in this._window || 'attachEvent' in this._window) && + this.removeListeners('dom'); + }), + (l.prototype.instrumentDom = function () { + if ( + 'addEventListener' in this._window || + 'attachEvent' in this._window + ) { + var t = this.handleClick.bind(this), + e = this.handleBlur.bind(this); + this.addListener('dom', this._window, 'click', 'onclick', t, !0), + this.addListener('dom', this._window, 'blur', 'onfocusout', e, !0); + } + }), + (l.prototype.handleClick = function (t) { + try { + var e = s.getElementFromEvent(t, this._document), + r = e && e.tagName, + n = + s.isDescribedElement(e, 'a') || s.isDescribedElement(e, 'button'); + r && (n || s.isDescribedElement(e, 'input', ['button', 'submit'])) + ? this.captureDomEvent('click', e) + : s.isDescribedElement(e, 'input', ['checkbox', 'radio']) && + this.captureDomEvent('input', e, e.value, e.checked); + } catch (t) {} + }), + (l.prototype.handleBlur = function (t) { + try { + var e = s.getElementFromEvent(t, this._document); + e && + e.tagName && + (s.isDescribedElement(e, 'textarea') + ? this.captureDomEvent('input', e, e.value) + : s.isDescribedElement(e, 'select') && + e.options && + e.options.length + ? this.handleSelectInputChanged(e) + : s.isDescribedElement(e, 'input') && + !s.isDescribedElement(e, 'input', [ + 'button', + 'submit', + 'hidden', + 'checkbox', + 'radio', + ]) && + this.captureDomEvent('input', e, e.value)); + } catch (t) {} + }), + (l.prototype.handleSelectInputChanged = function (t) { + if (t.multiple) + for (var e = 0; e < t.options.length; e++) + t.options[e].selected && + this.captureDomEvent('input', t, t.options[e].value); + else + t.selectedIndex >= 0 && + t.options[t.selectedIndex] && + this.captureDomEvent('input', t, t.options[t.selectedIndex].value); + }), + (l.prototype.captureDomEvent = function (t, e, r, n) { + if (void 0 !== r) + if (this.scrubTelemetryInputs || 'password' === s.getElementType(e)) + r = '[scrubbed]'; + else { + var o = s.describeElement(e); + this.telemetryScrubber + ? this.telemetryScrubber(o) && (r = '[scrubbed]') + : this.defaultValueScrubber(o) && (r = '[scrubbed]'); + } + var i = s.elementArrayToString(s.treeToArray(e)); + this.telemeter.captureDom(t, i, r, n); + }), + (l.prototype.deinstrumentNavigation = function () { + var t = this._window.chrome; + !(t && t.app && t.app.runtime) && + this._window.history && + this._window.history.pushState && + c(this.replacements, 'navigation'); + }), + (l.prototype.instrumentNavigation = function () { + var t = this._window.chrome; + if ( + !(t && t.app && t.app.runtime) && + this._window.history && + this._window.history.pushState + ) { + var e = this; + u( + this._window, + 'onpopstate', + function (t) { + return function () { + var r = e._location.href; + e.handleUrlChange(e._lastHref, r), + t && t.apply(this, arguments); + }; + }, + this.replacements, + 'navigation', + ), + u( + this._window.history, + 'pushState', + function (t) { + return function () { + var r = arguments.length > 2 ? arguments[2] : void 0; + return ( + r && e.handleUrlChange(e._lastHref, r + ''), + t.apply(this, arguments) + ); + }; + }, + this.replacements, + 'navigation', + ); + } + }), + (l.prototype.handleUrlChange = function (t, e) { + var r = i.parse(this._location.href), + n = i.parse(e), + o = i.parse(t); + (this._lastHref = e), + r.protocol === n.protocol && + r.host === n.host && + (e = n.path + (n.hash || '')), + r.protocol === o.protocol && + r.host === o.host && + (t = o.path + (o.hash || '')), + this.telemeter.captureNavigation(t, e); + }), + (l.prototype.deinstrumentConnectivity = function () { + ('addEventListener' in this._window || 'body' in this._document) && + (this._window.addEventListener + ? this.removeListeners('connectivity') + : c(this.replacements, 'connectivity')); + }), + (l.prototype.instrumentConnectivity = function () { + if ('addEventListener' in this._window || 'body' in this._document) + if (this._window.addEventListener) + this.addListener( + 'connectivity', + this._window, + 'online', + void 0, + function () { + this.telemeter.captureConnectivityChange('online'); + }.bind(this), + !0, + ), + this.addListener( + 'connectivity', + this._window, + 'offline', + void 0, + function () { + this.telemeter.captureConnectivityChange('offline'); + }.bind(this), + !0, + ); + else { + var t = this; + u( + this._document.body, + 'ononline', + function (e) { + return function () { + t.telemeter.captureConnectivityChange('online'), + e && e.apply(this, arguments); + }; + }, + this.replacements, + 'connectivity', + ), + u( + this._document.body, + 'onoffline', + function (e) { + return function () { + t.telemeter.captureConnectivityChange('offline'), + e && e.apply(this, arguments); + }; + }, + this.replacements, + 'connectivity', + ); + } + }), + (l.prototype.handleCspEvent = function (t) { + var e = + 'Security Policy Violation: blockedURI: ' + + t.blockedURI + + ', violatedDirective: ' + + t.violatedDirective + + ', effectiveDirective: ' + + t.effectiveDirective + + ', '; + t.sourceFile && + (e += + 'location: ' + + t.sourceFile + + ', line: ' + + t.lineNumber + + ', col: ' + + t.columnNumber + + ', '), + (e += 'originalPolicy: ' + t.originalPolicy), + this.telemeter.captureLog(e, 'error'), + this.handleCspError(e); + }), + (l.prototype.handleCspError = function (t) { + this.autoInstrument.errorOnContentSecurityPolicy && + this.rollbar.error(t); + }), + (l.prototype.deinstrumentContentSecurityPolicy = function () { + 'addEventListener' in this._document && + this.removeListeners('contentsecuritypolicy'); + }), + (l.prototype.instrumentContentSecurityPolicy = function () { + if ('addEventListener' in this._document) { + var t = this.handleCspEvent.bind(this); + this.addListener( + 'contentsecuritypolicy', + this._document, + 'securitypolicyviolation', + null, + t, + !1, + ); + } + }), + (l.prototype.addListener = function (t, e, r, n, o, i) { + e.addEventListener + ? (e.addEventListener(r, o, i), + this.eventRemovers[t].push(function () { + e.removeEventListener(r, o, i); + })) + : n && + (e.attachEvent(n, o), + this.eventRemovers[t].push(function () { + e.detachEvent(n, o); + })); + }), + (l.prototype.removeListeners = function (t) { + for (; this.eventRemovers[t].length; ) this.eventRemovers[t].shift()(); + }), + (t.exports = l); + }, + function (t, e, r) { + 'use strict'; + function n(t) { + return (t.getAttribute('type') || '').toLowerCase(); + } + function o(t) { + if (!t || !t.tagName) return ''; + var e = [t.tagName]; + t.id && e.push('#' + t.id), + t.classes && e.push('.' + t.classes.join('.')); + for (var r = 0; r < t.attributes.length; r++) + e.push('[' + t.attributes[r].key + '="' + t.attributes[r].value + '"]'); + return e.join(''); + } + function i(t) { + if (!t || !t.tagName) return null; + var e, + r, + n, + o, + i = {}; + (i.tagName = t.tagName.toLowerCase()), + t.id && (i.id = t.id), + (e = t.className) && + 'string' == typeof e && + (i.classes = e.split(/\s+/)); + var s = ['type', 'name', 'title', 'alt']; + for (i.attributes = [], o = 0; o < s.length; o++) + (r = s[o]), + (n = t.getAttribute(r)) && i.attributes.push({ key: r, value: n }); + return i; + } + t.exports = { + describeElement: i, + descriptionToString: o, + elementArrayToString: function (t) { + for ( + var e, r, n = ' > '.length, i = [], s = 0, a = t.length - 1; + a >= 0; + a-- + ) { + if ( + ((e = o(t[a])), + (r = s + i.length * n + e.length), + a < t.length - 1 && r >= 83) + ) { + i.unshift('...'); + break; + } + i.unshift(e), (s += e.length); + } + return i.join(' > '); + }, + treeToArray: function (t) { + for ( + var e, r = [], n = 0; + t && n < 5 && 'html' !== (e = i(t)).tagName; + n++ + ) + r.unshift(e), (t = t.parentNode); + return r; + }, + getElementFromEvent: function (t, e) { + return t.target + ? t.target + : e && e.elementFromPoint + ? e.elementFromPoint(t.clientX, t.clientY) + : void 0; + }, + isDescribedElement: function (t, e, r) { + if (t.tagName.toLowerCase() !== e.toLowerCase()) return !1; + if (!r) return !0; + t = n(t); + for (var o = 0; o < r.length; o++) if (r[o] === t) return !0; + return !1; + }, + getElementType: n, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(32); + t.exports = n; + }, + function (t, e) { + t.exports = function (t) { + var e, + r, + n, + o, + i, + s, + a, + u, + c, + l, + p, + f, + h, + d = + /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + function m(t) { + return t < 10 ? '0' + t : t; + } + function g() { + return this.valueOf(); + } + function v(t) { + return ( + (d.lastIndex = 0), + d.test(t) + ? '"' + + t.replace(d, function (t) { + var e = n[t]; + return 'string' == typeof e + ? e + : '\\u' + ('0000' + t.charCodeAt(0).toString(16)).slice(-4); + }) + + '"' + : '"' + t + '"' + ); + } + 'function' != typeof Date.prototype.toJSON && + ((Date.prototype.toJSON = function () { + return isFinite(this.valueOf()) + ? this.getUTCFullYear() + + '-' + + m(this.getUTCMonth() + 1) + + '-' + + m(this.getUTCDate()) + + 'T' + + m(this.getUTCHours()) + + ':' + + m(this.getUTCMinutes()) + + ':' + + m(this.getUTCSeconds()) + + 'Z' + : null; + }), + (Boolean.prototype.toJSON = g), + (Number.prototype.toJSON = g), + (String.prototype.toJSON = g)), + 'function' != typeof t.stringify && + ((n = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"': '\\"', + '\\': '\\\\', + }), + (t.stringify = function (t, n, i) { + var s; + if (((e = ''), (r = ''), 'number' == typeof i)) + for (s = 0; s < i; s += 1) r += ' '; + else 'string' == typeof i && (r = i); + if ( + ((o = n), + n && + 'function' != typeof n && + ('object' != typeof n || 'number' != typeof n.length)) + ) + throw new Error('JSON.stringify'); + return (function t(n, i) { + var s, + a, + u, + c, + l, + p = e, + f = i[n]; + switch ( + (f && + 'object' == typeof f && + 'function' == typeof f.toJSON && + (f = f.toJSON(n)), + 'function' == typeof o && (f = o.call(i, n, f)), + typeof f) + ) { + case 'string': + return v(f); + case 'number': + return isFinite(f) ? String(f) : 'null'; + case 'boolean': + case 'null': + return String(f); + case 'object': + if (!f) return 'null'; + if ( + ((e += r), + (l = []), + '[object Array]' === Object.prototype.toString.apply(f)) + ) { + for (c = f.length, s = 0; s < c; s += 1) + l[s] = t(s, f) || 'null'; + return ( + (u = + 0 === l.length + ? '[]' + : e + ? '[\n' + e + l.join(',\n' + e) + '\n' + p + ']' + : '[' + l.join(',') + ']'), + (e = p), + u + ); + } + if (o && 'object' == typeof o) + for (c = o.length, s = 0; s < c; s += 1) + 'string' == typeof o[s] && + (u = t((a = o[s]), f)) && + l.push(v(a) + (e ? ': ' : ':') + u); + else + for (a in f) + Object.prototype.hasOwnProperty.call(f, a) && + (u = t(a, f)) && + l.push(v(a) + (e ? ': ' : ':') + u); + return ( + (u = + 0 === l.length + ? '{}' + : e + ? '{\n' + e + l.join(',\n' + e) + '\n' + p + '}' + : '{' + l.join(',') + '}'), + (e = p), + u + ); + } + })('', { '': t }); + })), + 'function' != typeof t.parse && + (t.parse = + ((l = { + '\\': '\\', + '"': '"', + '/': '/', + t: '\t', + n: '\n', + r: '\r', + f: '\f', + b: '\b', + }), + (p = { + go: function () { + i = 'ok'; + }, + firstokey: function () { + (u = c), (i = 'colon'); + }, + okey: function () { + (u = c), (i = 'colon'); + }, + ovalue: function () { + i = 'ocomma'; + }, + firstavalue: function () { + i = 'acomma'; + }, + avalue: function () { + i = 'acomma'; + }, + }), + (f = { + go: function () { + i = 'ok'; + }, + ovalue: function () { + i = 'ocomma'; + }, + firstavalue: function () { + i = 'acomma'; + }, + avalue: function () { + i = 'acomma'; + }, + }), + (h = { + '{': { + go: function () { + s.push({ state: 'ok' }), (a = {}), (i = 'firstokey'); + }, + ovalue: function () { + s.push({ container: a, state: 'ocomma', key: u }), + (a = {}), + (i = 'firstokey'); + }, + firstavalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = {}), + (i = 'firstokey'); + }, + avalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = {}), + (i = 'firstokey'); + }, + }, + '}': { + firstokey: function () { + var t = s.pop(); + (c = a), (a = t.container), (u = t.key), (i = t.state); + }, + ocomma: function () { + var t = s.pop(); + (a[u] = c), + (c = a), + (a = t.container), + (u = t.key), + (i = t.state); + }, + }, + '[': { + go: function () { + s.push({ state: 'ok' }), (a = []), (i = 'firstavalue'); + }, + ovalue: function () { + s.push({ container: a, state: 'ocomma', key: u }), + (a = []), + (i = 'firstavalue'); + }, + firstavalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = []), + (i = 'firstavalue'); + }, + avalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = []), + (i = 'firstavalue'); + }, + }, + ']': { + firstavalue: function () { + var t = s.pop(); + (c = a), (a = t.container), (u = t.key), (i = t.state); + }, + acomma: function () { + var t = s.pop(); + a.push(c), + (c = a), + (a = t.container), + (u = t.key), + (i = t.state); + }, + }, + ':': { + colon: function () { + if (Object.hasOwnProperty.call(a, u)) + throw new SyntaxError("Duplicate key '" + u + '"'); + i = 'ovalue'; + }, + }, + ',': { + ocomma: function () { + (a[u] = c), (i = 'okey'); + }, + acomma: function () { + a.push(c), (i = 'avalue'); + }, + }, + true: { + go: function () { + (c = !0), (i = 'ok'); + }, + ovalue: function () { + (c = !0), (i = 'ocomma'); + }, + firstavalue: function () { + (c = !0), (i = 'acomma'); + }, + avalue: function () { + (c = !0), (i = 'acomma'); + }, + }, + false: { + go: function () { + (c = !1), (i = 'ok'); + }, + ovalue: function () { + (c = !1), (i = 'ocomma'); + }, + firstavalue: function () { + (c = !1), (i = 'acomma'); + }, + avalue: function () { + (c = !1), (i = 'acomma'); + }, + }, + null: { + go: function () { + (c = null), (i = 'ok'); + }, + ovalue: function () { + (c = null), (i = 'ocomma'); + }, + firstavalue: function () { + (c = null), (i = 'acomma'); + }, + avalue: function () { + (c = null), (i = 'acomma'); + }, + }, + }), + function (t, e) { + var r, + n, + o = + /^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/; + (i = 'go'), (s = []); + try { + for (; (r = o.exec(t)); ) + r[1] + ? h[r[1]][i]() + : r[2] + ? ((c = +r[2]), f[i]()) + : ((n = r[3]), + (c = n.replace( + /\\(?:u(.{4})|([^u]))/g, + function (t, e, r) { + return e + ? String.fromCharCode(parseInt(e, 16)) + : l[r]; + }, + )), + p[i]()), + (t = t.slice(r[0].length)); + } catch (t) { + i = t; + } + if ('ok' !== i || /[^\u0020\t\n\r]/.test(t)) + throw i instanceof SyntaxError ? i : new SyntaxError('JSON'); + return 'function' == typeof e + ? (function t(r, n) { + var o, + i, + s = r[n]; + if (s && 'object' == typeof s) + for (o in c) + Object.prototype.hasOwnProperty.call(s, o) && + (void 0 !== (i = t(s, o)) ? (s[o] = i) : delete s[o]); + return e.call(r, n, s); + })({ '': c }, '') + : c; + })); + }; + }, + function (t, e, r) { + 'use strict'; + function n(t, e, r) { + if (e.hasOwnProperty && e.hasOwnProperty('addEventListener')) { + for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim; ) + n = n._rollbarOldAdd; + var o = function (e, r, o) { + n.call(this, e, t.wrap(r), o); + }; + (o._rollbarOldAdd = n), (o.belongsToShim = r), (e.addEventListener = o); + for ( + var i = e.removeEventListener; + i._rollbarOldRemove && i.belongsToShim; + + ) + i = i._rollbarOldRemove; + var s = function (t, e, r) { + i.call(this, t, (e && e._rollbar_wrapped) || e, r); + }; + (s._rollbarOldRemove = i), + (s.belongsToShim = r), + (e.removeEventListener = s); + } + } + t.exports = function (t, e, r) { + if (t) { + var o, + i, + s = + 'EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload'.split( + ',', + ); + for (o = 0; o < s.length; ++o) + t[(i = s[o])] && t[i].prototype && n(e, t[i].prototype, r); + } + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(5); + function i(t, e) { + return [t, n.stringify(t, e)]; + } + function s(t, e) { + var r = t.length; + return r > 2 * e ? t.slice(0, e).concat(t.slice(r - e)) : t; + } + function a(t, e, r) { + r = void 0 === r ? 30 : r; + var o, + i = t.data.body; + if (i.trace_chain) + for (var a = i.trace_chain, u = 0; u < a.length; u++) + (o = s((o = a[u].frames), r)), (a[u].frames = o); + else i.trace && ((o = s((o = i.trace.frames), r)), (i.trace.frames = o)); + return [t, n.stringify(t, e)]; + } + function u(t, e) { + return e && e.length > t ? e.slice(0, t - 3).concat('...') : e; + } + function c(t, e, r) { + return [ + (e = o(e, function e(r, i, s) { + switch (n.typeName(i)) { + case 'string': + return u(t, i); + case 'object': + case 'array': + return o(i, e, s); + default: + return i; + } + })), + n.stringify(e, r), + ]; + } + function l(t) { + return ( + t.exception && + (delete t.exception.description, + (t.exception.message = u(255, t.exception.message))), + (t.frames = s(t.frames, 1)), + t + ); + } + function p(t, e) { + var r = t.data.body; + if (r.trace_chain) + for (var o = r.trace_chain, i = 0; i < o.length; i++) o[i] = l(o[i]); + else r.trace && (r.trace = l(r.trace)); + return [t, n.stringify(t, e)]; + } + function f(t, e) { + return n.maxByteSize(t) > e; + } + t.exports = { + truncate: function (t, e, r) { + r = void 0 === r ? 524288 : r; + for ( + var n, + o, + s, + u = [ + i, + a, + c.bind(null, 1024), + c.bind(null, 512), + c.bind(null, 256), + p, + ]; + (n = u.shift()); + + ) + if (((t = (o = n(t, e))[0]), (s = o[1]).error || !f(s.value, r))) + return s; + return s; + }, + raw: i, + truncateFrames: a, + truncateStrings: c, + maybeTruncateValue: u, + }; + }, +]); diff --git a/examples/browser_extension_v3/README.md b/examples/browser_extension_v3/README.md index 732ad9250..4b135f5d7 100644 --- a/examples/browser_extension_v3/README.md +++ b/examples/browser_extension_v3/README.md @@ -5,9 +5,9 @@ and in the content script of a Chrome/Chromium manifest v3 extension. To load and run this demo: -* Add your Rolllbar client token (config.js for client script, service-worker.js for background script.) -* Enable developer mode for extensions in Chrome -* Click 'Load unpacked extension', and select this folder to load. +- Add your Rolllbar client token (config.js for client script, service-worker.js for background script.) +- Enable developer mode for extensions in Chrome +- Click 'Load unpacked extension', and select this folder to load. The background script outputs to a separate console accessed from the extensions panel in Chrome. diff --git a/examples/browser_extension_v3/config.js b/examples/browser_extension_v3/config.js index ab86240b1..8577ba900 100644 --- a/examples/browser_extension_v3/config.js +++ b/examples/browser_extension_v3/config.js @@ -1,6 +1,5 @@ - window._rollbarConfig = { accessToken: 'ROLLBAR_CLIENT_TOKEN', captureUncaught: true, - captureUnhandledRejections: true + captureUnhandledRejections: true, }; diff --git a/examples/browser_extension_v3/rollbar.min.js b/examples/browser_extension_v3/rollbar.min.js index 5f1fd5feb..6805dcfb4 100644 --- a/examples/browser_extension_v3/rollbar.min.js +++ b/examples/browser_extension_v3/rollbar.min.js @@ -1 +1,4447 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=6)}([function(t,e,r){"use strict";var n=r(11),o={};function i(t,e){return e===s(t)}function s(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 i(t,"function")}function u(t){var e=Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?"),r=RegExp("^"+e+"$");return c(t)&&r.test(t)}function c(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function l(){var t=y();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"===e?r:7&r|8).toString(16)}))}var p={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function f(t,e){var r,n;try{r=o.stringify(t)}catch(o){if(e&&a(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function h(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function d(t){return function t(e,r){var n,o,a,u={};try{for(o in e)(n=e[o])&&(i(n,"object")||i(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+s(n):((a=r.slice()).push(n),u[o]=t(n,a)):u[o]=n}catch(t){u="Failed cloning custom data: "+t.message}return u}(t,[t])}var m=["log","network","dom","navigation","error","manual"],g=["critical","error","warning","info","debug"];function v(t,e){for(var r=0;ra)?(s=e.path,e.path=s.substring(0,a)+i+"&"+s.substring(a+1)):-1!==u?(s=e.path,e.path=s.substring(0,u)+i+s.substring(u)):e.path=e.path+i},createItem:function(t,e,r,n,o){for(var i,a,u,c,p,f,m=[],g=[],v=0,b=t.length;v0&&(u||(u=d({})),u.extraArgs=d(m));var k={message:i,err:a,custom:u,timestamp:y(),callback:c,notifier:r,diagnostic:{},uuid:l()};return function(t,e){e&&void 0!==e.level&&(t.level=e.level,delete e.level);e&&void 0!==e.skipFrames&&(t.skipFrames=e.skipFrames,delete e.skipFrames)}(k,u),n&&p&&(k.request=p),o&&(k.lambdaContext=o),k._originalArgs=t,k.diagnostic.original_arg_types=g,k},addErrorContext:function(t,e){var r=t.data.custom||{},o=!1;try{for(var i=0;i2){var o=n.slice(0,3),i=o[2].indexOf("/");-1!==i&&(o[2]=o[2].substring(0,i));r=o.concat("0000:0000:0000:0000:0000").join(":")}}else r=null}catch(t){r=null}else r=null;t.user_ip=r}},formatArgsAsString:function(t){var e,r,n,o=[];for(e=0,r=t.length;e500&&(n=n.substr(0,497)+"...");break;case"null":n="null";break;case"undefined":n="undefined";break;case"symbol":n=n.toString()}o.push(n)}return o.join(" ")},formatUrl:function(t,e){if(!(e=e||t.protocol)&&t.port&&(80===t.port?e="http:":443===t.port&&(e="https:")),e=e||"https:",!t.hostname)return null;var r=e+"//"+t.hostname;return t.port&&(r=r+":"+t.port),t.path&&(r+=t.path),r},get:function(t,e){if(t){var r=e.split("."),n=t;try{for(var o=0,i=r.length;o=1&&r>e}function s(t,e,r,n,o,i,s){var a=null;return r&&(r=new Error(r)),r||n||(a=function(t,e,r,n,o){var i,s=e.environment||e.payload&&e.payload.environment;i=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.";var a={body:{message:{body:i,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:s,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(a.platform="browser",a.framework="browser-js",a.notifier.name="rollbar-browser-js"):"server"===t?(a.framework=e.framework||"node-js",a.notifier.name=e.notifier.name):"react-native"===t&&(a.framework=e.framework||"react-native",a.notifier.name=e.notifier.name);return a}(t,e,o,i,s)),{error:r,shouldSend:n,payload:a}}o.globalSettings={startTime:n.now(),maxItems:void 0,itemsPerMinute:void 0},o.prototype.configureGlobal=function(t){void 0!==t.startTime&&(o.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(o.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(o.globalSettings.itemsPerMinute=t.itemsPerMinute)},o.prototype.shouldSend=function(t,e){var r=(e=e||n.now())-this.startTime;(r<0||r>=6e4)&&(this.startTime=e,this.perMinCounter=0);var a=o.globalSettings.maxItems,u=o.globalSettings.itemsPerMinute;if(i(t,a,this.counter))return s(this.platform,this.platformOptions,a+" max items reached",!1);if(i(t,u,this.perMinCounter))return s(this.platform,this.platformOptions,u+" items per minute reached",!1);this.counter++,this.perMinCounter++;var c=!i(t,a,this.counter),l=c;return c=c&&!i(t,u,this.perMinCounter),s(this.platform,this.platformOptions,null,c,a,u,l)},o.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e},t.exports=o},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,o=Object.prototype.toString,i=function(t){if(!t||"[object Object]"!==o.call(t))return!1;var e,r=n.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&n.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!i)return!1;for(e in t);return void 0===e||n.call(t,e)};t.exports=function t(){var e,r,n,o,s,a={},u=null,c=arguments.length;for(e=0;ethis.options.maxRetries&&(o=!1))}o?this._retryApiRequest(e,r):r(t)},o.prototype._retryApiRequest=function(t,e){this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;this.retryQueue.length;){var t=this.retryQueue.shift();this._makeApiRequest(t.item,t.callback)}}.bind(this),this.options.retryInterval))},o.prototype._dequeuePendingRequest=function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())},o.prototype._maybeLog=function(t,e){if(this.logger&&this.options.verbose){var r=e;if(r=(r=r||n.get(t,"body.trace.exception.message"))||n.get(t,"body.trace_chain.0.exception.message"))return void this.logger.error(r);(r=n.get(t,"body.message.body"))&&this.logger.log(r)}},o.prototype._maybeCallWait=function(){return!(!n.isFunction(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length)&&(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),!0)},t.exports=o},function(t,e,r){"use strict";var n=r(0);function o(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}o.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=n.merge(e,t),this},o.prototype.addTransform=function(t){return n.isFunction(t)&&this.transforms.push(t),this},o.prototype.log=function(t,e){if(e&&n.isFunction(e)||(e=function(){}),!this.options.enabled)return e(new Error("Rollbar is not enabled"));this.queue.addPendingItem(t);var r=t.err;this._applyTransforms(t,function(n,o){if(n)return this.queue.removePendingItem(t),e(n,null);this.queue.addItem(o,e,r,t)}.bind(this))},o.prototype._applyTransforms=function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,s=function(t,a){t?e(t,null):++r!==n?o[r](a,i,s):e(null,a)};s(null,t)},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(15),i={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443};function s(t,e,r,n,o){this.options=t,this.transport=e,this.url=r,this.truncation=n,this.jsonBackup=o,this.accessToken=t.accessToken,this.transportOptions=a(t,r)}function a(t,e){return o.getTransportFromOptions(t,i,e)}s.prototype.postItem=function(t,e){var r=o.transportOptions(this.transportOptions,"POST"),n=o.buildPayload(this.accessToken,t,this.jsonBackup),i=this;setTimeout((function(){i.transport.post(i.accessToken,r,n,e)}),0)},s.prototype.buildJsonPayload=function(t,e){var r,i=o.buildPayload(this.accessToken,t,this.jsonBackup);return(r=this.truncation?this.truncation.truncate(i):n.stringify(i)).error?(e&&e(r.error),null):r.value},s.prototype.postJsonPayload=function(t,e){var r=o.transportOptions(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)},s.prototype.configure=function(t){var e=this.oldOptions;return this.options=n.merge(e,t),this.transportOptions=a(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this},t.exports=s},function(t,e,r){"use strict";var n=r(0);t.exports={buildPayload:function(t,e,r){if(!n.isType(e.context,"string")){var o=n.stringify(e.context,r);o.error?e.context="Error: could not serialize 'context'":e.context=o.value||"",e.context.length>255&&(e.context=e.context.substr(0,255))}return{access_token:t,data:e}},getTransportFromOptions:function(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,s=e.path,a=e.search,u=t.timeout,c=function(t){var e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=t.defaultTransport||"xhr";void 0===e.fetch&&(r="xhr");void 0===e.XMLHttpRequest&&(r="fetch");return r}(t),l=t.proxy;if(t.endpoint){var p=r.parse(t.endpoint);n=p.hostname,o=p.protocol,i=p.port,s=p.pathname,a=p.search}return{timeout:u,hostname:n,protocol:o,port:i,path:s,search:a,proxy:l,transport:c}},transportOptions:function(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,s=t.timeout,a=t.transport;return t.search&&(i+=t.search),t.proxy&&(i=r+"//"+o+i,o=t.proxy.host||t.proxy.hostname,n=t.proxy.port,r=t.proxy.protocol||r),{timeout:s,protocol:r,hostname:o,path:i,port:n,method:e,transport:a}},appendPathToPath:function(t,e){var r=/\/$/.test(t),n=/^\//.test(e);return r&&n?e=e.substring(1):r||n||(e="/"+e),t+e}}},function(t,e){!function(t){"use strict";t.console||(t.console={});for(var e,r,n=t.console,o=function(){},i=["memory"],s="assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn".split(",");e=i.pop();)n[e]||(n[e]={});for(;r=s.pop();)n[r]||(n[r]=o)}("undefined"==typeof window?this:window)},function(t,e,r){"use strict";var n={ieVersion:function(){if("undefined"!=typeof document){for(var t=3,e=document.createElement("div"),r=e.getElementsByTagName("i");e.innerHTML="\x3c!--[if gt IE "+ ++t+"]>4?t:void 0}}};t.exports=n},function(t,e,r){"use strict";function n(t,e,r,n){t._rollbarWrappedError&&(n[4]||(n[4]=t._rollbarWrappedError),n[5]||(n[5]=t._rollbarWrappedError._rollbarContext),t._rollbarWrappedError=null);var o=e.handleUncaughtException.apply(e,n);r&&r.apply(t,n),"anonymous"===o&&(e.anonymousErrorsPending+=1)}t.exports={captureUncaughtExceptions:function(t,e,r){if(t){var o;if("function"==typeof e._rollbarOldOnError)o=e._rollbarOldOnError;else if(t.onerror){for(o=t.onerror;o._rollbarOldOnError;)o=o._rollbarOldOnError;e._rollbarOldOnError=o}e.handleAnonymousErrors();var i=function(){var r=Array.prototype.slice.call(arguments,0);n(t,e,o,r)};r&&(i._rollbarOldOnError=o),t.onerror=i}},captureUnhandledRejections:function(t,e,r){if(t){"function"==typeof t._rollbarURH&&t._rollbarURH.belongsToShim&&t.removeEventListener("unhandledrejection",t._rollbarURH);var n=function(t){var r,n,o;try{r=t.reason}catch(t){r=void 0}try{n=t.promise}catch(t){n="[unhandledrejection] error getting `promise` from event"}try{o=t.detail,!r&&o&&(r=o.reason,n=o.promise)}catch(t){}r||(r="[unhandledrejection] error getting `reason` from event"),e&&e.handleUnhandledRejection&&e.handleUnhandledRejection(r,n)};n.belongsToShim=r,t._rollbarURH=n,t.addEventListener("unhandledrejection",n)}}}},function(t,e,r){"use strict";var n=r(0),o=r(20),i=r(21);function s(t){this.truncation=t}s.prototype.get=function(t,e,r,o,i){o&&n.isFunction(o)||(o=function(){}),n.addParamsAndAccessTokenToPath(t,e,r);var s=n.formatUrl(e);this._makeZoneRequest(t,s,"GET",null,o,i,e.timeout,e.transport)},s.prototype.post=function(t,e,r,o,i){if(o&&n.isFunction(o)||(o=function(){}),!r)return o(new Error("Cannot send empty request"));var s;if((s=this.truncation?this.truncation.truncate(r):n.stringify(r)).error)return o(s.error);var a=s.value,u=n.formatUrl(e);this._makeZoneRequest(t,u,"POST",a,o,i,e.timeout,e.transport)},s.prototype.postJsonPayload=function(t,e,r,o,i){o&&n.isFunction(o)||(o=function(){});var s=n.formatUrl(e);this._makeZoneRequest(t,s,"POST",r,o,i,e.timeout,e.transport)},s.prototype._makeZoneRequest=function(){var t="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,e=t&&t.Zone&&t.Zone.current,r=Array.prototype.slice.call(arguments);if(e&&"angular"===e._name){var n=e._parent;n.run((function(){this._makeRequest.apply(void 0,r)}))}else this._makeRequest.apply(void 0,r)},s.prototype._makeRequest=function(t,e,r,n,s,a,u,c){if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,(function(t){}),(function(t){e(new Error(t))}))}(n,s);"fetch"===c?o(t,e,r,n,s,u):i(t,e,r,n,s,a,u)},t.exports=s},function(t,e,r){"use strict";var n=r(1),o=r(0);t.exports=function(t,e,r,i,s,a){var u,c;o.isFiniteNumber(a)&&(u=new AbortController,c=setTimeout(()=>u.abort(),a)),fetch(e,{method:r,headers:{"Content-Type":"application/json","X-Rollbar-Access-Token":t,signal:u&&u.signal},body:i}).then(t=>(c&&clearTimeout(c),t.json())).then(t=>{s(null,t)}).catch(t=>{n.error(t.message),s(t)})}},function(t,e,r){"use strict";var n=r(0),o=r(1);function i(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}t.exports=function(t,e,r,s,a,u,c){var l;if(!(l=u?u():function(){var t,e,r=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=r.length;for(e=0;e=400&&t.status<600}(l)){if(403===l.status){var e=t.value&&t.value.message;o.error(e)}a(new Error(String(l.status)))}else{a(i("XHR response had no status code (likely connection failure)"))}}}catch(t){var r;r=t&&t.stack?t:new Error(t),a(r)}var s};l.open(r,e,!0),l.setRequestHeader&&(l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("X-Rollbar-Access-Token",t)),n.isFiniteNumber(c)&&(l.timeout=c),l.onreadystatechange=p,l.send(s)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return a(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===e.substring(0,5)&&(e="http"+e.substring(5));var f=new XDomainRequest;f.onprogress=function(){},f.ontimeout=function(){a(i("Request timed out","ETIMEDOUT"))},f.onerror=function(){a(new Error("Error during request"))},f.onload=function(){var t=n.jsonParse(f.responseText);a(t.error,t.value)},f.open(r,e,!0),f.send(s)}else a(new Error("Cannot find a method to transport a request"))}}catch(t){a(t)}}},function(t,e,r){"use strict";var n=r(0),o=r(3),i=r(1);function s(t,e,r){var o=t.message,i=t.custom;o||(o="Item sent with null or missing arguments.");var s={body:o};i&&(s.extra=n.merge(i)),n.set(t,"data.body",{message:s}),r(null,t)}function a(t){var e=t.stackInfo.stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function u(t,e,r){var i=t&&t.data.description,s=t&&t.custom,u=a(t),l=o.guessErrorClass(e.message),p={exception:{class:c(e,l[0],r),message:l[1]}};if(i&&(p.exception.description=i),u){var f,h,d,m,g,v,y,b;for(0===u.length&&(p.exception.stack=e.rawStack,p.exception.raw=String(e.rawException)),p.frames=[],y=0;y0&&n.set(e,"data.request",i),o(null,e)}},addClientInfo:function(t){return function(e,r,o){if(!t)return o(null,e);var i=t.navigator||{},s=t.screen||{};n.set(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:i.userAgent,language:i.language,cookie_enabled:i.cookieEnabled,screen:{width:s.width,height:s.height}}}),o(null,e)}},addPluginInfo:function(t){return function(e,r,o){if(!t||!t.navigator)return o(null,e);for(var i,s=[],a=t.navigator.plugins||[],u=0,c=a.length;u-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var o=this.extractLocation(n?n[1]:r),i=n&&r||void 0,s=["eval",""].indexOf(o[0])>-1?void 0:o[0];return new t({functionName:i,fileName:s,lineNumber:o[1],columnNumber:o[2],source:e})}),this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter((function(t){return!t.match(n)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t({functionName:e});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(r),o=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(r,""));return new t({functionName:o,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),o=[],i=2,s=n.length;i/,"$2").replace(/\([^)]*\)/g,"")||void 0;i.match(/\(([^)]*)\)/)&&(r=i.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var a=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new t({functionName:s,args:a,fileName:o[0],lineNumber:o[1],columnNumber:o[2],source:e})}),this)}}})?n.apply(e,o):n)||(t.exports=i)}()},function(t,e,r){var n,o,i;!function(r,s){"use strict";o=[],void 0===(i="function"==typeof(n=function(){function t(t){return t.charAt(0).toUpperCase()+t.substring(1)}function e(t){return function(){return this[t]}}var r=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],o=["fileName","functionName","source"],i=r.concat(n,o,["args"],["evalOrigin"]);function s(e){if(e)for(var r=0;ro&&(i=this.maxQueueSize-o),this.maxQueueSize=o,this.queue.splice(0,i)},o.prototype.copyEvents=function(){var t=Array.prototype.slice.call(this.queue,0);if(n.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},o.prototype.capture=function(t,e,r,o,s){var a={level:i(t,r),type:t,timestamp_ms:s||n.now(),body:e,source:"client"};o&&(a.uuid=o);try{if(n.isFunction(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a},o.prototype.captureEvent=function(t,e,r,n){return this.capture(t,e,r,n)},o.prototype.captureError=function(t,e,r,n){var o={message:t.message||String(t)};return t.stack&&(o.stack=t.stack),this.capture("error",o,e,r,n)},o.prototype.captureLog=function(t,e,r,n){return this.capture("log",{message:t},e,r,n)},o.prototype.captureNetwork=function(t,e,r,n){e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var o=this.levelFromStatus(t.status_code);return this.capture("network",t,o,r)},o.prototype.levelFromStatus=function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"},o.prototype.captureDom=function(t,e,r,n,o){var i={subtype:t,element:e};return void 0!==r&&(i.value=r),void 0!==n&&(i.checked=n),this.capture("dom",i,"info",o)},o.prototype.captureNavigation=function(t,e,r){return this.capture("navigation",{from:t,to:e},"info",r)},o.prototype.captureDomContentLoaded=function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())},o.prototype.captureLoad=function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())},o.prototype.captureConnectivityChange=function(t,e){return this.captureNetwork({change:t},"connectivity",e)},o.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},o.prototype.push=function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()},t.exports=o},function(t,e,r){"use strict";var n=r(0),o=r(32),i=r(4),s=r(2),a=r(33),u={network:!0,networkResponseHeaders:!1,networkResponseBody:!1,networkRequestHeaders:!1,networkRequestBody:!1,networkErrorOnHttp5xx:!1,networkErrorOnHttp4xx:!1,networkErrorOnHttp0:!1,log:!0,dom:!0,navigation:!0,connectivity:!0,contentSecurityPolicy:!0,errorOnContentSecurityPolicy:!1};function c(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])}function l(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function p(t,e,r,o,i){this.options=t;var s=t.autoInstrument;!1===t.enabled||!1===s?this.autoInstrument={}:(n.isType(s,"object")||(s=u),this.autoInstrument=n.merge(u,s)),this.scrubTelemetryInputs=!!t.scrubTelemetryInputs,this.telemetryScrubber=t.telemetryScrubber,this.defaultValueScrubber=function(t){for(var e=[],r=0;r3)){i.__rollbar_xhr.end_time_ms=n.now();var e=null;if(i.__rollbar_xhr.response_content_type=i.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var r=t.autoInstrument.networkResponseHeaders;e={};try{var s,a;if(!0===r){var u=i.getAllResponseHeaders();if(u){var c,l,p=u.trim().split(/[\r\n]+/);for(a=0;a=500&&this.autoInstrument.networkErrorOnHttp5xx||e>=400&&this.autoInstrument.networkErrorOnHttp4xx||0===e&&this.autoInstrument.networkErrorOnHttp0){var r=new Error("HTTP request failed with Status "+e);r.stack=t.stack,this.rollbar.error(r,{skipFrames:1})}},p.prototype.deinstrumentConsole=function(){if("console"in this._window&&this._window.console.log)for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]},p.prototype.instrumentConsole=function(){if("console"in this._window&&this._window.console.log){var t=this,e=this._window.console,r=["debug","info","warn","error","log"];try{for(var o=0,i=r.length;o=0&&t.options[t.selectedIndex]&&this.captureDomEvent("input",t,t.options[t.selectedIndex].value)},p.prototype.captureDomEvent=function(t,e,r,n){if(void 0!==r)if(this.scrubTelemetryInputs||"password"===a.getElementType(e))r="[scrubbed]";else{var o=a.describeElement(e);this.telemetryScrubber?this.telemetryScrubber(o)&&(r="[scrubbed]"):this.defaultValueScrubber(o)&&(r="[scrubbed]")}var i=a.elementArrayToString(a.treeToArray(e));this.telemeter.captureDom(t,i,r,n)},p.prototype.deinstrumentNavigation=function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&l(this.replacements,"navigation")},p.prototype.instrumentNavigation=function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;c(this._window,"onpopstate",(function(t){return function(){var r=e._location.href;e.handleUrlChange(e._lastHref,r),t&&t.apply(this,arguments)}}),this.replacements,"navigation"),c(this._window.history,"pushState",(function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,r+""),t.apply(this,arguments)}}),this.replacements,"navigation")}},p.prototype.handleUrlChange=function(t,e){var r=s.parse(this._location.href),n=s.parse(e),o=s.parse(t);this._lastHref=e,r.protocol===n.protocol&&r.host===n.host&&(e=n.path+(n.hash||"")),r.protocol===o.protocol&&r.host===o.host&&(t=o.path+(o.hash||"")),this.telemeter.captureNavigation(t,e)},p.prototype.deinstrumentConnectivity=function(){("addEventListener"in this._window||"body"in this._document)&&(this._window.addEventListener?this.removeListeners("connectivity"):l(this.replacements,"connectivity"))},p.prototype.instrumentConnectivity=function(){if("addEventListener"in this._window||"body"in this._document)if(this._window.addEventListener)this.addListener("connectivity",this._window,"online",void 0,function(){this.telemeter.captureConnectivityChange("online")}.bind(this),!0),this.addListener("connectivity",this._window,"offline",void 0,function(){this.telemeter.captureConnectivityChange("offline")}.bind(this),!0);else{var t=this;c(this._document.body,"ononline",(function(e){return function(){t.telemeter.captureConnectivityChange("online"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity"),c(this._document.body,"onoffline",(function(e){return function(){t.telemeter.captureConnectivityChange("offline"),e&&e.apply(this,arguments)}}),this.replacements,"connectivity")}},p.prototype.handleCspEvent=function(t){var e="Security Policy Violation: blockedURI: "+t.blockedURI+", violatedDirective: "+t.violatedDirective+", effectiveDirective: "+t.effectiveDirective+", ";t.sourceFile&&(e+="location: "+t.sourceFile+", line: "+t.lineNumber+", col: "+t.columnNumber+", "),e+="originalPolicy: "+t.originalPolicy,this.telemeter.captureLog(e,"error"),this.handleCspError(e)},p.prototype.handleCspError=function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)},p.prototype.deinstrumentContentSecurityPolicy=function(){"addEventListener"in this._document&&this.removeListeners("contentsecuritypolicy")},p.prototype.instrumentContentSecurityPolicy=function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,"securitypolicyviolation",null,t,!1)}},p.prototype.addListener=function(t,e,r,n,o,i){e.addEventListener?(e.addEventListener(r,o,i),this.eventRemovers[t].push((function(){e.removeEventListener(r,o,i)}))):n&&(e.attachEvent(n,o),this.eventRemovers[t].push((function(){e.detachEvent(n,o)})))},p.prototype.removeListeners=function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()},t.exports=p},function(t,e,r){"use strict";function n(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function o(t){this.map={},t instanceof o?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}o.prototype.append=function(t,e){t=n(t),e=function(t){return"string"!=typeof t&&(t=String(t)),t}(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},o.prototype.get=function(t){return t=n(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(n(t))},o.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},o.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),function(t){return{next:function(){var e=t.shift();return{done:void 0===e,value:e}}}}(t)},t.exports=function(t){return"undefined"==typeof Headers?new o(t):new Headers(t)}},function(t,e,r){"use strict";function n(t){return(t.getAttribute("type")||"").toLowerCase()}function o(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));for(var r=0;r=0;a--){if(e=o(t[a]),r=s+i.length*n+e.length,a=83){i.unshift("...");break}i.unshift(e),s+=e.length}return i.join(" > ")},treeToArray:function(t){for(var e,r=[],n=0;t&&n<5&&"html"!==(e=i(t)).tagName;n++)r.unshift(e),t=t.parentNode;return r},getElementFromEvent:function(t,e){return t.target?t.target:e&&e.elementFromPoint?e.elementFromPoint(t.clientX,t.clientY):void 0},isDescribedElement:function(t,e,r){if(t.tagName.toLowerCase()!==e.toLowerCase())return!1;if(!r)return!0;t=n(t);for(var o=0;o2*e?t.slice(0,e).concat(t.slice(r-e)):t}function a(t,e,r){r=void 0===r?30:r;var o,i=t.data.body;if(i.trace_chain)for(var a=i.trace_chain,u=0;ut?e.slice(0,t-3).concat("..."):e}function c(t,e,r){return[e=o(e,(function e(r,i,s){switch(n.typeName(i)){case"string":return u(t,i);case"object":case"array":return o(i,e,s);default:return i}})),n.stringify(e,r)]}function l(t){return t.exception&&(delete t.exception.description,t.exception.message=u(255,t.exception.message)),t.frames=s(t.frames,1),t}function p(t,e){var r=t.data.body;if(r.trace_chain)for(var o=r.trace_chain,i=0;ie}t.exports={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,s,u=[i,a,c.bind(null,1024),c.bind(null,512),c.bind(null,256),p];n=u.shift();)if(t=(o=n(t,e))[0],(s=o[1]).error||!f(s.value,r))return s;return s},raw:i,truncateFrames:a,truncateStrings:c,maybeTruncateValue:u}}]); +!(function (t) { + var e = {}; + function r(n) { + if (e[n]) return e[n].exports; + var o = (e[n] = { i: n, l: !1, exports: {} }); + return t[n].call(o.exports, o, o.exports, r), (o.l = !0), o.exports; + } + (r.m = t), + (r.c = e), + (r.d = function (t, e, n) { + r.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: n }); + }), + (r.r = function (t) { + 'undefined' != typeof Symbol && + Symbol.toStringTag && + Object.defineProperty(t, Symbol.toStringTag, { value: 'Module' }), + Object.defineProperty(t, '__esModule', { value: !0 }); + }), + (r.t = function (t, e) { + if ((1 & e && (t = r(t)), 8 & e)) return t; + if (4 & e && 'object' == typeof t && t && t.__esModule) return t; + var n = Object.create(null); + if ( + (r.r(n), + Object.defineProperty(n, 'default', { enumerable: !0, value: t }), + 2 & e && 'string' != typeof t) + ) + for (var o in t) + r.d( + n, + o, + function (e) { + return t[e]; + }.bind(null, o), + ); + return n; + }), + (r.n = function (t) { + var e = + t && t.__esModule + ? function () { + return t.default; + } + : function () { + return t; + }; + return r.d(e, 'a', e), e; + }), + (r.o = function (t, e) { + return Object.prototype.hasOwnProperty.call(t, e); + }), + (r.p = ''), + r((r.s = 6)); +})([ + function (t, e, r) { + 'use strict'; + var n = r(11), + o = {}; + function i(t, e) { + return e === s(t); + } + function s(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 i(t, 'function'); + } + function u(t) { + var e = Function.prototype.toString + .call(Object.prototype.hasOwnProperty) + .replace(/[\\^$.*+?()[\]{}|]/g, '\\$&') + .replace( + /hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, + '$1.*?', + ), + r = RegExp('^' + e + '$'); + return c(t) && r.test(t); + } + function c(t) { + var e = typeof t; + return null != t && ('object' == e || 'function' == e); + } + function l() { + var t = y(); + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace( + /[xy]/g, + function (e) { + var r = (t + 16 * Math.random()) % 16 | 0; + return ( + (t = Math.floor(t / 16)), ('x' === e ? r : (7 & r) | 8).toString(16) + ); + }, + ); + } + var p = { + strictMode: !1, + key: [ + 'source', + 'protocol', + 'authority', + 'userInfo', + 'user', + 'password', + 'host', + 'port', + 'relative', + 'path', + 'directory', + 'file', + 'query', + 'anchor', + ], + q: { name: 'queryKey', parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, + parser: { + strict: + /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, + loose: + /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, + }, + }; + function f(t, e) { + var r, n; + try { + r = o.stringify(t); + } catch (o) { + if (e && a(e)) + try { + r = e(t); + } catch (t) { + n = t; + } + else n = o; + } + return { error: n, value: r }; + } + function h(t, e) { + return function (r, n) { + try { + e(r, n); + } catch (e) { + t.error(e); + } + }; + } + function d(t) { + return (function t(e, r) { + var n, + o, + a, + u = {}; + try { + for (o in e) + (n = e[o]) && (i(n, 'object') || i(n, 'array')) + ? r.includes(n) + ? (u[o] = 'Removed circular reference: ' + s(n)) + : ((a = r.slice()).push(n), (u[o] = t(n, a))) + : (u[o] = n); + } catch (t) { + u = 'Failed cloning custom data: ' + t.message; + } + return u; + })(t, [t]); + } + var m = ['log', 'network', 'dom', 'navigation', 'error', 'manual'], + g = ['critical', 'error', 'warning', 'info', 'debug']; + function v(t, e) { + for (var r = 0; r < t.length; ++r) if (t[r] === e) return !0; + return !1; + } + function y() { + return Date.now ? +Date.now() : +new Date(); + } + t.exports = { + addParamsAndAccessTokenToPath: function (t, e, r) { + (r = r || {}).access_token = t; + var n, + o = []; + for (n in r) + Object.prototype.hasOwnProperty.call(r, n) && + o.push([n, r[n]].join('=')); + var i = '?' + o.sort().join('&'); + (e = e || {}).path = e.path || ''; + var s, + a = e.path.indexOf('?'), + u = e.path.indexOf('#'); + -1 !== a && (-1 === u || u > a) + ? ((s = e.path), + (e.path = s.substring(0, a) + i + '&' + s.substring(a + 1))) + : -1 !== u + ? ((s = e.path), (e.path = s.substring(0, u) + i + s.substring(u))) + : (e.path = e.path + i); + }, + createItem: function (t, e, r, n, o) { + for ( + var i, a, u, c, p, f, m = [], g = [], v = 0, b = t.length; + v < b; + ++v + ) { + var w = s((f = t[v])); + switch ((g.push(w), w)) { + case 'undefined': + break; + case 'string': + i ? m.push(f) : (i = f); + break; + case 'function': + c = h(e, f); + break; + case 'date': + m.push(f); + break; + case 'error': + case 'domexception': + case 'exception': + a ? m.push(f) : (a = f); + break; + case 'object': + case 'array': + if ( + f instanceof Error || + ('undefined' != typeof DOMException && + f instanceof DOMException) + ) { + a ? m.push(f) : (a = f); + break; + } + if (n && 'object' === w && !p) { + for (var _ = 0, x = n.length; _ < x; ++_) + if (void 0 !== f[n[_]]) { + p = f; + break; + } + if (p) break; + } + u ? m.push(f) : (u = f); + break; + default: + if ( + f instanceof Error || + ('undefined' != typeof DOMException && + f instanceof DOMException) + ) { + a ? m.push(f) : (a = f); + break; + } + m.push(f); + } + } + u && (u = d(u)), + m.length > 0 && (u || (u = d({})), (u.extraArgs = d(m))); + var k = { + message: i, + err: a, + custom: u, + timestamp: y(), + callback: c, + notifier: r, + diagnostic: {}, + uuid: l(), + }; + return ( + (function (t, e) { + e && void 0 !== e.level && ((t.level = e.level), delete e.level); + e && + void 0 !== e.skipFrames && + ((t.skipFrames = e.skipFrames), delete e.skipFrames); + })(k, u), + n && p && (k.request = p), + o && (k.lambdaContext = o), + (k._originalArgs = t), + (k.diagnostic.original_arg_types = g), + k + ); + }, + addErrorContext: function (t, e) { + var r = t.data.custom || {}, + o = !1; + try { + for (var i = 0; i < e.length; ++i) + e[i].hasOwnProperty('rollbarContext') && + ((r = n(r, d(e[i].rollbarContext))), (o = !0)); + o && (t.data.custom = r); + } catch (e) { + t.diagnostic.error_context = 'Failed: ' + e.message; + } + }, + createTelemetryEvent: function (t) { + for (var e, r, n, o, i = 0, a = t.length; i < a; ++i) { + switch (s((o = t[i]))) { + case 'string': + !e && v(m, o) ? (e = o) : !n && v(g, o) && (n = o); + break; + case 'object': + r = o; + } + } + return { type: e || 'manual', metadata: r || {}, level: n }; + }, + filterIp: function (t, e) { + if (t && t.user_ip && !0 !== e) { + var r = t.user_ip; + if (e) + try { + var n; + if (-1 !== r.indexOf('.')) + (n = r.split('.')).pop(), n.push('0'), (r = n.join('.')); + else if (-1 !== r.indexOf(':')) { + if ((n = r.split(':')).length > 2) { + var o = n.slice(0, 3), + i = o[2].indexOf('/'); + -1 !== i && (o[2] = o[2].substring(0, i)); + r = o.concat('0000:0000:0000:0000:0000').join(':'); + } + } else r = null; + } catch (t) { + r = null; + } + else r = null; + t.user_ip = r; + } + }, + formatArgsAsString: function (t) { + var e, + r, + n, + o = []; + for (e = 0, r = t.length; e < r; ++e) { + switch (s((n = t[e]))) { + case 'object': + (n = (n = f(n)).error || n.value).length > 500 && + (n = n.substr(0, 497) + '...'); + break; + case 'null': + n = 'null'; + break; + case 'undefined': + n = 'undefined'; + break; + case 'symbol': + n = n.toString(); + } + o.push(n); + } + return o.join(' '); + }, + formatUrl: function (t, e) { + if ( + (!(e = e || t.protocol) && + t.port && + (80 === t.port ? (e = 'http:') : 443 === t.port && (e = 'https:')), + (e = e || 'https:'), + !t.hostname) + ) + return null; + var r = e + '//' + t.hostname; + return t.port && (r = r + ':' + t.port), t.path && (r += t.path), r; + }, + get: function (t, e) { + if (t) { + var r = e.split('.'), + n = t; + try { + for (var o = 0, i = r.length; o < i; ++o) n = n[r[o]]; + } catch (t) { + n = void 0; + } + return n; + } + }, + handleOptions: function (t, e, r, o) { + var i = n(t, e, r); + return ( + (i = (function (t, e) { + t.hostWhiteList && + !t.hostSafeList && + ((t.hostSafeList = t.hostWhiteList), + (t.hostWhiteList = void 0), + e && e.log('hostWhiteList is deprecated. Use hostSafeList.')); + t.hostBlackList && + !t.hostBlockList && + ((t.hostBlockList = t.hostBlackList), + (t.hostBlackList = void 0), + e && e.log('hostBlackList is deprecated. Use hostBlockList.')); + return t; + })(i, o)), + !e || + e.overwriteScrubFields || + (e.scrubFields && + (i.scrubFields = (t.scrubFields || []).concat(e.scrubFields))), + i + ); + }, + isError: function (t) { + return i(t, 'error') || i(t, 'exception'); + }, + isFiniteNumber: function (t) { + return Number.isFinite(t); + }, + isFunction: a, + isIterable: function (t) { + var e = s(t); + return 'object' === e || 'array' === e; + }, + isNativeFunction: u, + isObject: c, + isString: function (t) { + return 'string' == typeof t || t instanceof String; + }, + isType: i, + isPromise: function (t) { + return c(t) && i(t.then, 'function'); + }, + jsonParse: function (t) { + var e, r; + try { + e = o.parse(t); + } catch (t) { + r = t; + } + return { error: r, value: e }; + }, + LEVELS: { debug: 0, info: 1, warning: 2, error: 3, critical: 4 }, + makeUnhandledStackInfo: function (t, e, r, n, o, i, s, a) { + var u = { url: e || '', line: r, column: n }; + (u.func = a.guessFunctionName(u.url, u.line)), + (u.context = a.gatherContext(u.url, u.line)); + var c = + 'undefined' != typeof document && + document && + document.location && + document.location.href, + l = + 'undefined' != typeof window && + window && + window.navigator && + window.navigator.userAgent; + return { + mode: i, + message: o ? String(o) : t || s, + url: c, + stack: [u], + useragent: l, + }; + }, + merge: n, + now: y, + redact: function () { + return '********'; + }, + RollbarJSON: o, + sanitizeUrl: function (t) { + var e = (function (t) { + if (!i(t, 'string')) return; + for ( + var e = p, + r = e.parser[e.strictMode ? 'strict' : 'loose'].exec(t), + n = {}, + o = 0, + s = e.key.length; + o < s; + ++o + ) + n[e.key[o]] = r[o] || ''; + return ( + (n[e.q.name] = {}), + n[e.key[12]].replace(e.q.parser, function (t, r, o) { + r && (n[e.q.name][r] = o); + }), + n + ); + })(t); + return e + ? ('' === e.anchor && (e.source = e.source.replace('#', '')), + (t = e.source.replace('?' + e.query, ''))) + : '(unknown)'; + }, + set: function (t, e, r) { + if (t) { + var n = e.split('.'), + o = n.length; + if (!(o < 1)) + if (1 !== o) + try { + for (var i = t[n[0]] || {}, s = i, a = 1; a < o - 1; ++a) + (i[n[a]] = i[n[a]] || {}), (i = i[n[a]]); + (i[n[o - 1]] = r), (t[n[0]] = s); + } catch (t) { + return; + } + else t[n[0]] = r; + } + }, + setupJSON: function (t) { + (a(o.stringify) && a(o.parse)) || + (i(JSON, 'undefined') || + (t + ? (u(JSON.stringify) && (o.stringify = JSON.stringify), + u(JSON.parse) && (o.parse = JSON.parse)) + : (a(JSON.stringify) && (o.stringify = JSON.stringify), + a(JSON.parse) && (o.parse = JSON.parse))), + (a(o.stringify) && a(o.parse)) || (t && t(o))); + }, + stringify: f, + maxByteSize: function (t) { + for (var e = 0, r = t.length, n = 0; n < r; n++) { + var o = t.charCodeAt(n); + o < 128 ? (e += 1) : o < 2048 ? (e += 2) : o < 65536 && (e += 3); + } + return e; + }, + typeName: s, + uuid4: l, + }; + }, + function (t, e, r) { + 'use strict'; + r(16); + var n = r(17), + o = r(0); + t.exports = { + error: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.error(o.formatArgsAsString(t)) + : console.error.apply(console, t); + }, + info: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.info(o.formatArgsAsString(t)) + : console.info.apply(console, t); + }, + log: function () { + var t = Array.prototype.slice.call(arguments, 0); + t.unshift('Rollbar:'), + n.ieVersion() <= 8 + ? console.log(o.formatArgsAsString(t)) + : console.log.apply(console, t); + }, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + parse: function (t) { + var e, + r, + n = { + protocol: null, + auth: null, + host: null, + path: null, + hash: null, + href: t, + hostname: null, + port: null, + pathname: null, + search: null, + query: null, + }; + if ( + (-1 !== (e = t.indexOf('//')) + ? ((n.protocol = t.substring(0, e)), (r = e + 2)) + : (r = 0), + -1 !== (e = t.indexOf('@', r)) && + ((n.auth = t.substring(r, e)), (r = e + 1)), + -1 === (e = t.indexOf('/', r))) + ) { + if (-1 === (e = t.indexOf('?', r))) + return ( + -1 === (e = t.indexOf('#', r)) + ? (n.host = t.substring(r)) + : ((n.host = t.substring(r, e)), (n.hash = t.substring(e))), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + n + ); + (n.host = t.substring(r, e)), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + (r = e); + } else + (n.host = t.substring(r, e)), + (n.hostname = n.host.split(':')[0]), + (n.port = n.host.split(':')[1]), + n.port && (n.port = parseInt(n.port, 10)), + (r = e); + if ( + (-1 === (e = t.indexOf('#', r)) + ? (n.path = t.substring(r)) + : ((n.path = t.substring(r, e)), (n.hash = t.substring(e))), + n.path) + ) { + var o = n.path.split('?'); + (n.pathname = o[0]), + (n.query = o[1]), + (n.search = n.query ? '?' + n.query : null); + } + return n; + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(23), + o = new RegExp( + '^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ', + ); + function i() { + return null; + } + function s(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 a(t, e) { + return { + stack: (function () { + var r = []; + e = e || 0; + try { + r = n.parse(t); + } catch (t) { + r = []; + } + for (var o = [], i = e; i < r.length; i++) o.push(new s(r[i])); + return o; + })(), + message: t.message, + name: u(t), + rawStack: t.stack, + rawException: t, + }; + } + function u(t) { + var e = t.name && t.name.length && t.name, + r = + t.constructor.name && t.constructor.name.length && t.constructor.name; + return e && r ? ('Error' === e ? r : e) : e || r; + } + t.exports = { + guessFunctionName: function () { + return '?'; + }, + guessErrorClass: function (t) { + if (!t || !t.match) + return ['Unknown error. There was no error message to display.', '']; + var e = t.match(o), + r = '(unknown)'; + return ( + e && + ((r = e[e.length - 1]), + (t = (t = t.replace((e[e.length - 2] || '') + r + ':', '')).replace( + /(^[\s]+|[\s]+$)/g, + '', + ))), + [r, t] + ); + }, + gatherContext: i, + parse: function (t, e) { + var r = t; + if (r.nested || r.cause) { + for (var n = []; r; ) + n.push(new a(r, e)), (r = r.nested || r.cause), (e = 0); + return (n[0].traceChain = n), n[0]; + } + return new a(r, e); + }, + Stack: a, + Frame: s, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(5); + function i(t, e) { + var r = e.split('.'), + o = r.length - 1; + try { + for (var i = 0; i <= o; ++i) + i < o ? (t = t[r[i]]) : (t[r[i]] = n.redact()); + } catch (t) {} + } + t.exports = function (t, e, r) { + if (((e = e || []), r)) for (var s = 0; s < r.length; ++s) i(t, r[s]); + var a = (function (t) { + for (var e, r = [], n = 0; n < t.length; ++n) + (e = '^\\[?(%5[bB])?' + t[n] + '\\[?(%5[bB])?\\]?(%5[dD])?$'), + r.push(new RegExp(e, 'i')); + return r; + })(e), + u = (function (t) { + for (var e, r = [], n = 0; n < t.length; ++n) + (e = '\\[?(%5[bB])?' + t[n] + '\\[?(%5[bB])?\\]?(%5[dD])?'), + r.push(new RegExp('(' + e + '=)([^&\\n]+)', 'igm')); + return r; + })(e); + function c(t, e) { + return e + n.redact(); + } + return o(t, function t(e, r, i) { + var s = (function (t, e) { + var r; + for (r = 0; r < a.length; ++r) + if (a[r].test(t)) { + e = n.redact(); + break; + } + return e; + })(e, r); + return s === r + ? n.isType(r, 'object') || n.isType(r, 'array') + ? o(r, t, i) + : (function (t) { + var e; + if (n.isType(t, 'string')) + for (e = 0; e < u.length; ++e) t = t.replace(u[e], c); + return t; + })(s) + : s; + }); + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = function (t, e, r) { + var o, + i, + s, + a, + u = n.isType(t, 'object'), + c = n.isType(t, 'array'), + l = []; + if (((r = r || { obj: [], mapped: [] }), u)) { + if (((a = r.obj.indexOf(t)), u && -1 !== a)) + return r.mapped[a] || r.obj[a]; + r.obj.push(t), (a = r.obj.length - 1); + } + if (u) + for (o in t) Object.prototype.hasOwnProperty.call(t, o) && l.push(o); + else if (c) for (s = 0; s < t.length; ++s) l.push(s); + var p = u ? {} : [], + f = !0; + for (s = 0; s < l.length; ++s) + (i = t[(o = l[s])]), (p[o] = e(o, i, r)), (f = f && p[o] === t[o]); + return u && !f && (r.mapped[a] = p), f ? t : p; + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(7), + o = 'undefined' != typeof window && window._rollbarConfig, + i = (o && o.globalAlias) || 'Rollbar', + s = + 'undefined' != typeof window && + window[i] && + 'function' == typeof window[i].shimId && + void 0 !== window[i].shimId(); + if ( + ('undefined' == typeof window || + window._rollbarStartTime || + (window._rollbarStartTime = new Date().getTime()), + !s && o) + ) { + var a = new n(o); + window[i] = a; + } else + 'undefined' != typeof window + ? ((window.rollbar = n), (window._rollbarDidLoad = !0)) + : 'undefined' != typeof self && + ((self.rollbar = n), (self._rollbarDidLoad = !0)); + t.exports = n; + }, + function (t, e, r) { + 'use strict'; + var n = r(8), + o = r(30), + i = r(31), + s = r(34), + a = r(36), + u = r(4), + c = r(37); + n.setComponents({ + telemeter: o, + instrumenter: i, + polyfillJSON: s, + wrapGlobals: a, + scrub: u, + truncation: c, + }), + (t.exports = n); + }, + function (t, e, r) { + 'use strict'; + var n = r(9), + o = r(0), + i = r(14), + s = r(1), + a = r(18), + u = r(19), + c = r(2), + l = r(22), + p = r(25), + f = r(26), + h = r(27), + d = r(3); + function m(t, e) { + (this.options = o.handleOptions(x, t, null, s)), + (this.options._configuredOptions = t); + var r = this.components.telemeter, + a = this.components.instrumenter, + d = this.components.polyfillJSON; + (this.wrapGlobals = this.components.wrapGlobals), + (this.scrub = this.components.scrub); + var m = this.components.truncation, + g = new u(m), + v = new i(this.options, g, c, m); + r && (this.telemeter = new r(this.options)), + (this.client = + e || new n(this.options, v, s, this.telemeter, 'browser')); + var y = b(), + w = 'undefined' != typeof document && document; + (this.isChrome = y.chrome && y.chrome.runtime), + (this.anonymousErrorsPending = 0), + (function (t, e, r) { + t.addTransform(l.handleDomException) + .addTransform(l.handleItemWithError) + .addTransform(l.ensureItemHasSomethingToSay) + .addTransform(l.addBaseInfo) + .addTransform(l.addRequestInfo(r)) + .addTransform(l.addClientInfo(r)) + .addTransform(l.addPluginInfo(r)) + .addTransform(l.addBody) + .addTransform(p.addMessageWithError) + .addTransform(p.addTelemetryData) + .addTransform(p.addConfigToPayload) + .addTransform(l.addScrubber(e.scrub)) + .addTransform(p.userTransform(s)) + .addTransform(p.addConfiguredOptions) + .addTransform(p.addDiagnosticKeys) + .addTransform(p.itemToPayload); + })(this.client.notifier, this, y), + this.client.queue + .addPredicate(h.checkLevel) + .addPredicate(f.checkIgnore) + .addPredicate(h.userCheckIgnore(s)) + .addPredicate(h.urlIsNotBlockListed(s)) + .addPredicate(h.urlIsSafeListed(s)) + .addPredicate(h.messageIsIgnored(s)), + this.setupUnhandledCapture(), + a && + ((this.instrumenter = new a( + this.options, + this.client.telemeter, + this, + y, + w, + )), + this.instrumenter.instrument()), + o.setupJSON(d); + } + var g = null; + function v(t) { + var e = 'Rollbar is not initialized'; + s.error(e), t && t(new Error(e)); + } + function y(t) { + for (var e = 0, r = t.length; e < r; ++e) + if (o.isFunction(t[e])) return t[e]; + } + function b() { + return ( + ('undefined' != typeof window && window) || + ('undefined' != typeof self && self) + ); + } + (m.init = function (t, e) { + return g ? g.global(t).configure(t) : (g = new m(t, e)); + }), + (m.prototype.components = {}), + (m.setComponents = function (t) { + m.prototype.components = t; + }), + (m.prototype.global = function (t) { + return this.client.global(t), this; + }), + (m.global = function (t) { + if (g) return g.global(t); + v(); + }), + (m.prototype.configure = function (t, e) { + var r = this.options, + n = {}; + return ( + e && (n = { payload: e }), + (this.options = o.handleOptions(r, t, n, s)), + (this.options._configuredOptions = o.handleOptions( + r._configuredOptions, + t, + n, + )), + this.client.configure(this.options, e), + this.instrumenter && this.instrumenter.configure(this.options), + this.setupUnhandledCapture(), + this + ); + }), + (m.configure = function (t, e) { + if (g) return g.configure(t, e); + v(); + }), + (m.prototype.lastError = function () { + return this.client.lastError; + }), + (m.lastError = function () { + if (g) return g.lastError(); + v(); + }), + (m.prototype.log = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.log(t), { uuid: e }; + }), + (m.log = function () { + if (g) return g.log.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.debug = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.debug(t), { uuid: e }; + }), + (m.debug = function () { + if (g) return g.debug.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.info = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.info(t), { uuid: e }; + }), + (m.info = function () { + if (g) return g.info.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.warn = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.warn(t), { uuid: e }; + }), + (m.warn = function () { + if (g) return g.warn.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.warning = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.warning(t), { uuid: e }; + }), + (m.warning = function () { + if (g) return g.warning.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.error = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.error(t), { uuid: e }; + }), + (m.error = function () { + if (g) return g.error.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.critical = function () { + var t = this._createItem(arguments), + e = t.uuid; + return this.client.critical(t), { uuid: e }; + }), + (m.critical = function () { + if (g) return g.critical.apply(g, arguments); + var t = y(arguments); + v(t); + }), + (m.prototype.buildJsonPayload = function (t) { + return this.client.buildJsonPayload(t); + }), + (m.buildJsonPayload = function () { + if (g) return g.buildJsonPayload.apply(g, arguments); + v(); + }), + (m.prototype.sendJsonPayload = function (t) { + return this.client.sendJsonPayload(t); + }), + (m.sendJsonPayload = function () { + if (g) return g.sendJsonPayload.apply(g, arguments); + v(); + }), + (m.prototype.setupUnhandledCapture = function () { + var t = b(); + this.unhandledExceptionsInitialized || + ((this.options.captureUncaught || + this.options.handleUncaughtExceptions) && + (a.captureUncaughtExceptions(t, this), + this.wrapGlobals && + this.options.wrapGlobalEventHandlers && + this.wrapGlobals(t, this), + (this.unhandledExceptionsInitialized = !0))), + this.unhandledRejectionsInitialized || + ((this.options.captureUnhandledRejections || + this.options.handleUnhandledRejections) && + (a.captureUnhandledRejections(t, this), + (this.unhandledRejectionsInitialized = !0))); + }), + (m.prototype.handleUncaughtException = function (t, e, r, n, i, s) { + if ( + this.options.captureUncaught || + this.options.handleUncaughtExceptions + ) { + if ( + this.options.inspectAnonymousErrors && + this.isChrome && + null === i && + '' === e + ) + return 'anonymous'; + var a, + u = o.makeUnhandledStackInfo( + t, + e, + r, + n, + i, + 'onerror', + 'uncaught exception', + d, + ); + o.isError(i) + ? ((a = this._createItem([t, i, s]))._unhandledStackInfo = u) + : o.isError(e) + ? ((a = this._createItem([t, e, s]))._unhandledStackInfo = u) + : ((a = this._createItem([t, s])).stackInfo = u), + (a.level = this.options.uncaughtErrorLevel), + (a._isUncaught = !0), + this.client.log(a); + } + }), + (m.prototype.handleAnonymousErrors = function () { + if (this.options.inspectAnonymousErrors && this.isChrome) { + var t = this; + try { + Error.prepareStackTrace = function (e, r) { + if ( + t.options.inspectAnonymousErrors && + t.anonymousErrorsPending + ) { + if (((t.anonymousErrorsPending -= 1), !e)) return; + (e._isAnonymous = !0), + t.handleUncaughtException(e.message, null, null, null, e); + } + return e.stack; + }; + } catch (t) { + (this.options.inspectAnonymousErrors = !1), + this.error('anonymous error handler failed', t); + } + } + }), + (m.prototype.handleUnhandledRejection = function (t, e) { + if ( + this.options.captureUnhandledRejections || + this.options.handleUnhandledRejections + ) { + var r = 'unhandled rejection was null or undefined!'; + if (t) + if (t.message) r = t.message; + else { + var n = o.stringify(t); + n.value && (r = n.value); + } + var i, + s = (t && t._rollbarContext) || (e && e._rollbarContext); + o.isError(t) + ? (i = this._createItem([r, t, s])) + : ((i = this._createItem([r, t, s])).stackInfo = + o.makeUnhandledStackInfo( + r, + '', + 0, + 0, + null, + 'unhandledrejection', + '', + d, + )), + (i.level = this.options.uncaughtErrorLevel), + (i._isUncaught = !0), + (i._originalArgs = i._originalArgs || []), + i._originalArgs.push(e), + this.client.log(i); + } + }), + (m.prototype.wrap = function (t, e, r) { + try { + var n; + if ( + ((n = o.isFunction(e) + ? e + : function () { + return e || {}; + }), + !o.isFunction(t)) + ) + return t; + if (t._isWrap) return t; + if ( + !t._rollbar_wrapped && + ((t._rollbar_wrapped = function () { + r && o.isFunction(r) && r.apply(this, arguments); + try { + return t.apply(this, arguments); + } catch (r) { + var e = r; + throw ( + (e && + window._rollbarWrappedError !== e && + (o.isType(e, 'string') && (e = new String(e)), + (e._rollbarContext = n() || {}), + (e._rollbarContext._wrappedSource = t.toString()), + (window._rollbarWrappedError = e)), + e) + ); + } + }), + (t._rollbar_wrapped._isWrap = !0), + t.hasOwnProperty) + ) + for (var i in t) + t.hasOwnProperty(i) && + '_rollbar_wrapped' !== i && + (t._rollbar_wrapped[i] = t[i]); + return t._rollbar_wrapped; + } catch (e) { + return t; + } + }), + (m.wrap = function (t, e) { + if (g) return g.wrap(t, e); + v(); + }), + (m.prototype.captureEvent = function () { + var t = o.createTelemetryEvent(arguments); + return this.client.captureEvent(t.type, t.metadata, t.level); + }), + (m.captureEvent = function () { + if (g) return g.captureEvent.apply(g, arguments); + v(); + }), + (m.prototype.captureDomContentLoaded = function (t, e) { + return e || (e = new Date()), this.client.captureDomContentLoaded(e); + }), + (m.prototype.captureLoad = function (t, e) { + return e || (e = new Date()), this.client.captureLoad(e); + }), + (m.prototype.loadFull = function () { + s.info( + 'Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.', + ); + }), + (m.prototype._createItem = function (t) { + return o.createItem(t, s, this); + }); + var w = r(28), + _ = r(29), + x = { + version: w.version, + scrubFields: _.scrubFields, + logLevel: w.logLevel, + reportLevel: w.reportLevel, + uncaughtErrorLevel: w.uncaughtErrorLevel, + endpoint: w.endpoint, + verbose: !1, + enabled: !0, + transmit: !0, + sendConfig: !1, + includeItemsInTelemetry: !0, + captureIp: !0, + inspectAnonymousErrors: !0, + ignoreDuplicateErrors: !0, + wrapGlobalEventHandlers: !1, + }; + t.exports = m; + }, + function (t, e, r) { + 'use strict'; + var n = r(10), + o = r(12), + i = r(13), + s = r(0); + function a(t, e, r, n, l) { + (this.options = s.merge(t)), + (this.logger = r), + a.rateLimiter.configureGlobal(this.options), + a.rateLimiter.setPlatformOptions(l, this.options), + (this.api = e), + (this.queue = new o(a.rateLimiter, e, r, this.options)); + var p = this.options.tracer || null; + c(p) + ? ((this.tracer = p), + (this.options.tracer = 'opentracing-tracer-enabled'), + (this.options._configuredOptions.tracer = + 'opentracing-tracer-enabled')) + : (this.tracer = null), + (this.notifier = new i(this.queue, this.options)), + (this.telemeter = n), + u(t), + (this.lastError = null), + (this.lastErrorHash = 'none'); + } + function u(t) { + t.stackTraceLimit && (Error.stackTraceLimit = t.stackTraceLimit); + } + function c(t) { + if (!t) return !1; + if (!t.scope || 'function' != typeof t.scope) return !1; + var e = t.scope(); + return !(!e || !e.active || 'function' != typeof e.active); + } + (a.rateLimiter = new n({ maxItems: 0, itemsPerMinute: 60 })), + (a.prototype.global = function (t) { + return a.rateLimiter.configureGlobal(t), this; + }), + (a.prototype.configure = function (t, e) { + var r = this.options, + n = {}; + e && (n = { payload: e }), (this.options = s.merge(r, t, n)); + var o = this.options.tracer || null; + return ( + c(o) + ? ((this.tracer = o), + (this.options.tracer = 'opentracing-tracer-enabled'), + (this.options._configuredOptions.tracer = + 'opentracing-tracer-enabled')) + : (this.tracer = null), + this.notifier && this.notifier.configure(this.options), + this.telemeter && this.telemeter.configure(this.options), + u(t), + this.global(this.options), + c(t.tracer) && (this.tracer = t.tracer), + this + ); + }), + (a.prototype.log = function (t) { + var e = this._defaultLogLevel(); + return this._log(e, t); + }), + (a.prototype.debug = function (t) { + this._log('debug', t); + }), + (a.prototype.info = function (t) { + this._log('info', t); + }), + (a.prototype.warn = function (t) { + this._log('warning', t); + }), + (a.prototype.warning = function (t) { + this._log('warning', t); + }), + (a.prototype.error = function (t) { + this._log('error', t); + }), + (a.prototype.critical = function (t) { + this._log('critical', t); + }), + (a.prototype.wait = function (t) { + this.queue.wait(t); + }), + (a.prototype.captureEvent = function (t, e, r) { + return this.telemeter && this.telemeter.captureEvent(t, e, r); + }), + (a.prototype.captureDomContentLoaded = function (t) { + return this.telemeter && this.telemeter.captureDomContentLoaded(t); + }), + (a.prototype.captureLoad = function (t) { + return this.telemeter && this.telemeter.captureLoad(t); + }), + (a.prototype.buildJsonPayload = function (t) { + return this.api.buildJsonPayload(t); + }), + (a.prototype.sendJsonPayload = function (t) { + this.api.postJsonPayload(t); + }), + (a.prototype._log = function (t, e) { + var r; + if ( + (e.callback && ((r = e.callback), delete e.callback), + this.options.ignoreDuplicateErrors && this._sameAsLastError(e)) + ) { + if (r) { + var n = new Error('ignored identical item'); + (n.item = e), r(n); + } + } else + try { + this._addTracingInfo(e), + (e.level = e.level || t), + this.telemeter && this.telemeter._captureRollbarItem(e), + (e.telemetryEvents = + (this.telemeter && this.telemeter.copyEvents()) || []), + this.notifier.log(e, r); + } catch (t) { + r && r(t), this.logger.error(t); + } + }), + (a.prototype._defaultLogLevel = function () { + return this.options.logLevel || 'debug'; + }), + (a.prototype._sameAsLastError = function (t) { + if (!t._isUncaught) return !1; + var e = (function (t) { + var e = t.message || '', + r = (t.err || {}).stack || String(t.err); + return e + '::' + r; + })(t); + return ( + this.lastErrorHash === e || + ((this.lastError = t.err), (this.lastErrorHash = e), !1) + ); + }), + (a.prototype._addTracingInfo = function (t) { + if (this.tracer) { + var e = this.tracer.scope().active(); + if ( + (function (t) { + if (!t || !t.context || 'function' != typeof t.context) return !1; + var e = t.context(); + if ( + !e || + !e.toSpanId || + !e.toTraceId || + 'function' != typeof e.toSpanId || + 'function' != typeof e.toTraceId + ) + return !1; + return !0; + })(e) + ) { + e.setTag('rollbar.error_uuid', t.uuid), + e.setTag('rollbar.has_error', !0), + e.setTag('error', !0), + e.setTag( + 'rollbar.item_url', + 'https://rollbar.com/item/uuid/?uuid=' + t.uuid, + ), + e.setTag( + 'rollbar.occurrence_url', + 'https://rollbar.com/occurrence/uuid/?uuid=' + t.uuid, + ); + var r = e.context().toSpanId(), + n = e.context().toTraceId(); + t.custom + ? ((t.custom.opentracing_span_id = r), + (t.custom.opentracing_trace_id = n)) + : (t.custom = { + opentracing_span_id: r, + opentracing_trace_id: n, + }); + } + } + }), + (t.exports = a); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t) { + (this.startTime = n.now()), + (this.counter = 0), + (this.perMinCounter = 0), + (this.platform = null), + (this.platformOptions = {}), + this.configureGlobal(t); + } + function i(t, e, r) { + return !t.ignoreRateLimit && e >= 1 && r > e; + } + function s(t, e, r, n, o, i, s) { + var a = null; + return ( + r && (r = new Error(r)), + r || + n || + (a = (function (t, e, r, n, o) { + var i, + s = e.environment || (e.payload && e.payload.environment); + i = o + ? 'item per minute limit reached, ignoring errors until timeout' + : 'maxItems has been hit, ignoring errors until reset.'; + var a = { + body: { + message: { body: i, extra: { maxItems: r, itemsPerMinute: n } }, + }, + language: 'javascript', + environment: s, + notifier: { + version: (e.notifier && e.notifier.version) || e.version, + }, + }; + 'browser' === t + ? ((a.platform = 'browser'), + (a.framework = 'browser-js'), + (a.notifier.name = 'rollbar-browser-js')) + : 'server' === t + ? ((a.framework = e.framework || 'node-js'), + (a.notifier.name = e.notifier.name)) + : 'react-native' === t && + ((a.framework = e.framework || 'react-native'), + (a.notifier.name = e.notifier.name)); + return a; + })(t, e, o, i, s)), + { error: r, shouldSend: n, payload: a } + ); + } + (o.globalSettings = { + startTime: n.now(), + maxItems: void 0, + itemsPerMinute: void 0, + }), + (o.prototype.configureGlobal = function (t) { + void 0 !== t.startTime && (o.globalSettings.startTime = t.startTime), + void 0 !== t.maxItems && (o.globalSettings.maxItems = t.maxItems), + void 0 !== t.itemsPerMinute && + (o.globalSettings.itemsPerMinute = t.itemsPerMinute); + }), + (o.prototype.shouldSend = function (t, e) { + var r = (e = e || n.now()) - this.startTime; + (r < 0 || r >= 6e4) && ((this.startTime = e), (this.perMinCounter = 0)); + var a = o.globalSettings.maxItems, + u = o.globalSettings.itemsPerMinute; + if (i(t, a, this.counter)) + return s( + this.platform, + this.platformOptions, + a + ' max items reached', + !1, + ); + if (i(t, u, this.perMinCounter)) + return s( + this.platform, + this.platformOptions, + u + ' items per minute reached', + !1, + ); + this.counter++, this.perMinCounter++; + var c = !i(t, a, this.counter), + l = c; + return ( + (c = c && !i(t, u, this.perMinCounter)), + s(this.platform, this.platformOptions, null, c, a, u, l) + ); + }), + (o.prototype.setPlatformOptions = function (t, e) { + (this.platform = t), (this.platformOptions = e); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = Object.prototype.hasOwnProperty, + o = Object.prototype.toString, + i = function (t) { + if (!t || '[object Object]' !== o.call(t)) return !1; + var e, + r = n.call(t, 'constructor'), + i = + t.constructor && + t.constructor.prototype && + n.call(t.constructor.prototype, 'isPrototypeOf'); + if (t.constructor && !r && !i) return !1; + for (e in t); + return void 0 === e || n.call(t, e); + }; + t.exports = function t() { + var e, + r, + n, + o, + s, + a = {}, + u = null, + c = arguments.length; + for (e = 0; e < c; e++) + if (null != (u = arguments[e])) + for (s in u) + (r = a[s]), + a !== (n = u[s]) && + (n && i(n) + ? ((o = r && i(r) ? r : {}), (a[s] = t(o, n))) + : void 0 !== n && (a[s] = n)); + return a; + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e, r, n) { + (this.rateLimiter = t), + (this.api = e), + (this.logger = r), + (this.options = n), + (this.predicates = []), + (this.pendingItems = []), + (this.pendingRequests = []), + (this.retryQueue = []), + (this.retryHandle = null), + (this.waitCallback = null), + (this.waitIntervalID = null); + } + (o.prototype.configure = function (t) { + this.api && this.api.configure(t); + var e = this.options; + return (this.options = n.merge(e, t)), this; + }), + (o.prototype.addPredicate = function (t) { + return n.isFunction(t) && this.predicates.push(t), this; + }), + (o.prototype.addPendingItem = function (t) { + this.pendingItems.push(t); + }), + (o.prototype.removePendingItem = function (t) { + var e = this.pendingItems.indexOf(t); + -1 !== e && this.pendingItems.splice(e, 1); + }), + (o.prototype.addItem = function (t, e, r, o) { + (e && n.isFunction(e)) || (e = function () {}); + var i = this._applyPredicates(t); + if (i.stop) return this.removePendingItem(o), void e(i.err); + if ( + (this._maybeLog(t, r), + this.removePendingItem(o), + this.options.transmit) + ) { + this.pendingRequests.push(t); + try { + this._makeApiRequest( + t, + function (r, n) { + this._dequeuePendingRequest(t), e(r, n); + }.bind(this), + ); + } catch (r) { + this._dequeuePendingRequest(t), e(r); + } + } else e(new Error('Transmit disabled')); + }), + (o.prototype.wait = function (t) { + n.isFunction(t) && + ((this.waitCallback = t), + this._maybeCallWait() || + (this.waitIntervalID && + (this.waitIntervalID = clearInterval(this.waitIntervalID)), + (this.waitIntervalID = setInterval( + function () { + this._maybeCallWait(); + }.bind(this), + 500, + )))); + }), + (o.prototype._applyPredicates = function (t) { + for (var e = null, r = 0, n = this.predicates.length; r < n; r++) + if (!(e = this.predicates[r](t, this.options)) || void 0 !== e.err) + return { stop: !0, err: e.err }; + return { stop: !1, err: null }; + }), + (o.prototype._makeApiRequest = function (t, e) { + var r = this.rateLimiter.shouldSend(t); + r.shouldSend + ? this.api.postItem( + t, + function (r, n) { + r ? this._maybeRetry(r, t, e) : e(r, n); + }.bind(this), + ) + : r.error + ? e(r.error) + : this.api.postItem(r.payload, e); + }); + var i = [ + 'ECONNRESET', + 'ENOTFOUND', + 'ESOCKETTIMEDOUT', + 'ETIMEDOUT', + 'ECONNREFUSED', + 'EHOSTUNREACH', + 'EPIPE', + 'EAI_AGAIN', + ]; + (o.prototype._maybeRetry = function (t, e, r) { + var o = !1; + if (this.options.retryInterval) { + for (var s = 0, a = i.length; s < a; s++) + if (t.code === i[s]) { + o = !0; + break; + } + o && + n.isFiniteNumber(this.options.maxRetries) && + ((e.retries = e.retries ? e.retries + 1 : 1), + e.retries > this.options.maxRetries && (o = !1)); + } + o ? this._retryApiRequest(e, r) : r(t); + }), + (o.prototype._retryApiRequest = function (t, e) { + this.retryQueue.push({ item: t, callback: e }), + this.retryHandle || + (this.retryHandle = setInterval( + function () { + for (; this.retryQueue.length; ) { + var t = this.retryQueue.shift(); + this._makeApiRequest(t.item, t.callback); + } + }.bind(this), + this.options.retryInterval, + )); + }), + (o.prototype._dequeuePendingRequest = function (t) { + var e = this.pendingRequests.indexOf(t); + -1 !== e && (this.pendingRequests.splice(e, 1), this._maybeCallWait()); + }), + (o.prototype._maybeLog = function (t, e) { + if (this.logger && this.options.verbose) { + var r = e; + if ( + (r = + (r = r || n.get(t, 'body.trace.exception.message')) || + n.get(t, 'body.trace_chain.0.exception.message')) + ) + return void this.logger.error(r); + (r = n.get(t, 'body.message.body')) && this.logger.log(r); + } + }), + (o.prototype._maybeCallWait = function () { + return ( + !( + !n.isFunction(this.waitCallback) || + 0 !== this.pendingItems.length || + 0 !== this.pendingRequests.length + ) && + (this.waitIntervalID && + (this.waitIntervalID = clearInterval(this.waitIntervalID)), + this.waitCallback(), + !0) + ); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e) { + (this.queue = t), + (this.options = e), + (this.transforms = []), + (this.diagnostic = {}); + } + (o.prototype.configure = function (t) { + this.queue && this.queue.configure(t); + var e = this.options; + return (this.options = n.merge(e, t)), this; + }), + (o.prototype.addTransform = function (t) { + return n.isFunction(t) && this.transforms.push(t), this; + }), + (o.prototype.log = function (t, e) { + if ( + ((e && n.isFunction(e)) || (e = function () {}), + !this.options.enabled) + ) + return e(new Error('Rollbar is not enabled')); + this.queue.addPendingItem(t); + var r = t.err; + this._applyTransforms( + t, + function (n, o) { + if (n) return this.queue.removePendingItem(t), e(n, null); + this.queue.addItem(o, e, r, t); + }.bind(this), + ); + }), + (o.prototype._applyTransforms = function (t, e) { + var r = -1, + n = this.transforms.length, + o = this.transforms, + i = this.options, + s = function (t, a) { + t ? e(t, null) : ++r !== n ? o[r](a, i, s) : e(null, a); + }; + s(null, t); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(15), + i = { + hostname: 'api.rollbar.com', + path: '/api/1/item/', + search: null, + version: '1', + protocol: 'https:', + port: 443, + }; + function s(t, e, r, n, o) { + (this.options = t), + (this.transport = e), + (this.url = r), + (this.truncation = n), + (this.jsonBackup = o), + (this.accessToken = t.accessToken), + (this.transportOptions = a(t, r)); + } + function a(t, e) { + return o.getTransportFromOptions(t, i, e); + } + (s.prototype.postItem = function (t, e) { + var r = o.transportOptions(this.transportOptions, 'POST'), + n = o.buildPayload(this.accessToken, t, this.jsonBackup), + i = this; + setTimeout(function () { + i.transport.post(i.accessToken, r, n, e); + }, 0); + }), + (s.prototype.buildJsonPayload = function (t, e) { + var r, + i = o.buildPayload(this.accessToken, t, this.jsonBackup); + return (r = this.truncation + ? this.truncation.truncate(i) + : n.stringify(i)).error + ? (e && e(r.error), null) + : r.value; + }), + (s.prototype.postJsonPayload = function (t, e) { + var r = o.transportOptions(this.transportOptions, 'POST'); + this.transport.postJsonPayload(this.accessToken, r, t, e); + }), + (s.prototype.configure = function (t) { + var e = this.oldOptions; + return ( + (this.options = n.merge(e, t)), + (this.transportOptions = a(this.options, this.url)), + void 0 !== this.options.accessToken && + (this.accessToken = this.options.accessToken), + this + ); + }), + (t.exports = s); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = { + buildPayload: function (t, e, r) { + if (!n.isType(e.context, 'string')) { + var o = n.stringify(e.context, r); + o.error + ? (e.context = "Error: could not serialize 'context'") + : (e.context = o.value || ''), + e.context.length > 255 && (e.context = e.context.substr(0, 255)); + } + return { access_token: t, data: e }; + }, + getTransportFromOptions: function (t, e, r) { + var n = e.hostname, + o = e.protocol, + i = e.port, + s = e.path, + a = e.search, + u = t.timeout, + c = (function (t) { + var e = + ('undefined' != typeof window && window) || + ('undefined' != typeof self && self), + r = t.defaultTransport || 'xhr'; + void 0 === e.fetch && (r = 'xhr'); + void 0 === e.XMLHttpRequest && (r = 'fetch'); + return r; + })(t), + l = t.proxy; + if (t.endpoint) { + var p = r.parse(t.endpoint); + (n = p.hostname), + (o = p.protocol), + (i = p.port), + (s = p.pathname), + (a = p.search); + } + return { + timeout: u, + hostname: n, + protocol: o, + port: i, + path: s, + search: a, + proxy: l, + transport: c, + }; + }, + transportOptions: function (t, e) { + var r = t.protocol || 'https:', + n = t.port || ('http:' === r ? 80 : 'https:' === r ? 443 : void 0), + o = t.hostname, + i = t.path, + s = t.timeout, + a = t.transport; + return ( + t.search && (i += t.search), + t.proxy && + ((i = r + '//' + o + i), + (o = t.proxy.host || t.proxy.hostname), + (n = t.proxy.port), + (r = t.proxy.protocol || r)), + { + timeout: s, + protocol: r, + hostname: o, + path: i, + port: n, + method: e, + transport: a, + } + ); + }, + appendPathToPath: function (t, e) { + var r = /\/$/.test(t), + n = /^\//.test(e); + return r && n ? (e = e.substring(1)) : r || n || (e = '/' + e), t + e; + }, + }; + }, + function (t, e) { + !(function (t) { + 'use strict'; + t.console || (t.console = {}); + for ( + var e, + r, + n = t.console, + o = function () {}, + i = ['memory'], + s = + 'assert,clear,count,debug,dir,dirxml,error,exception,group,groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn'.split( + ',', + ); + (e = i.pop()); + + ) + n[e] || (n[e] = {}); + for (; (r = s.pop()); ) n[r] || (n[r] = o); + })('undefined' == typeof window ? this : window); + }, + function (t, e, r) { + 'use strict'; + var n = { + ieVersion: function () { + if ('undefined' != typeof document) { + for ( + var t = 3, + e = document.createElement('div'), + r = e.getElementsByTagName('i'); + (e.innerHTML = + '\x3c!--[if gt IE ' + ++t + ']> 4 ? t : void 0; + } + }, + }; + t.exports = n; + }, + function (t, e, r) { + 'use strict'; + function n(t, e, r, n) { + t._rollbarWrappedError && + (n[4] || (n[4] = t._rollbarWrappedError), + n[5] || (n[5] = t._rollbarWrappedError._rollbarContext), + (t._rollbarWrappedError = null)); + var o = e.handleUncaughtException.apply(e, n); + r && r.apply(t, n), 'anonymous' === o && (e.anonymousErrorsPending += 1); + } + t.exports = { + captureUncaughtExceptions: function (t, e, r) { + if (t) { + var o; + if ('function' == typeof e._rollbarOldOnError) + o = e._rollbarOldOnError; + else if (t.onerror) { + for (o = t.onerror; o._rollbarOldOnError; ) + o = o._rollbarOldOnError; + e._rollbarOldOnError = o; + } + e.handleAnonymousErrors(); + var i = function () { + var r = Array.prototype.slice.call(arguments, 0); + n(t, e, o, r); + }; + r && (i._rollbarOldOnError = o), (t.onerror = i); + } + }, + captureUnhandledRejections: function (t, e, r) { + if (t) { + 'function' == typeof t._rollbarURH && + t._rollbarURH.belongsToShim && + t.removeEventListener('unhandledrejection', t._rollbarURH); + var n = function (t) { + var r, n, o; + try { + r = t.reason; + } catch (t) { + r = void 0; + } + try { + n = t.promise; + } catch (t) { + n = '[unhandledrejection] error getting `promise` from event'; + } + try { + (o = t.detail), !r && o && ((r = o.reason), (n = o.promise)); + } catch (t) {} + r || (r = '[unhandledrejection] error getting `reason` from event'), + e && + e.handleUnhandledRejection && + e.handleUnhandledRejection(r, n); + }; + (n.belongsToShim = r), + (t._rollbarURH = n), + t.addEventListener('unhandledrejection', n); + } + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(20), + i = r(21); + function s(t) { + this.truncation = t; + } + (s.prototype.get = function (t, e, r, o, i) { + (o && n.isFunction(o)) || (o = function () {}), + n.addParamsAndAccessTokenToPath(t, e, r); + var s = n.formatUrl(e); + this._makeZoneRequest(t, s, 'GET', null, o, i, e.timeout, e.transport); + }), + (s.prototype.post = function (t, e, r, o, i) { + if (((o && n.isFunction(o)) || (o = function () {}), !r)) + return o(new Error('Cannot send empty request')); + var s; + if ( + (s = this.truncation ? this.truncation.truncate(r) : n.stringify(r)) + .error + ) + return o(s.error); + var a = s.value, + u = n.formatUrl(e); + this._makeZoneRequest(t, u, 'POST', a, o, i, e.timeout, e.transport); + }), + (s.prototype.postJsonPayload = function (t, e, r, o, i) { + (o && n.isFunction(o)) || (o = function () {}); + var s = n.formatUrl(e); + this._makeZoneRequest(t, s, 'POST', r, o, i, e.timeout, e.transport); + }), + (s.prototype._makeZoneRequest = function () { + var t = + ('undefined' != typeof window && window) || + ('undefined' != typeof self && self), + e = t && t.Zone && t.Zone.current, + r = Array.prototype.slice.call(arguments); + if (e && 'angular' === e._name) { + var n = e._parent; + n.run(function () { + this._makeRequest.apply(void 0, r); + }); + } else this._makeRequest.apply(void 0, r); + }), + (s.prototype._makeRequest = function (t, e, r, n, s, a, u, c) { + if ('undefined' != typeof RollbarProxy) + return (function (t, e) { + new RollbarProxy().sendJsonPayload( + t, + function (t) {}, + function (t) { + e(new Error(t)); + }, + ); + })(n, s); + 'fetch' === c ? o(t, e, r, n, s, u) : i(t, e, r, n, s, a, u); + }), + (t.exports = s); + }, + function (t, e, r) { + 'use strict'; + var n = r(1), + o = r(0); + t.exports = function (t, e, r, i, s, a) { + var u, c; + o.isFiniteNumber(a) && + ((u = new AbortController()), (c = setTimeout(() => u.abort(), a))), + fetch(e, { + method: r, + headers: { + 'Content-Type': 'application/json', + 'X-Rollbar-Access-Token': t, + signal: u && u.signal, + }, + body: i, + }) + .then((t) => (c && clearTimeout(c), t.json())) + .then((t) => { + s(null, t); + }) + .catch((t) => { + n.error(t.message), s(t); + }); + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(1); + function i(t, e) { + var r = new Error(t); + return (r.code = e || 'ENOTFOUND'), r; + } + t.exports = function (t, e, r, s, a, u, c) { + var l; + if ( + !(l = u + ? u() + : (function () { + var t, + e, + r = [ + function () { + return new XMLHttpRequest(); + }, + function () { + return new ActiveXObject('Msxml2.XMLHTTP'); + }, + function () { + return new ActiveXObject('Msxml3.XMLHTTP'); + }, + function () { + return new ActiveXObject('Microsoft.XMLHTTP'); + }, + ], + n = r.length; + for (e = 0; e < n; e++) + try { + t = r[e](); + break; + } catch (t) {} + return t; + })()) + ) + return a(new Error('No way to send a request')); + try { + try { + var p = function () { + try { + if (p && 4 === l.readyState) { + p = void 0; + var t = n.jsonParse(l.responseText); + if ((s = l) && s.status && 200 === s.status) + return void a(t.error, t.value); + if ( + (function (t) { + return ( + t && + n.isType(t.status, 'number') && + t.status >= 400 && + t.status < 600 + ); + })(l) + ) { + if (403 === l.status) { + var e = t.value && t.value.message; + o.error(e); + } + a(new Error(String(l.status))); + } else { + a( + i( + 'XHR response had no status code (likely connection failure)', + ), + ); + } + } + } catch (t) { + var r; + (r = t && t.stack ? t : new Error(t)), a(r); + } + var s; + }; + l.open(r, e, !0), + l.setRequestHeader && + (l.setRequestHeader('Content-Type', 'application/json'), + l.setRequestHeader('X-Rollbar-Access-Token', t)), + n.isFiniteNumber(c) && (l.timeout = c), + (l.onreadystatechange = p), + l.send(s); + } catch (t) { + if ('undefined' != typeof XDomainRequest) { + if (!window || !window.location) + return a( + new Error( + 'No window available during request, unknown environment', + ), + ); + 'http:' === window.location.href.substring(0, 5) && + 'https' === e.substring(0, 5) && + (e = 'http' + e.substring(5)); + var f = new XDomainRequest(); + (f.onprogress = function () {}), + (f.ontimeout = function () { + a(i('Request timed out', 'ETIMEDOUT')); + }), + (f.onerror = function () { + a(new Error('Error during request')); + }), + (f.onload = function () { + var t = n.jsonParse(f.responseText); + a(t.error, t.value); + }), + f.open(r, e, !0), + f.send(s); + } else a(new Error('Cannot find a method to transport a request')); + } + } catch (t) { + a(t); + } + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(3), + i = r(1); + function s(t, e, r) { + var o = t.message, + i = t.custom; + o || (o = 'Item sent with null or missing arguments.'); + var s = { body: o }; + i && (s.extra = n.merge(i)), + n.set(t, 'data.body', { message: s }), + r(null, t); + } + function a(t) { + var e = t.stackInfo.stack; + return ( + e && + 0 === e.length && + t._unhandledStackInfo && + t._unhandledStackInfo.stack && + (e = t._unhandledStackInfo.stack), + e + ); + } + function u(t, e, r) { + var i = t && t.data.description, + s = t && t.custom, + u = a(t), + l = o.guessErrorClass(e.message), + p = { exception: { class: c(e, l[0], r), message: l[1] } }; + if ((i && (p.exception.description = i), u)) { + var f, h, d, m, g, v, y, b; + for ( + 0 === u.length && + ((p.exception.stack = e.rawStack), + (p.exception.raw = String(e.rawException))), + p.frames = [], + y = 0; + y < u.length; + ++y + ) + (h = { + filename: (f = u[y]).url ? n.sanitizeUrl(f.url) : '(unknown)', + lineno: f.line || null, + method: f.func && '?' !== f.func ? f.func : '[anonymous]', + colno: f.column, + }), + r.sendFrameUrl && (h.url = f.url), + (h.method && + h.method.endsWith && + h.method.endsWith('_rollbar_wrapped')) || + ((d = m = g = null), + (v = f.context ? f.context.length : 0) && + ((b = Math.floor(v / 2)), + (m = f.context.slice(0, b)), + (d = f.context[b]), + (g = f.context.slice(b))), + d && (h.code = d), + (m || g) && + ((h.context = {}), + m && m.length && (h.context.pre = m), + g && g.length && (h.context.post = g)), + f.args && (h.args = f.args), + p.frames.push(h)); + p.frames.reverse(), s && (p.extra = n.merge(s)); + } + return p; + } + function c(t, e, r) { + return t.name ? t.name : r.guessErrorClass ? e : '(unknown)'; + } + t.exports = { + handleDomException: function (t, e, r) { + if (t.err && 'DOMException' === o.Stack(t.err).name) { + var n = new Error(); + (n.name = t.err.name), + (n.message = t.err.message), + (n.stack = t.err.stack), + (n.nested = t.err), + (t.err = n); + } + r(null, t); + }, + handleItemWithError: function (t, e, r) { + if (((t.data = t.data || {}), t.err)) + try { + (t.stackInfo = + t.err._savedStackTrace || o.parse(t.err, t.skipFrames)), + e.addErrorContext && + (function (t) { + var e = [], + r = t.err; + e.push(r); + for (; r.nested || r.cause; ) + (r = r.nested || r.cause), e.push(r); + n.addErrorContext(t, e); + })(t); + } catch (e) { + i.error('Error while parsing the error object.', e); + try { + t.message = + t.err.message || + t.err.description || + t.message || + String(t.err); + } catch (e) { + t.message = String(t.err) || String(e); + } + delete t.err; + } + r(null, t); + }, + ensureItemHasSomethingToSay: function (t, e, r) { + t.message || + t.stackInfo || + t.custom || + r(new Error('No message, stack info, or custom data'), null), + r(null, t); + }, + addBaseInfo: function (t, e, r) { + var o = (e.payload && e.payload.environment) || e.environment; + (t.data = n.merge(t.data, { + environment: o, + level: t.level, + endpoint: e.endpoint, + platform: 'browser', + framework: 'browser-js', + language: 'javascript', + server: {}, + uuid: t.uuid, + notifier: { name: 'rollbar-browser-js', version: e.version }, + custom: t.custom, + })), + r(null, t); + }, + addRequestInfo: function (t) { + return function (e, r, o) { + var i = {}; + t && + t.location && + ((i.url = t.location.href), (i.query_string = t.location.search)); + var s = '$remote_ip'; + r.captureIp ? !0 !== r.captureIp && (s += '_anonymize') : (s = null), + s && (i.user_ip = s), + Object.keys(i).length > 0 && n.set(e, 'data.request', i), + o(null, e); + }; + }, + addClientInfo: function (t) { + return function (e, r, o) { + if (!t) return o(null, e); + var i = t.navigator || {}, + s = t.screen || {}; + n.set(e, 'data.client', { + runtime_ms: e.timestamp - t._rollbarStartTime, + timestamp: Math.round(e.timestamp / 1e3), + javascript: { + browser: i.userAgent, + language: i.language, + cookie_enabled: i.cookieEnabled, + screen: { width: s.width, height: s.height }, + }, + }), + o(null, e); + }; + }, + addPluginInfo: function (t) { + return function (e, r, o) { + if (!t || !t.navigator) return o(null, e); + for ( + var i, s = [], a = t.navigator.plugins || [], u = 0, c = a.length; + u < c; + ++u + ) + (i = a[u]), s.push({ name: i.name, description: i.description }); + n.set(e, 'data.client.javascript.plugins', s), o(null, e); + }; + }, + addBody: function (t, e, r) { + t.stackInfo + ? t.stackInfo.traceChain + ? (function (t, e, r) { + for ( + var o = t.stackInfo.traceChain, i = [], s = o.length, a = 0; + a < s; + a++ + ) { + var c = u(t, o[a], e); + i.push(c); + } + n.set(t, 'data.body', { trace_chain: i }), r(null, t); + })(t, e, r) + : (function (t, e, r) { + if (a(t)) { + var i = u(t, t.stackInfo, e); + n.set(t, 'data.body', { trace: i }), r(null, t); + } else { + var l = t.stackInfo, + p = o.guessErrorClass(l.message), + f = c(l, p[0], e), + h = p[1]; + (t.message = f + ': ' + h), s(t, e, r); + } + })(t, e, r) + : s(t, e, r); + }, + addScrubber: function (t) { + return function (e, r, n) { + if (t) { + var o = r.scrubFields || [], + i = r.scrubPaths || []; + e.data = t(e.data, o, i); + } + n(null, e); + }; + }, + }; + }, + function (t, e, r) { + var n, o, i; + !(function (s, a) { + 'use strict'; + (o = [r(24)]), + void 0 === + (i = + 'function' == + typeof (n = function (t) { + var e = /(^|@)\S+:\d+/, + r = /^\s*at .*(\S+:\d+|\(native\))/m, + n = /^(eval@)?(\[native code])?$/; + return { + parse: function (t) { + if ( + void 0 !== t.stacktrace || + void 0 !== t['opera#sourceloc'] + ) + return this.parseOpera(t); + if (t.stack && t.stack.match(r)) return this.parseV8OrIE(t); + if (t.stack) return this.parseFFOrSafari(t); + throw new Error('Cannot parse given Error object'); + }, + extractLocation: function (t) { + if (-1 === t.indexOf(':')) return [t]; + var e = /(.+?)(?::(\d+))?(?::(\d+))?$/.exec( + t.replace(/[()]/g, ''), + ); + return [e[1], e[2] || void 0, e[3] || void 0]; + }, + parseV8OrIE: function (e) { + return e.stack + .split('\n') + .filter(function (t) { + return !!t.match(r); + }, this) + .map(function (e) { + e.indexOf('(eval ') > -1 && + (e = e + .replace(/eval code/g, 'eval') + .replace(/(\(eval at [^()]*)|(,.*$)/g, '')); + var r = e + .replace(/^\s+/, '') + .replace(/\(eval code/g, '(') + .replace(/^.*?\s+/, ''), + n = r.match(/ (\(.+\)$)/); + r = n ? r.replace(n[0], '') : r; + var o = this.extractLocation(n ? n[1] : r), + i = (n && r) || void 0, + s = + ['eval', ''].indexOf(o[0]) > -1 + ? void 0 + : o[0]; + return new t({ + functionName: i, + fileName: s, + lineNumber: o[1], + columnNumber: o[2], + source: e, + }); + }, this); + }, + parseFFOrSafari: function (e) { + return e.stack + .split('\n') + .filter(function (t) { + return !t.match(n); + }, this) + .map(function (e) { + if ( + (e.indexOf(' > eval') > -1 && + (e = e.replace( + / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, + ':$1', + )), + -1 === e.indexOf('@') && -1 === e.indexOf(':')) + ) + return new t({ functionName: e }); + var r = /((.*".+"[^@]*)?[^@]*)(?:@)/, + n = e.match(r), + o = n && n[1] ? n[1] : void 0, + i = this.extractLocation(e.replace(r, '')); + return new t({ + functionName: o, + fileName: i[0], + lineNumber: i[1], + columnNumber: i[2], + source: e, + }); + }, this); + }, + parseOpera: function (t) { + return !t.stacktrace || + (t.message.indexOf('\n') > -1 && + t.message.split('\n').length > + t.stacktrace.split('\n').length) + ? this.parseOpera9(t) + : t.stack + ? this.parseOpera11(t) + : this.parseOpera10(t); + }, + parseOpera9: function (e) { + for ( + var r = /Line (\d+).*script (?:in )?(\S+)/i, + n = e.message.split('\n'), + o = [], + i = 2, + s = n.length; + i < s; + i += 2 + ) { + var a = r.exec(n[i]); + a && + o.push( + new t({ + fileName: a[2], + lineNumber: a[1], + source: n[i], + }), + ); + } + return o; + }, + parseOpera10: function (e) { + for ( + var r = + /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, + n = e.stacktrace.split('\n'), + o = [], + i = 0, + s = n.length; + i < s; + i += 2 + ) { + var a = r.exec(n[i]); + a && + o.push( + new t({ + functionName: a[3] || void 0, + fileName: a[2], + lineNumber: a[1], + source: n[i], + }), + ); + } + return o; + }, + parseOpera11: function (r) { + return r.stack + .split('\n') + .filter(function (t) { + return !!t.match(e) && !t.match(/^Error created at/); + }, this) + .map(function (e) { + var r, + n = e.split('@'), + o = this.extractLocation(n.pop()), + i = n.shift() || '', + s = + i + .replace(//, '$2') + .replace(/\([^)]*\)/g, '') || void 0; + i.match(/\(([^)]*)\)/) && + (r = i.replace(/^[^(]+\(([^)]*)\)$/, '$1')); + var a = + void 0 === r || '[arguments not available]' === r + ? void 0 + : r.split(','); + return new t({ + functionName: s, + args: a, + fileName: o[0], + lineNumber: o[1], + columnNumber: o[2], + source: e, + }); + }, this); + }, + }; + }) + ? n.apply(e, o) + : n) || (t.exports = i); + })(); + }, + function (t, e, r) { + var n, o, i; + !(function (r, s) { + 'use strict'; + (o = []), + void 0 === + (i = + 'function' == + typeof (n = function () { + function t(t) { + return t.charAt(0).toUpperCase() + t.substring(1); + } + function e(t) { + return function () { + return this[t]; + }; + } + var r = ['isConstructor', 'isEval', 'isNative', 'isToplevel'], + n = ['columnNumber', 'lineNumber'], + o = ['fileName', 'functionName', 'source'], + i = r.concat(n, o, ['args'], ['evalOrigin']); + function s(e) { + if (e) + for (var r = 0; r < i.length; r++) + void 0 !== e[i[r]] && this['set' + t(i[r])](e[i[r]]); + } + (s.prototype = { + 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; + }, + getEvalOrigin: function () { + return this.evalOrigin; + }, + setEvalOrigin: function (t) { + if (t instanceof s) this.evalOrigin = t; + else { + if (!(t instanceof Object)) + throw new TypeError( + 'Eval Origin must be an Object or StackFrame', + ); + this.evalOrigin = new s(t); + } + }, + toString: function () { + var t = this.getFileName() || '', + e = this.getLineNumber() || '', + r = this.getColumnNumber() || '', + n = this.getFunctionName() || ''; + return this.getIsEval() + ? t + ? '[eval] (' + t + ':' + e + ':' + r + ')' + : '[eval]:' + e + ':' + r + : n + ? n + ' (' + t + ':' + e + ':' + r + ')' + : t + ':' + e + ':' + r; + }, + }), + (s.fromString = function (t) { + var e = t.indexOf('('), + r = t.lastIndexOf(')'), + n = t.substring(0, e), + o = t.substring(e + 1, r).split(','), + i = t.substring(r + 1); + if (0 === i.indexOf('@')) + var a = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(i, ''), + u = a[1], + c = a[2], + l = a[3]; + return new s({ + functionName: n, + args: o || void 0, + fileName: u, + lineNumber: c || void 0, + columnNumber: l || void 0, + }); + }); + for (var a = 0; a < r.length; a++) + (s.prototype['get' + t(r[a])] = e(r[a])), + (s.prototype['set' + t(r[a])] = (function (t) { + return function (e) { + this[t] = Boolean(e); + }; + })(r[a])); + for (var u = 0; u < n.length; u++) + (s.prototype['get' + t(n[u])] = e(n[u])), + (s.prototype['set' + t(n[u])] = (function (t) { + return function (e) { + if (((r = e), isNaN(parseFloat(r)) || !isFinite(r))) + throw new TypeError(t + ' must be a Number'); + var r; + this[t] = Number(e); + }; + })(n[u])); + for (var c = 0; c < o.length; c++) + (s.prototype['get' + t(o[c])] = e(o[c])), + (s.prototype['set' + t(o[c])] = (function (t) { + return function (e) { + this[t] = String(e); + }; + })(o[c])); + return s; + }) + ? n.apply(e, o) + : n) || (t.exports = i); + })(); + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e) { + n.isFunction(t[e]) && (t[e] = t[e].toString()); + } + t.exports = { + itemToPayload: function (t, e, r) { + var o = e.payload || {}; + o.body && delete o.body; + var i = n.merge(t.data, o); + t._isUncaught && (i._isUncaught = !0), + t._originalArgs && (i._originalArgs = t._originalArgs), + r(null, i); + }, + addTelemetryData: function (t, e, r) { + t.telemetryEvents && n.set(t, 'data.body.telemetry', t.telemetryEvents), + r(null, t); + }, + addMessageWithError: function (t, e, r) { + if (t.message) { + var o = 'data.body.trace_chain.0', + i = n.get(t, o); + if ((i || ((o = 'data.body.trace'), (i = n.get(t, o))), i)) { + if (!i.exception || !i.exception.description) + return ( + n.set(t, o + '.exception.description', t.message), + void r(null, t) + ); + var s = n.get(t, o + '.extra') || {}, + a = n.merge(s, { message: t.message }); + n.set(t, o + '.extra', a); + } + r(null, t); + } else r(null, t); + }, + userTransform: function (t) { + return function (e, r, o) { + var i = n.merge(e), + s = null; + try { + n.isFunction(r.transform) && (s = r.transform(i.data, e)); + } catch (n) { + return ( + (r.transform = null), + t.error( + 'Error while calling custom transform() function. Removing custom transform().', + n, + ), + void o(null, e) + ); + } + n.isPromise(s) + ? s.then( + function (t) { + t && (i.data = t), o(null, i); + }, + function (t) { + o(t, e); + }, + ) + : o(null, i); + }; + }, + addConfigToPayload: function (t, e, r) { + if (!e.sendConfig) return r(null, t); + var o = n.get(t, 'data.custom') || {}; + (o._rollbarConfig = e), (t.data.custom = o), r(null, t); + }, + addConfiguredOptions: function (t, e, r) { + var n = e._configuredOptions; + o(n, 'transform'), + o(n, 'checkIgnore'), + o(n, 'onSendCallback'), + delete n.accessToken, + (t.data.notifier.configured_options = n), + r(null, t); + }, + addDiagnosticKeys: function (t, e, r) { + var o = n.merge(t.notifier.client.notifier.diagnostic, t.diagnostic); + if ( + (n.get(t, 'err._isAnonymous') && (o.is_anonymous = !0), + t._isUncaught && (o.is_uncaught = t._isUncaught), + t.err) + ) + try { + o.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) { + o.raw_error = { failed: String(t) }; + } + (t.data.notifier.diagnostic = n.merge(t.data.notifier.diagnostic, o)), + r(null, t); + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + t.exports = { + checkIgnore: function (t, e) { + return ( + !n.get(e, 'plugins.jquery.ignoreAjaxErrors') || + !n.get(t, 'body.message.extra.isAjax') + ); + }, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t, e, r) { + if (!t) return !r; + var o, + i, + s = t.frames; + if (!s || 0 === s.length) return !r; + for (var a = e.length, u = s.length, c = 0; c < u; c++) { + if (((o = s[c].filename), !n.isType(o, 'string'))) return !r; + for (var l = 0; l < a; l++) + if (((i = e[l]), new RegExp(i).test(o))) return !0; + } + return !1; + } + function i(t, e, r, i) { + var s, + a, + u = !1; + 'blocklist' === r && (u = !0); + try { + if ( + ((s = u ? e.hostBlockList : e.hostSafeList), + (a = n.get(t, 'body.trace_chain') || [n.get(t, 'body.trace')]), + !s || 0 === s.length) + ) + return !u; + if (0 === a.length || !a[0]) return !u; + for (var c = a.length, l = 0; l < c; l++) if (o(a[l], s, u)) return !0; + } catch (t) { + u ? (e.hostBlockList = null) : (e.hostSafeList = null); + var p = u ? 'hostBlockList' : 'hostSafeList'; + return ( + i.error( + "Error while reading your configuration's " + + p + + ' option. Removing custom ' + + p + + '.', + t, + ), + !u + ); + } + return !1; + } + t.exports = { + checkLevel: function (t, e) { + var r = t.level, + o = n.LEVELS[r] || 0, + i = e.reportLevel; + return !(o < (n.LEVELS[i] || 0)); + }, + userCheckIgnore: function (t) { + return function (e, r) { + var o = !!e._isUncaught; + delete e._isUncaught; + var i = e._originalArgs; + delete e._originalArgs; + try { + n.isFunction(r.onSendCallback) && r.onSendCallback(o, i, e); + } catch (e) { + (r.onSendCallback = null), + t.error('Error while calling onSendCallback, removing', e); + } + try { + if (n.isFunction(r.checkIgnore) && r.checkIgnore(o, i, e)) + return !1; + } catch (e) { + (r.checkIgnore = null), + t.error('Error while calling custom checkIgnore(), removing', e); + } + return !0; + }; + }, + urlIsNotBlockListed: function (t) { + return function (e, r) { + return !i(e, r, 'blocklist', t); + }; + }, + urlIsSafeListed: function (t) { + return function (e, r) { + return i(e, r, 'safelist', t); + }; + }, + messageIsIgnored: function (t) { + return function (e, r) { + var o, i, s, a, u, c; + try { + if ((!1, !(s = r.ignoredMessages) || 0 === s.length)) return !0; + if ( + 0 === + (c = (function (t) { + var e = t.body, + r = []; + if (e.trace_chain) + for (var o = e.trace_chain, i = 0; i < o.length; i++) { + var s = o[i]; + r.push(n.get(s, 'exception.message')); + } + e.trace && r.push(n.get(e, 'trace.exception.message')); + e.message && r.push(n.get(e, 'message.body')); + return r; + })(e)).length + ) + return !0; + for (a = s.length, o = 0; o < a; o++) + for (u = new RegExp(s[o], 'gi'), i = 0; i < c.length; i++) + if (u.test(c[i])) return !1; + } catch (e) { + (r.ignoredMessages = null), + t.error( + "Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.", + ); + } + return !0; + }; + }, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + version: '2.26.0', + endpoint: 'api.rollbar.com/api/1/item/', + logLevel: 'debug', + reportLevel: 'debug', + uncaughtErrorLevel: 'error', + maxItems: 0, + itemsPerMin: 60, + }; + }, + function (t, e, r) { + 'use strict'; + t.exports = { + scrubFields: [ + 'pw', + 'pass', + 'passwd', + 'password', + 'secret', + 'confirm_password', + 'confirmPassword', + 'password_confirmation', + 'passwordConfirmation', + 'access_token', + 'accessToken', + 'X-Rollbar-Access-Token', + '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', + ], + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0); + function o(t) { + (this.queue = []), (this.options = n.merge(t)); + var e = this.options.maxTelemetryEvents || 100; + this.maxQueueSize = Math.max(0, Math.min(e, 100)); + } + function i(t, e) { + if (e) return e; + return { error: 'error', manual: 'info' }[t] || 'info'; + } + (o.prototype.configure = function (t) { + var e = this.options; + this.options = n.merge(e, t); + var r = this.options.maxTelemetryEvents || 100, + o = Math.max(0, Math.min(r, 100)), + i = 0; + this.maxQueueSize > o && (i = this.maxQueueSize - o), + (this.maxQueueSize = o), + this.queue.splice(0, i); + }), + (o.prototype.copyEvents = function () { + var t = Array.prototype.slice.call(this.queue, 0); + if (n.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; + }), + (o.prototype.capture = function (t, e, r, o, s) { + var a = { + level: i(t, r), + type: t, + timestamp_ms: s || n.now(), + body: e, + source: 'client', + }; + o && (a.uuid = o); + try { + if ( + n.isFunction(this.options.filterTelemetry) && + this.options.filterTelemetry(a) + ) + return !1; + } catch (t) { + this.options.filterTelemetry = null; + } + return this.push(a), a; + }), + (o.prototype.captureEvent = function (t, e, r, n) { + return this.capture(t, e, r, n); + }), + (o.prototype.captureError = function (t, e, r, n) { + var o = { message: t.message || String(t) }; + return ( + t.stack && (o.stack = t.stack), this.capture('error', o, e, r, n) + ); + }), + (o.prototype.captureLog = function (t, e, r, n) { + return this.capture('log', { message: t }, e, r, n); + }), + (o.prototype.captureNetwork = function (t, e, r, n) { + (e = e || 'xhr'), (t.subtype = t.subtype || e), n && (t.request = n); + var o = this.levelFromStatus(t.status_code); + return this.capture('network', t, o, r); + }), + (o.prototype.levelFromStatus = function (t) { + return t >= 200 && t < 400 + ? 'info' + : 0 === t || t >= 400 + ? 'error' + : 'info'; + }), + (o.prototype.captureDom = function (t, e, r, n, o) { + var i = { subtype: t, element: e }; + return ( + void 0 !== r && (i.value = r), + void 0 !== n && (i.checked = n), + this.capture('dom', i, 'info', o) + ); + }), + (o.prototype.captureNavigation = function (t, e, r) { + return this.capture('navigation', { from: t, to: e }, 'info', r); + }), + (o.prototype.captureDomContentLoaded = function (t) { + return this.capture( + 'navigation', + { subtype: 'DOMContentLoaded' }, + 'info', + void 0, + t && t.getTime(), + ); + }), + (o.prototype.captureLoad = function (t) { + return this.capture( + 'navigation', + { subtype: 'load' }, + 'info', + void 0, + t && t.getTime(), + ); + }), + (o.prototype.captureConnectivityChange = function (t, e) { + return this.captureNetwork({ change: t }, 'connectivity', e); + }), + (o.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; + }), + (o.prototype.push = function (t) { + this.queue.push(t), + this.queue.length > this.maxQueueSize && this.queue.shift(); + }), + (t.exports = o); + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(32), + i = r(4), + s = r(2), + a = r(33), + u = { + network: !0, + networkResponseHeaders: !1, + networkResponseBody: !1, + networkRequestHeaders: !1, + networkRequestBody: !1, + networkErrorOnHttp5xx: !1, + networkErrorOnHttp4xx: !1, + networkErrorOnHttp0: !1, + log: !0, + dom: !0, + navigation: !0, + connectivity: !0, + contentSecurityPolicy: !0, + errorOnContentSecurityPolicy: !1, + }; + function c(t, e, r, n, o) { + var i = t[e]; + (t[e] = r(i)), n && n[o].push([t, e, i]); + } + function l(t, e) { + for (var r; t[e].length; ) (r = t[e].shift())[0][r[1]] = r[2]; + } + function p(t, e, r, o, i) { + this.options = t; + var s = t.autoInstrument; + !1 === t.enabled || !1 === s + ? (this.autoInstrument = {}) + : (n.isType(s, 'object') || (s = u), + (this.autoInstrument = n.merge(u, s))), + (this.scrubTelemetryInputs = !!t.scrubTelemetryInputs), + (this.telemetryScrubber = t.telemetryScrubber), + (this.defaultValueScrubber = (function (t) { + for (var e = [], r = 0; r < t.length; ++r) + e.push(new RegExp(t[r], 'i')); + return function (t) { + var r = (function (t) { + if (!t || !t.attributes) return null; + for (var e = t.attributes, r = 0; r < e.length; ++r) + if ('name' === e[r].key) return e[r].value; + return null; + })(t); + if (!r) return !1; + for (var n = 0; n < e.length; ++n) if (e[n].test(r)) return !0; + return !1; + }; + })(t.scrubFields)), + (this.telemeter = e), + (this.rollbar = r), + (this.diagnostic = r.client.notifier.diagnostic), + (this._window = o || {}), + (this._document = i || {}), + (this.replacements = { + network: [], + log: [], + navigation: [], + connectivity: [], + }), + (this.eventRemovers = { + dom: [], + connectivity: [], + contentsecuritypolicy: [], + }), + (this._location = this._window.location), + (this._lastHref = this._location && this._location.href); + } + (p.prototype.configure = function (t) { + this.options = n.merge(this.options, t); + var e = t.autoInstrument, + r = n.merge(this.autoInstrument); + !1 === t.enabled || !1 === e + ? (this.autoInstrument = {}) + : (n.isType(e, 'object') || (e = u), + (this.autoInstrument = n.merge(u, e))), + this.instrument(r), + void 0 !== t.scrubTelemetryInputs && + (this.scrubTelemetryInputs = !!t.scrubTelemetryInputs), + void 0 !== t.telemetryScrubber && + (this.telemetryScrubber = t.telemetryScrubber); + }), + (p.prototype.instrument = function (t) { + !this.autoInstrument.network || (t && t.network) + ? !this.autoInstrument.network && + t && + t.network && + this.deinstrumentNetwork() + : this.instrumentNetwork(), + !this.autoInstrument.log || (t && t.log) + ? !this.autoInstrument.log && + t && + t.log && + this.deinstrumentConsole() + : this.instrumentConsole(), + !this.autoInstrument.dom || (t && t.dom) + ? !this.autoInstrument.dom && t && t.dom && this.deinstrumentDom() + : this.instrumentDom(), + !this.autoInstrument.navigation || (t && t.navigation) + ? !this.autoInstrument.navigation && + t && + t.navigation && + this.deinstrumentNavigation() + : this.instrumentNavigation(), + !this.autoInstrument.connectivity || (t && t.connectivity) + ? !this.autoInstrument.connectivity && + t && + t.connectivity && + this.deinstrumentConnectivity() + : this.instrumentConnectivity(), + !this.autoInstrument.contentSecurityPolicy || + (t && t.contentSecurityPolicy) + ? !this.autoInstrument.contentSecurityPolicy && + t && + t.contentSecurityPolicy && + this.deinstrumentContentSecurityPolicy() + : this.instrumentContentSecurityPolicy(); + }), + (p.prototype.deinstrumentNetwork = function () { + l(this.replacements, 'network'); + }), + (p.prototype.instrumentNetwork = function () { + var t = this; + function e(e, r) { + e in r && + n.isFunction(r[e]) && + c(r, e, function (e) { + return t.rollbar.wrap(e); + }); + } + if ('XMLHttpRequest' in this._window) { + var r = this._window.XMLHttpRequest.prototype; + c( + r, + 'open', + function (t) { + return function (e, r) { + return ( + n.isType(r, 'string') && + (this.__rollbar_xhr + ? ((this.__rollbar_xhr.method = e), + (this.__rollbar_xhr.url = r), + (this.__rollbar_xhr.status_code = null), + (this.__rollbar_xhr.start_time_ms = n.now()), + (this.__rollbar_xhr.end_time_ms = null)) + : (this.__rollbar_xhr = { + method: e, + url: r, + status_code: null, + start_time_ms: n.now(), + end_time_ms: null, + })), + t.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ), + c( + r, + 'setRequestHeader', + function (e) { + return function (r, o) { + return ( + this.__rollbar_xhr || (this.__rollbar_xhr = {}), + n.isType(r, 'string') && + n.isType(o, 'string') && + (t.autoInstrument.networkRequestHeaders && + (this.__rollbar_xhr.request_headers || + (this.__rollbar_xhr.request_headers = {}), + (this.__rollbar_xhr.request_headers[r] = o)), + 'content-type' === r.toLowerCase() && + (this.__rollbar_xhr.request_content_type = o)), + e.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ), + c( + r, + 'send', + function (r) { + return function (o) { + var i = this; + function s() { + if ( + i.__rollbar_xhr && + (null === i.__rollbar_xhr.status_code && + ((i.__rollbar_xhr.status_code = 0), + t.autoInstrument.networkRequestBody && + (i.__rollbar_xhr.request = o), + (i.__rollbar_event = t.captureNetwork( + i.__rollbar_xhr, + 'xhr', + void 0, + ))), + i.readyState < 2 && + (i.__rollbar_xhr.start_time_ms = n.now()), + i.readyState > 3) + ) { + i.__rollbar_xhr.end_time_ms = n.now(); + var e = null; + if ( + ((i.__rollbar_xhr.response_content_type = + i.getResponseHeader('Content-Type')), + t.autoInstrument.networkResponseHeaders) + ) { + var r = t.autoInstrument.networkResponseHeaders; + e = {}; + try { + var s, a; + if (!0 === r) { + var u = i.getAllResponseHeaders(); + if (u) { + var c, + l, + p = u.trim().split(/[\r\n]+/); + for (a = 0; a < p.length; a++) + (s = (c = p[a].split(': ')).shift()), + (l = c.join(': ')), + (e[s] = l); + } + } else + for (a = 0; a < r.length; a++) + e[(s = r[a])] = i.getResponseHeader(s); + } catch (t) {} + } + var f = null; + if (t.autoInstrument.networkResponseBody) + try { + f = i.responseText; + } catch (t) {} + var h = null; + (f || e) && + ((h = {}), + f && + (t.isJsonContentType( + i.__rollbar_xhr.response_content_type, + ) + ? (h.body = t.scrubJson(f)) + : (h.body = f)), + e && (h.headers = e)), + h && (i.__rollbar_xhr.response = h); + try { + var d = i.status; + (d = 1223 === d ? 204 : d), + (i.__rollbar_xhr.status_code = d), + (i.__rollbar_event.level = + t.telemeter.levelFromStatus(d)), + t.errorOnHttpStatus(i.__rollbar_xhr); + } catch (t) {} + } + } + return ( + e('onload', i), + e('onerror', i), + e('onprogress', i), + 'onreadystatechange' in i && + n.isFunction(i.onreadystatechange) + ? c(i, 'onreadystatechange', function (e) { + return t.rollbar.wrap(e, void 0, s); + }) + : (i.onreadystatechange = s), + i.__rollbar_xhr && + t.trackHttpErrors() && + (i.__rollbar_xhr.stack = new Error().stack), + r.apply(this, arguments) + ); + }; + }, + this.replacements, + 'network', + ); + } + 'fetch' in this._window && + c( + this._window, + 'fetch', + function (e) { + return function (r, i) { + for ( + var s = new Array(arguments.length), a = 0, u = s.length; + a < u; + a++ + ) + s[a] = arguments[a]; + var c, + l = s[0], + p = 'GET'; + n.isType(l, 'string') + ? (c = l) + : l && ((c = l.url), l.method && (p = l.method)), + s[1] && s[1].method && (p = s[1].method); + var f = { + method: p, + url: c, + status_code: null, + start_time_ms: n.now(), + end_time_ms: null, + }; + if (s[1] && s[1].headers) { + var h = o(s[1].headers); + (f.request_content_type = h.get('Content-Type')), + t.autoInstrument.networkRequestHeaders && + (f.request_headers = t.fetchHeaders( + h, + t.autoInstrument.networkRequestHeaders, + )); + } + return ( + t.autoInstrument.networkRequestBody && + (s[1] && s[1].body + ? (f.request = s[1].body) + : s[0] && + !n.isType(s[0], 'string') && + s[0].body && + (f.request = s[0].body)), + t.captureNetwork(f, 'fetch', void 0), + t.trackHttpErrors() && (f.stack = new Error().stack), + e.apply(this, s).then(function (e) { + (f.end_time_ms = n.now()), + (f.status_code = e.status), + (f.response_content_type = e.headers.get('Content-Type')); + var r = null; + t.autoInstrument.networkResponseHeaders && + (r = t.fetchHeaders( + e.headers, + t.autoInstrument.networkResponseHeaders, + )); + var o = null; + return ( + t.autoInstrument.networkResponseBody && + 'function' == typeof e.text && + (o = e.clone().text()), + (r || o) && + ((f.response = {}), + o && + ('function' == typeof o.then + ? o.then(function (e) { + e && + t.isJsonContentType(f.response_content_type) + ? (f.response.body = t.scrubJson(e)) + : (f.response.body = e); + }) + : (f.response.body = o)), + r && (f.response.headers = r)), + t.errorOnHttpStatus(f), + e + ); + }) + ); + }; + }, + this.replacements, + 'network', + ); + }), + (p.prototype.captureNetwork = function (t, e, r) { + return ( + t.request && + this.isJsonContentType(t.request_content_type) && + (t.request = this.scrubJson(t.request)), + this.telemeter.captureNetwork(t, e, r) + ); + }), + (p.prototype.isJsonContentType = function (t) { + return !!( + t && + n.isType(t, 'string') && + t.toLowerCase().includes('json') + ); + }), + (p.prototype.scrubJson = function (t) { + return JSON.stringify(i(JSON.parse(t), this.options.scrubFields)); + }), + (p.prototype.fetchHeaders = function (t, e) { + var r = {}; + try { + var n; + if (!0 === e) { + if ('function' == typeof t.entries) + for (var o = t.entries(), i = o.next(); !i.done; ) + (r[i.value[0]] = i.value[1]), (i = o.next()); + } else + for (n = 0; n < e.length; n++) { + var s = e[n]; + r[s] = t.get(s); + } + } catch (t) {} + return r; + }), + (p.prototype.trackHttpErrors = function () { + return ( + this.autoInstrument.networkErrorOnHttp5xx || + this.autoInstrument.networkErrorOnHttp4xx || + this.autoInstrument.networkErrorOnHttp0 + ); + }), + (p.prototype.errorOnHttpStatus = function (t) { + var e = t.status_code; + if ( + (e >= 500 && this.autoInstrument.networkErrorOnHttp5xx) || + (e >= 400 && this.autoInstrument.networkErrorOnHttp4xx) || + (0 === e && this.autoInstrument.networkErrorOnHttp0) + ) { + var r = new Error('HTTP request failed with Status ' + e); + (r.stack = t.stack), this.rollbar.error(r, { skipFrames: 1 }); + } + }), + (p.prototype.deinstrumentConsole = function () { + if ('console' in this._window && this._window.console.log) + for (var t; this.replacements.log.length; ) + (t = this.replacements.log.shift()), + (this._window.console[t[0]] = t[1]); + }), + (p.prototype.instrumentConsole = function () { + if ('console' in this._window && this._window.console.log) { + var t = this, + e = this._window.console, + r = ['debug', 'info', 'warn', 'error', 'log']; + try { + for (var o = 0, i = r.length; o < i; o++) s(r[o]); + } catch (t) { + this.diagnostic.instrumentConsole = { error: t.message }; + } + } + function s(r) { + var o = e[r], + i = e, + s = 'warn' === r ? 'warning' : r; + (e[r] = function () { + var e = Array.prototype.slice.call(arguments), + r = n.formatArgsAsString(e); + t.telemeter.captureLog(r, s), + o && Function.prototype.apply.call(o, i, e); + }), + t.replacements.log.push([r, o]); + } + }), + (p.prototype.deinstrumentDom = function () { + ('addEventListener' in this._window || 'attachEvent' in this._window) && + this.removeListeners('dom'); + }), + (p.prototype.instrumentDom = function () { + if ( + 'addEventListener' in this._window || + 'attachEvent' in this._window + ) { + var t = this.handleClick.bind(this), + e = this.handleBlur.bind(this); + this.addListener('dom', this._window, 'click', 'onclick', t, !0), + this.addListener('dom', this._window, 'blur', 'onfocusout', e, !0); + } + }), + (p.prototype.handleClick = function (t) { + try { + var e = a.getElementFromEvent(t, this._document), + r = e && e.tagName, + n = + a.isDescribedElement(e, 'a') || a.isDescribedElement(e, 'button'); + r && (n || a.isDescribedElement(e, 'input', ['button', 'submit'])) + ? this.captureDomEvent('click', e) + : a.isDescribedElement(e, 'input', ['checkbox', 'radio']) && + this.captureDomEvent('input', e, e.value, e.checked); + } catch (t) {} + }), + (p.prototype.handleBlur = function (t) { + try { + var e = a.getElementFromEvent(t, this._document); + e && + e.tagName && + (a.isDescribedElement(e, 'textarea') + ? this.captureDomEvent('input', e, e.value) + : a.isDescribedElement(e, 'select') && + e.options && + e.options.length + ? this.handleSelectInputChanged(e) + : a.isDescribedElement(e, 'input') && + !a.isDescribedElement(e, 'input', [ + 'button', + 'submit', + 'hidden', + 'checkbox', + 'radio', + ]) && + this.captureDomEvent('input', e, e.value)); + } catch (t) {} + }), + (p.prototype.handleSelectInputChanged = function (t) { + if (t.multiple) + for (var e = 0; e < t.options.length; e++) + t.options[e].selected && + this.captureDomEvent('input', t, t.options[e].value); + else + t.selectedIndex >= 0 && + t.options[t.selectedIndex] && + this.captureDomEvent('input', t, t.options[t.selectedIndex].value); + }), + (p.prototype.captureDomEvent = function (t, e, r, n) { + if (void 0 !== r) + if (this.scrubTelemetryInputs || 'password' === a.getElementType(e)) + r = '[scrubbed]'; + else { + var o = a.describeElement(e); + this.telemetryScrubber + ? this.telemetryScrubber(o) && (r = '[scrubbed]') + : this.defaultValueScrubber(o) && (r = '[scrubbed]'); + } + var i = a.elementArrayToString(a.treeToArray(e)); + this.telemeter.captureDom(t, i, r, n); + }), + (p.prototype.deinstrumentNavigation = function () { + var t = this._window.chrome; + !(t && t.app && t.app.runtime) && + this._window.history && + this._window.history.pushState && + l(this.replacements, 'navigation'); + }), + (p.prototype.instrumentNavigation = function () { + var t = this._window.chrome; + if ( + !(t && t.app && t.app.runtime) && + this._window.history && + this._window.history.pushState + ) { + var e = this; + c( + this._window, + 'onpopstate', + function (t) { + return function () { + var r = e._location.href; + e.handleUrlChange(e._lastHref, r), + t && t.apply(this, arguments); + }; + }, + this.replacements, + 'navigation', + ), + c( + this._window.history, + 'pushState', + function (t) { + return function () { + var r = arguments.length > 2 ? arguments[2] : void 0; + return ( + r && e.handleUrlChange(e._lastHref, r + ''), + t.apply(this, arguments) + ); + }; + }, + this.replacements, + 'navigation', + ); + } + }), + (p.prototype.handleUrlChange = function (t, e) { + var r = s.parse(this._location.href), + n = s.parse(e), + o = s.parse(t); + (this._lastHref = e), + r.protocol === n.protocol && + r.host === n.host && + (e = n.path + (n.hash || '')), + r.protocol === o.protocol && + r.host === o.host && + (t = o.path + (o.hash || '')), + this.telemeter.captureNavigation(t, e); + }), + (p.prototype.deinstrumentConnectivity = function () { + ('addEventListener' in this._window || 'body' in this._document) && + (this._window.addEventListener + ? this.removeListeners('connectivity') + : l(this.replacements, 'connectivity')); + }), + (p.prototype.instrumentConnectivity = function () { + if ('addEventListener' in this._window || 'body' in this._document) + if (this._window.addEventListener) + this.addListener( + 'connectivity', + this._window, + 'online', + void 0, + function () { + this.telemeter.captureConnectivityChange('online'); + }.bind(this), + !0, + ), + this.addListener( + 'connectivity', + this._window, + 'offline', + void 0, + function () { + this.telemeter.captureConnectivityChange('offline'); + }.bind(this), + !0, + ); + else { + var t = this; + c( + this._document.body, + 'ononline', + function (e) { + return function () { + t.telemeter.captureConnectivityChange('online'), + e && e.apply(this, arguments); + }; + }, + this.replacements, + 'connectivity', + ), + c( + this._document.body, + 'onoffline', + function (e) { + return function () { + t.telemeter.captureConnectivityChange('offline'), + e && e.apply(this, arguments); + }; + }, + this.replacements, + 'connectivity', + ); + } + }), + (p.prototype.handleCspEvent = function (t) { + var e = + 'Security Policy Violation: blockedURI: ' + + t.blockedURI + + ', violatedDirective: ' + + t.violatedDirective + + ', effectiveDirective: ' + + t.effectiveDirective + + ', '; + t.sourceFile && + (e += + 'location: ' + + t.sourceFile + + ', line: ' + + t.lineNumber + + ', col: ' + + t.columnNumber + + ', '), + (e += 'originalPolicy: ' + t.originalPolicy), + this.telemeter.captureLog(e, 'error'), + this.handleCspError(e); + }), + (p.prototype.handleCspError = function (t) { + this.autoInstrument.errorOnContentSecurityPolicy && + this.rollbar.error(t); + }), + (p.prototype.deinstrumentContentSecurityPolicy = function () { + 'addEventListener' in this._document && + this.removeListeners('contentsecuritypolicy'); + }), + (p.prototype.instrumentContentSecurityPolicy = function () { + if ('addEventListener' in this._document) { + var t = this.handleCspEvent.bind(this); + this.addListener( + 'contentsecuritypolicy', + this._document, + 'securitypolicyviolation', + null, + t, + !1, + ); + } + }), + (p.prototype.addListener = function (t, e, r, n, o, i) { + e.addEventListener + ? (e.addEventListener(r, o, i), + this.eventRemovers[t].push(function () { + e.removeEventListener(r, o, i); + })) + : n && + (e.attachEvent(n, o), + this.eventRemovers[t].push(function () { + e.detachEvent(n, o); + })); + }), + (p.prototype.removeListeners = function (t) { + for (; this.eventRemovers[t].length; ) this.eventRemovers[t].shift()(); + }), + (t.exports = p); + }, + function (t, e, r) { + 'use strict'; + function n(t) { + return 'string' != typeof t && (t = String(t)), t.toLowerCase(); + } + function o(t) { + (this.map = {}), + t instanceof o + ? t.forEach(function (t, e) { + this.append(e, t); + }, this) + : Array.isArray(t) + ? t.forEach(function (t) { + this.append(t[0], t[1]); + }, this) + : t && + Object.getOwnPropertyNames(t).forEach(function (e) { + this.append(e, t[e]); + }, this); + } + (o.prototype.append = function (t, e) { + (t = n(t)), + (e = (function (t) { + return 'string' != typeof t && (t = String(t)), t; + })(e)); + var r = this.map[t]; + this.map[t] = r ? r + ', ' + e : e; + }), + (o.prototype.get = function (t) { + return (t = n(t)), this.has(t) ? this.map[t] : null; + }), + (o.prototype.has = function (t) { + return this.map.hasOwnProperty(n(t)); + }), + (o.prototype.forEach = function (t, e) { + for (var r in this.map) + this.map.hasOwnProperty(r) && t.call(e, this.map[r], r, this); + }), + (o.prototype.entries = function () { + var t = []; + return ( + this.forEach(function (e, r) { + t.push([r, e]); + }), + (function (t) { + return { + next: function () { + var e = t.shift(); + return { done: void 0 === e, value: e }; + }, + }; + })(t) + ); + }), + (t.exports = function (t) { + return 'undefined' == typeof Headers ? new o(t) : new Headers(t); + }); + }, + function (t, e, r) { + 'use strict'; + function n(t) { + return (t.getAttribute('type') || '').toLowerCase(); + } + function o(t) { + if (!t || !t.tagName) return ''; + var e = [t.tagName]; + t.id && e.push('#' + t.id), + t.classes && e.push('.' + t.classes.join('.')); + for (var r = 0; r < t.attributes.length; r++) + e.push('[' + t.attributes[r].key + '="' + t.attributes[r].value + '"]'); + return e.join(''); + } + function i(t) { + if (!t || !t.tagName) return null; + var e, + r, + n, + o, + i = {}; + (i.tagName = t.tagName.toLowerCase()), + t.id && (i.id = t.id), + (e = t.className) && + 'string' == typeof e && + (i.classes = e.split(/\s+/)); + var s = ['type', 'name', 'title', 'alt']; + for (i.attributes = [], o = 0; o < s.length; o++) + (r = s[o]), + (n = t.getAttribute(r)) && i.attributes.push({ key: r, value: n }); + return i; + } + t.exports = { + describeElement: i, + descriptionToString: o, + elementArrayToString: function (t) { + for ( + var e, r, n = ' > '.length, i = [], s = 0, a = t.length - 1; + a >= 0; + a-- + ) { + if ( + ((e = o(t[a])), + (r = s + i.length * n + e.length), + a < t.length - 1 && r >= 83) + ) { + i.unshift('...'); + break; + } + i.unshift(e), (s += e.length); + } + return i.join(' > '); + }, + treeToArray: function (t) { + for ( + var e, r = [], n = 0; + t && n < 5 && 'html' !== (e = i(t)).tagName; + n++ + ) + r.unshift(e), (t = t.parentNode); + return r; + }, + getElementFromEvent: function (t, e) { + return t.target + ? t.target + : e && e.elementFromPoint + ? e.elementFromPoint(t.clientX, t.clientY) + : void 0; + }, + isDescribedElement: function (t, e, r) { + if (t.tagName.toLowerCase() !== e.toLowerCase()) return !1; + if (!r) return !0; + t = n(t); + for (var o = 0; o < r.length; o++) if (r[o] === t) return !0; + return !1; + }, + getElementType: n, + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(35); + t.exports = n; + }, + function (t, e) { + t.exports = function (t) { + var e, + r, + n, + o, + i, + s, + a, + u, + c, + l, + p, + f, + h, + d = + /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g; + function m(t) { + return t < 10 ? '0' + t : t; + } + function g() { + return this.valueOf(); + } + function v(t) { + return ( + (d.lastIndex = 0), + d.test(t) + ? '"' + + t.replace(d, function (t) { + var e = n[t]; + return 'string' == typeof e + ? e + : '\\u' + ('0000' + t.charCodeAt(0).toString(16)).slice(-4); + }) + + '"' + : '"' + t + '"' + ); + } + 'function' != typeof Date.prototype.toJSON && + ((Date.prototype.toJSON = function () { + return isFinite(this.valueOf()) + ? this.getUTCFullYear() + + '-' + + m(this.getUTCMonth() + 1) + + '-' + + m(this.getUTCDate()) + + 'T' + + m(this.getUTCHours()) + + ':' + + m(this.getUTCMinutes()) + + ':' + + m(this.getUTCSeconds()) + + 'Z' + : null; + }), + (Boolean.prototype.toJSON = g), + (Number.prototype.toJSON = g), + (String.prototype.toJSON = g)), + 'function' != typeof t.stringify && + ((n = { + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"': '\\"', + '\\': '\\\\', + }), + (t.stringify = function (t, n, i) { + var s; + if (((e = ''), (r = ''), 'number' == typeof i)) + for (s = 0; s < i; s += 1) r += ' '; + else 'string' == typeof i && (r = i); + if ( + ((o = n), + n && + 'function' != typeof n && + ('object' != typeof n || 'number' != typeof n.length)) + ) + throw new Error('JSON.stringify'); + return (function t(n, i) { + var s, + a, + u, + c, + l, + p = e, + f = i[n]; + switch ( + (f && + 'object' == typeof f && + 'function' == typeof f.toJSON && + (f = f.toJSON(n)), + 'function' == typeof o && (f = o.call(i, n, f)), + typeof f) + ) { + case 'string': + return v(f); + case 'number': + return isFinite(f) ? String(f) : 'null'; + case 'boolean': + case 'null': + return String(f); + case 'object': + if (!f) return 'null'; + if ( + ((e += r), + (l = []), + '[object Array]' === Object.prototype.toString.apply(f)) + ) { + for (c = f.length, s = 0; s < c; s += 1) + l[s] = t(s, f) || 'null'; + return ( + (u = + 0 === l.length + ? '[]' + : e + ? '[\n' + e + l.join(',\n' + e) + '\n' + p + ']' + : '[' + l.join(',') + ']'), + (e = p), + u + ); + } + if (o && 'object' == typeof o) + for (c = o.length, s = 0; s < c; s += 1) + 'string' == typeof o[s] && + (u = t((a = o[s]), f)) && + l.push(v(a) + (e ? ': ' : ':') + u); + else + for (a in f) + Object.prototype.hasOwnProperty.call(f, a) && + (u = t(a, f)) && + l.push(v(a) + (e ? ': ' : ':') + u); + return ( + (u = + 0 === l.length + ? '{}' + : e + ? '{\n' + e + l.join(',\n' + e) + '\n' + p + '}' + : '{' + l.join(',') + '}'), + (e = p), + u + ); + } + })('', { '': t }); + })), + 'function' != typeof t.parse && + (t.parse = + ((l = { + '\\': '\\', + '"': '"', + '/': '/', + t: '\t', + n: '\n', + r: '\r', + f: '\f', + b: '\b', + }), + (p = { + go: function () { + i = 'ok'; + }, + firstokey: function () { + (u = c), (i = 'colon'); + }, + okey: function () { + (u = c), (i = 'colon'); + }, + ovalue: function () { + i = 'ocomma'; + }, + firstavalue: function () { + i = 'acomma'; + }, + avalue: function () { + i = 'acomma'; + }, + }), + (f = { + go: function () { + i = 'ok'; + }, + ovalue: function () { + i = 'ocomma'; + }, + firstavalue: function () { + i = 'acomma'; + }, + avalue: function () { + i = 'acomma'; + }, + }), + (h = { + '{': { + go: function () { + s.push({ state: 'ok' }), (a = {}), (i = 'firstokey'); + }, + ovalue: function () { + s.push({ container: a, state: 'ocomma', key: u }), + (a = {}), + (i = 'firstokey'); + }, + firstavalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = {}), + (i = 'firstokey'); + }, + avalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = {}), + (i = 'firstokey'); + }, + }, + '}': { + firstokey: function () { + var t = s.pop(); + (c = a), (a = t.container), (u = t.key), (i = t.state); + }, + ocomma: function () { + var t = s.pop(); + (a[u] = c), + (c = a), + (a = t.container), + (u = t.key), + (i = t.state); + }, + }, + '[': { + go: function () { + s.push({ state: 'ok' }), (a = []), (i = 'firstavalue'); + }, + ovalue: function () { + s.push({ container: a, state: 'ocomma', key: u }), + (a = []), + (i = 'firstavalue'); + }, + firstavalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = []), + (i = 'firstavalue'); + }, + avalue: function () { + s.push({ container: a, state: 'acomma' }), + (a = []), + (i = 'firstavalue'); + }, + }, + ']': { + firstavalue: function () { + var t = s.pop(); + (c = a), (a = t.container), (u = t.key), (i = t.state); + }, + acomma: function () { + var t = s.pop(); + a.push(c), + (c = a), + (a = t.container), + (u = t.key), + (i = t.state); + }, + }, + ':': { + colon: function () { + if (Object.hasOwnProperty.call(a, u)) + throw new SyntaxError("Duplicate key '" + u + '"'); + i = 'ovalue'; + }, + }, + ',': { + ocomma: function () { + (a[u] = c), (i = 'okey'); + }, + acomma: function () { + a.push(c), (i = 'avalue'); + }, + }, + true: { + go: function () { + (c = !0), (i = 'ok'); + }, + ovalue: function () { + (c = !0), (i = 'ocomma'); + }, + firstavalue: function () { + (c = !0), (i = 'acomma'); + }, + avalue: function () { + (c = !0), (i = 'acomma'); + }, + }, + false: { + go: function () { + (c = !1), (i = 'ok'); + }, + ovalue: function () { + (c = !1), (i = 'ocomma'); + }, + firstavalue: function () { + (c = !1), (i = 'acomma'); + }, + avalue: function () { + (c = !1), (i = 'acomma'); + }, + }, + null: { + go: function () { + (c = null), (i = 'ok'); + }, + ovalue: function () { + (c = null), (i = 'ocomma'); + }, + firstavalue: function () { + (c = null), (i = 'acomma'); + }, + avalue: function () { + (c = null), (i = 'acomma'); + }, + }, + }), + function (t, e) { + var r, + n, + o = + /^[\u0020\t\n\r]*(?:([,:\[\]{}]|true|false|null)|(-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)|"((?:[^\r\n\t\\\"]|\\(?:["\\\/trnfb]|u[0-9a-fA-F]{4}))*)")/; + (i = 'go'), (s = []); + try { + for (; (r = o.exec(t)); ) + r[1] + ? h[r[1]][i]() + : r[2] + ? ((c = +r[2]), f[i]()) + : ((n = r[3]), + (c = n.replace( + /\\(?:u(.{4})|([^u]))/g, + function (t, e, r) { + return e + ? String.fromCharCode(parseInt(e, 16)) + : l[r]; + }, + )), + p[i]()), + (t = t.slice(r[0].length)); + } catch (t) { + i = t; + } + if ('ok' !== i || /[^\u0020\t\n\r]/.test(t)) + throw i instanceof SyntaxError ? i : new SyntaxError('JSON'); + return 'function' == typeof e + ? (function t(r, n) { + var o, + i, + s = r[n]; + if (s && 'object' == typeof s) + for (o in c) + Object.prototype.hasOwnProperty.call(s, o) && + (void 0 !== (i = t(s, o)) ? (s[o] = i) : delete s[o]); + return e.call(r, n, s); + })({ '': c }, '') + : c; + })); + }; + }, + function (t, e, r) { + 'use strict'; + function n(t, e, r) { + if (e.hasOwnProperty && e.hasOwnProperty('addEventListener')) { + for (var n = e.addEventListener; n._rollbarOldAdd && n.belongsToShim; ) + n = n._rollbarOldAdd; + var o = function (e, r, o) { + n.call(this, e, t.wrap(r), o); + }; + (o._rollbarOldAdd = n), (o.belongsToShim = r), (e.addEventListener = o); + for ( + var i = e.removeEventListener; + i._rollbarOldRemove && i.belongsToShim; + + ) + i = i._rollbarOldRemove; + var s = function (t, e, r) { + i.call(this, t, (e && e._rollbar_wrapped) || e, r); + }; + (s._rollbarOldRemove = i), + (s.belongsToShim = r), + (e.removeEventListener = s); + } + } + t.exports = function (t, e, r) { + if (t) { + var o, + i, + s = + 'EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload'.split( + ',', + ); + for (o = 0; o < s.length; ++o) + t[(i = s[o])] && t[i].prototype && n(e, t[i].prototype, r); + } + }; + }, + function (t, e, r) { + 'use strict'; + var n = r(0), + o = r(5); + function i(t, e) { + return [t, n.stringify(t, e)]; + } + function s(t, e) { + var r = t.length; + return r > 2 * e ? t.slice(0, e).concat(t.slice(r - e)) : t; + } + function a(t, e, r) { + r = void 0 === r ? 30 : r; + var o, + i = t.data.body; + if (i.trace_chain) + for (var a = i.trace_chain, u = 0; u < a.length; u++) + (o = s((o = a[u].frames), r)), (a[u].frames = o); + else i.trace && ((o = s((o = i.trace.frames), r)), (i.trace.frames = o)); + return [t, n.stringify(t, e)]; + } + function u(t, e) { + return e && e.length > t ? e.slice(0, t - 3).concat('...') : e; + } + function c(t, e, r) { + return [ + (e = o(e, function e(r, i, s) { + switch (n.typeName(i)) { + case 'string': + return u(t, i); + case 'object': + case 'array': + return o(i, e, s); + default: + return i; + } + })), + n.stringify(e, r), + ]; + } + function l(t) { + return ( + t.exception && + (delete t.exception.description, + (t.exception.message = u(255, t.exception.message))), + (t.frames = s(t.frames, 1)), + t + ); + } + function p(t, e) { + var r = t.data.body; + if (r.trace_chain) + for (var o = r.trace_chain, i = 0; i < o.length; i++) o[i] = l(o[i]); + else r.trace && (r.trace = l(r.trace)); + return [t, n.stringify(t, e)]; + } + function f(t, e) { + return n.maxByteSize(t) > e; + } + t.exports = { + truncate: function (t, e, r) { + r = void 0 === r ? 524288 : r; + for ( + var n, + o, + s, + u = [ + i, + a, + c.bind(null, 1024), + c.bind(null, 512), + c.bind(null, 256), + p, + ]; + (n = u.shift()); + + ) + if (((t = (o = n(t, e))[0]), (s = o[1]).error || !f(s.value, r))) + return s; + return s; + }, + raw: i, + truncateFrames: a, + truncateStrings: c, + maybeTruncateValue: u, + }; + }, +]); diff --git a/examples/browser_extension_v3/service-worker.js b/examples/browser_extension_v3/service-worker.js index 361b50b7d..b7352ff9f 100644 --- a/examples/browser_extension_v3/service-worker.js +++ b/examples/browser_extension_v3/service-worker.js @@ -3,7 +3,7 @@ console.log('Background extension is running.'); const _rollbarConfig = { accessToken: 'ROLLBAR_CLIENT_TOKEN', captureUncaught: true, - captureUnhandledRejections: true + captureUnhandledRejections: true, }; // When using es6 module @@ -17,12 +17,12 @@ rollbar.init(_rollbarConfig); // log a generic message and send to rollbar rollbar.info('Service worker message'); -self.addEventListener("install", (event) => { +self.addEventListener('install', (event) => { console.log('Chrome ext service worker install event', event); rollbar.info('Chrome ext service worker install event'); }); -self.addEventListener("activate", (event) => { +self.addEventListener('activate', (event) => { console.log('Chrome ext service worker activate event', event); rollbar.info('Chrome ext service worker activate event'); }); diff --git a/examples/browserify/README.md b/examples/browserify/README.md index a2a15e1eb..d3e1a0616 100644 --- a/examples/browserify/README.md +++ b/examples/browserify/README.md @@ -11,7 +11,7 @@ var rollbarConfig = { captureUncaught: true, payload: { environment: 'development', - } + }, }; var Rollbar = rollbar.init(rollbarConfig); window.Rollbar = Rollbar; @@ -29,9 +29,10 @@ try { ``` ## To build and test the example + 1. Edit index.js and add your Rollbar `POST_CLIENT_ITEM_ACCESS_TOKEN` - Sign up for a free account [here](https://rollbar.com/signup/) -2. ```browserify index.js > all.js``` +2. `browserify index.js > all.js` 3. Open test.html in your browser and click the button 4. Go to your project dashboard and see the error diff --git a/examples/browserify/all.js b/examples/browserify/all.js index a8a43d4a3..148ad2c5d 100644 --- a/examples/browserify/all.js +++ b/examples/browserify/all.js @@ -1,18 +1,1345 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= 6e4 && ((E = o), (_ = 0)); + var i = window._globalRollbarOptions.maxItems, + a = window._globalRollbarOptions.itemsPerMinute, + s = function () { + return !t.ignoreRateLimit && i >= 1 && x >= i; + }, + u = function () { + return !t.ignoreRateLimit && a >= 1 && _ >= a; + }; + return s() + ? void n(new Error(i + ' max items reached')) + : u() + ? void n(new Error(a + ' items per minute reached')) + : (x++, + _++, + s() && + y._log( + y.options.uncaughtErrorLevel, + 'maxItems has been hit. Ignoring errors for the remainder of the current page load.', + null, + { maxItems: i }, + null, + !1, + !0, + ), + t.ignoreRateLimit && delete t.ignoreRateLimit, + void v.post(e, r, t, function (e, r) { + return e ? n(e) : n(null, r); + })); + } + var g, + h = t(4), + d = t(7), + m = t(8), + v = m.XHR, + w = null; + (s.NOTIFIER_VERSION = '1.4.4'), + (s.DEFAULT_ENDPOINT = 'api.rollbar.com/api/1/'), + (s.DEFAULT_SCRUB_FIELDS = [ + 'pw', + 'pass', + 'passwd', + 'password', + 'secret', + 'confirm_password', + 'confirmPassword', + 'password_confirmation', + 'passwordConfirmation', + 'access_token', + 'accessToken', + 'secret_key', + 'secretKey', + 'secretToken', + ]), + (s.DEFAULT_LOG_LEVEL = 'debug'), + (s.DEFAULT_REPORT_LEVEL = 'debug'), + (s.DEFAULT_UNCAUGHT_ERROR_LEVEL = 'warning'), + (s.DEFAULT_ITEMS_PER_MIN = 60), + (s.DEFAULT_MAX_ITEMS = 0), + (s.LEVELS = { + debug: 0, + info: 1, + warning: 2, + error: 3, + critical: 4, + }), + (window._rollbarPayloadQueue = []), + (window._globalRollbarOptions = { + startTime: new Date().getTime(), + maxItems: s.DEFAULT_MAX_ITEMS, + itemsPerMinute: s.DEFAULT_ITEMS_PER_MIN, + }); + var y, + b = s.prototype; + (b._getLogArgs = function (e) { + for ( + var r, + t, + n, + i, + a, + u, + c = this.options.logLevel || s.DEFAULT_LOG_LEVEL, + l = [], + p = 0; + p < e.length; + ++p + ) + (u = e[p]), + (a = d.typeName(u)), + 'string' === a + ? r + ? l.push(u) + : (r = u) + : 'function' === a + ? (i = o(u, this)) + : 'object' === a + ? n + ? l.push(u) + : (n = u) + : 'date' === a + ? l.push(u) + : ('error' === a || + u.stack || + ('undefined' != typeof DOMException && + u instanceof DOMException)) && + (t ? l.push(u) : (t = u)); + return ( + l.length && ((n = n || {}), (n.extraArgs = l)), + { level: c, message: r, err: t, custom: n, callback: i } + ); + }), + (b._route = function (e) { + var r = this.options.endpoint, + t = /\/$/.test(r), + n = /^\//.test(e); + return ( + t && n ? (e = e.substring(1)) : t || n || (e = '/' + e), + r + e + ); + }), + (b._processShimQueue = function (e) { + for (var r, t, n, o, i, a, u, c = {}; (t = e.shift()); ) + (r = t.shim), + (n = t.method), + (o = t.args), + (i = r.parentShim), + (u = c[r.shimId]), + u || + (i ? ((a = c[i.shimId]), (u = new s(a))) : (u = this), + (c[r.shimId] = u)), + u[n] && d.isType(u[n], 'function') && u[n].apply(u, o); + }), + (b._buildPayload = function (e, r, t, n, o) { + var i = this.options.accessToken, + a = this.options.environment, + u = d.copy(this.options.payload), + c = d.uuid4(); + if (void 0 === s.LEVELS[r]) throw new Error('Invalid level'); + if (!t && !n && !o) + throw new Error('No message, stack info or custom data'); + var l = { + environment: a, + endpoint: this.options.endpoint, + uuid: c, + level: r, + platform: 'browser', + framework: 'browser-js', + language: 'javascript', + body: this._buildBody(t, n, o), + request: { + url: window.location.href, + query_string: window.location.search, + user_ip: '$remote_ip', + }, + client: { + runtime_ms: + e.getTime() - window._globalRollbarOptions.startTime, + timestamp: Math.round(e.getTime() / 1e3), + javascript: { + browser: window.navigator.userAgent, + language: window.navigator.language, + cookie_enabled: window.navigator.cookieEnabled, + screen: { + width: window.screen.width, + height: window.screen.height, + }, + plugins: this._getBrowserPlugins(), + }, + }, + server: {}, + notifier: { + name: 'rollbar-browser-js', + version: s.NOTIFIER_VERSION, + }, + }; + u.body && delete u.body; + var p = { access_token: i, data: d.merge(l, u) }; + return this._scrub(p.data), p; + }), + (b._buildBody = function (e, r, t) { + var n; + return (n = r ? l(e, r, t) : c(e, t)); + }), + (b._getBrowserPlugins = function () { + if (!this._browserPlugins) { + var e, + r, + t = window.navigator.plugins || [], + n = t.length, + o = []; + for (r = 0; n > r; ++r) + (e = t[r]), + o.push({ name: e.name, description: e.description }); + this._browserPlugins = o; + } + return this._browserPlugins; + }), + (b._scrub = function (e) { + function r(e, r, t, n, o, i) { + return r + d.redact(i); + } + function t(e) { + var t; + if (d.isType(e, 'string')) + for (t = 0; t < s.length; ++t) e = e.replace(s[t], r); + return e; + } + function n(e, r) { + var t; + for (t = 0; t < a.length; ++t) + if (a[t].test(e)) { + r = d.redact(r); + break; + } + return r; + } + function o(e, r) { + var o = n(e, r); + return o === r ? t(o) : o; + } + var i = this.options.scrubFields, + a = this._getScrubFieldRegexs(i), + s = this._getScrubQueryParamRegexs(i); + return d.traverse(e, o), e; + }), + (b._getScrubFieldRegexs = function (e) { + for (var r, t = [], n = 0; n < e.length; ++n) + (r = '\\[?(%5[bB])?' + e[n] + '\\[?(%5[bB])?\\]?(%5[dD])?'), + t.push(new RegExp(r, 'i')); + return t; + }), + (b._getScrubQueryParamRegexs = function (e) { + for (var r, t = [], n = 0; n < e.length; ++n) + (r = '\\[?(%5[bB])?' + e[n] + '\\[?(%5[bB])?\\]?(%5[dD])?'), + t.push(new RegExp('(' + r + '=)([^&\\n]+)', 'igm')); + return t; + }), + (b._urlIsWhitelisted = function (e) { + var r, t, n, o, i, a, s, u, c, l; + try { + if ( + ((r = this.options.hostWhiteList), + (t = e.data.body.trace), + !r || 0 === r.length) + ) + return !0; + if (!t) return !0; + for (s = r.length, i = t.frames.length, c = 0; i > c; c++) { + if ( + ((n = t.frames[c]), + (o = n.filename), + !d.isType(o, 'string')) + ) + return !0; + for (l = 0; s > l; l++) + if (((a = r[l]), (u = new RegExp(a)), u.test(o))) + return !0; + } + } catch (p) { + return ( + this.configure({ hostWhiteList: null }), + this.error( + "Error while reading your configuration's hostWhiteList option. Removing custom hostWhiteList.", + p, + ), + !0 + ); + } + return !1; + }), + (b._messageIsIgnored = function (e) { + var r, t, n, o, i, a, s; + try { + if ( + ((i = !1), + (n = this.options.ignoredMessages), + (s = e.data.body.trace), + !n || 0 === n.length) + ) + return !1; + if (!s) return !1; + for ( + r = s.exception.message, o = n.length, t = 0; + o > t && ((a = new RegExp(n[t], 'gi')), !(i = a.test(r))); + t++ + ); + } catch (u) { + this.configure({ ignoredMessages: null }), + this.error( + "Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.", + ); + } + return i; + }), + (b._enqueuePayload = function (e, r, t, n) { + var o = { + callback: n, + accessToken: this.options.accessToken, + endpointUrl: this._route('item/'), + payload: e, + }, + a = function () { + if (n) { + var e = + "This item was not sent to Rollbar because it was ignored. This can happen if a custom checkIgnore() function was used or if the item's level was less than the notifier' reportLevel. See https://rollbar.com/docs/notifier/rollbar.js/configuration for more details."; + n(null, { + err: 0, + result: { id: null, uuid: null, message: e }, + }); + } + }; + if (this._internalCheckIgnore(r, t, e)) return void a(); + try { + if ( + d.isType(this.options.checkIgnore, 'function') && + this.options.checkIgnore(r, t, e) + ) + return void a(); + } catch (s) { + this.configure({ checkIgnore: null }), + this.error( + 'Error while calling custom checkIgnore() function. Removing custom checkIgnore().', + s, + ); + } + if (this._urlIsWhitelisted(e) && !this._messageIsIgnored(e)) { + if (this.options.verbose) { + if (e.data && e.data.body && e.data.body.trace) { + var u = e.data.body.trace, + c = u.exception.message; + this.logger(c); + } + this.logger('Sending payload -', o); + } + d.isType(this.options.logFunction, 'function') && + this.options.logFunction(o); + try { + d.isType(this.options.transform, 'function') && + this.options.transform(e); + } catch (s) { + this.configure({ transform: null }), + this.error( + 'Error while calling custom transform() function. Removing custom transform().', + s, + ); + } + this.options.enabled && + (window._rollbarPayloadQueue.push(o), i()); + } + }), + (b._internalCheckIgnore = function (e, r, t) { + var n = r[0], + o = s.LEVELS[n] || 0, + i = s.LEVELS[this.options.reportLevel] || 0; + if (i > o) return !0; + var a = this.options ? this.options.plugins : {}; + if (a && a.jquery && a.jquery.ignoreAjaxErrors) + try { + return !!t.body.message.extra.isAjax; + } catch (u) { + return !1; + } + return !1; + }), + (b._log = function (e, r, t, n, o, i, a) { + var s = null; + if (t) + if (t.stack) { + if ( + ((s = t._savedStackTrace + ? t._savedStackTrace + : h.parse(t)), + t === this.lastError) + ) + return; + this.lastError = t; + } else (r = String(t)), (t = null); + var u = this._buildPayload(new Date(), e, r, s, n); + a && (u.ignoreRateLimit = !0), + this._enqueuePayload(u, i ? !0 : !1, [e, r, t, n], o); + }), + (b.log = u()), + (b.debug = u('debug')), + (b.info = u('info')), + (b.warn = u('warning')), + (b.warning = u('warning')), + (b.error = u('error')), + (b.critical = u('critical')), + (b.uncaughtError = o(function (e, r, t, n, o, i) { + if (((i = i || null), o && o.stack)) + return void this._log( + this.options.uncaughtErrorLevel, + e, + o, + i, + null, + !0, + ); + if (r && r.stack) + return void this._log( + this.options.uncaughtErrorLevel, + e, + r, + i, + null, + !0, + ); + var a = { url: r || '', line: t }; + (a.func = h.guessFunctionName(a.url, a.line)), + (a.context = h.gatherContext(a.url, a.line)); + var s = { + mode: 'onerror', + message: o ? String(o) : e || 'uncaught exception', + url: document.location.href, + stack: [a], + useragent: navigator.userAgent, + }, + u = this._buildPayload( + new Date(), + this.options.uncaughtErrorLevel, + e, + s, + ); + this._enqueuePayload(u, !0, [ + this.options.uncaughtErrorLevel, + e, + r, + t, + n, + o, + ]); + })), + (b.global = o(function (e) { + (e = e || {}), + d.merge(window._globalRollbarOptions, e), + void 0 !== e.maxItems && (x = 0), + void 0 !== e.itemsPerMinute && (_ = 0); + })), + (b.configure = o(function (e) { + d.merge(this.options, e), this.global(e); + })), + (b.scope = o(function (e) { + var r = new s(this); + return d.merge(r.options.payload, e), r; + })), + (b.wrap = function (e, r) { + try { + var t; + if ( + ((t = d.isType(r, 'function') + ? r + : function () { + return r || {}; + }), + !d.isType(e, 'function')) + ) + return e; + if (e._isWrap) return e; + if (!e._wrapped) { + (e._wrapped = function () { + try { + return e.apply(this, arguments); + } catch (r) { + throw ( + (r.stack || (r._savedStackTrace = h.parse(r)), + (r._rollbarContext = t() || {}), + (r._rollbarContext._wrappedSource = e.toString()), + (window._rollbarWrappedError = r), + r) + ); + } + }), + (e._wrapped._isWrap = !0); + for (var n in e) + e.hasOwnProperty(n) && (e._wrapped[n] = e[n]); + } + return e._wrapped; + } catch (o) { + return e; + } + }), + (s.processPayloads = function (e) { + return e ? void p() : void i(); + }); + var E = new Date().getTime(), + x = 0, + _ = 0; + e.exports = { Notifier: s, setupJSON: n, topLevelNotifier: a }; + }, + function (e, r, t) { + 'use strict'; + function n() { + return l; + } + function o() { + return null; + } + function i(e) { + var r = {}; + return ( + (r._stackFrame = e), + (r.url = e.fileName), + (r.line = e.lineNumber), + (r.func = e.functionName), + (r.column = e.columnNumber), + (r.args = e.args), + (r.context = o(r.url, r.line)), + r + ); + } + function a(e) { + function r() { + var r = []; + try { + r = c.parse(e); + } catch (t) { + r = []; + } + for (var n = [], o = 0; o < r.length; o++) + n.push(new i(r[o])); + return n; + } + return { stack: r(), message: e.message, name: e.name }; + } + function s(e) { + return new a(e); + } + function u(e) { + if (!e) + return [ + 'Unknown error. There was no error message to display.', + '', + ]; + var r = e.match(p), + t = '(unknown)'; + return ( + r && + ((t = r[r.length - 1]), + (e = e.replace((r[r.length - 2] || '') + t + ':', '')), + (e = e.replace(/(^[\s]+|[\s]+$)/g, ''))), + [t, e] + ); + } + var c = t(5), + l = '?', + p = new RegExp( + '^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ', + ); + e.exports = { + guessFunctionName: n, + guessErrorClass: u, + gatherContext: o, + parse: s, + Stack: a, + Frame: i, + }; + }, + function (e, r, t) { + var n, o, i; + !(function (a, s) { + 'use strict'; + (o = [t(6)]), + (n = s), + (i = 'function' == typeof n ? n.apply(r, o) : n), + !(void 0 !== i && (e.exports = i)); + })(this, function (e) { + 'use strict'; + var r, + t, + n = /\S+\:\d+/, + o = /\s+at /; + return ( + (r = Array.prototype.map + ? function (e, r) { + return e.map(r); + } + : function (e, r) { + var t, + n = e.length, + o = []; + for (t = 0; n > t; ++t) o.push(r(e[t])); + return o; + }), + (t = Array.prototype.filter + ? function (e, r) { + return e.filter(r); + } + : function (e, r) { + var t, + n = e.length, + o = []; + for (t = 0; n > t; ++t) r(e[t]) && o.push(e[t]); + return o; + }), + { + parse: function (e) { + if ( + 'undefined' != typeof e.stacktrace || + 'undefined' != typeof e['opera#sourceloc'] + ) + return this.parseOpera(e); + if (e.stack && e.stack.match(o)) + return this.parseV8OrIE(e); + if (e.stack && e.stack.match(n)) + return this.parseFFOrSafari(e); + throw new Error('Cannot parse given Error object'); + }, + extractLocation: function (e) { + if (-1 === e.indexOf(':')) return [e]; + var r = e.replace(/[\(\)\s]/g, '').split(':'), + t = r.pop(), + n = r[r.length - 1]; + if (!isNaN(parseFloat(n)) && isFinite(n)) { + var o = r.pop(); + return [r.join(':'), o, t]; + } + return [r.join(':'), t, void 0]; + }, + parseV8OrIE: function (t) { + var n = this.extractLocation, + o = r(t.stack.split('\n').slice(1), function (r) { + var t = r.replace(/^\s+/, '').split(/\s+/).slice(1), + o = n(t.pop()), + i = t[0] && 'Anonymous' !== t[0] ? t[0] : void 0; + return new e(i, void 0, o[0], o[1], o[2]); + }); + return o; + }, + parseFFOrSafari: function (o) { + var i = t(o.stack.split('\n'), function (e) { + return !!e.match(n); + }), + a = this.extractLocation, + s = r(i, function (r) { + var t = r.split('@'), + n = a(t.pop()), + o = t.shift() || void 0; + return new e(o, void 0, n[0], n[1], n[2]); + }); + return s; + }, + parseOpera: function (e) { + return !e.stacktrace || + (e.message.indexOf('\n') > -1 && + e.message.split('\n').length > + e.stacktrace.split('\n').length) + ? this.parseOpera9(e) + : e.stack + ? this.parseOpera11(e) + : this.parseOpera10(e); + }, + parseOpera9: function (r) { + for ( + var t = /Line (\d+).*script (?:in )?(\S+)/i, + n = r.message.split('\n'), + o = [], + i = 2, + a = n.length; + a > i; + i += 2 + ) { + var s = t.exec(n[i]); + s && o.push(new e(void 0, void 0, s[2], s[1])); + } + return o; + }, + parseOpera10: function (r) { + for ( + var t = + /Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i, + n = r.stacktrace.split('\n'), + o = [], + i = 0, + a = n.length; + a > i; + i += 2 + ) { + var s = t.exec(n[i]); + s && o.push(new e(s[3] || void 0, void 0, s[2], s[1])); + } + return o; + }, + parseOpera11: function (o) { + var i = t(o.stack.split('\n'), function (e) { + return !!e.match(n) && !e.match(/^Error created at/); + }), + a = this.extractLocation, + s = r(i, function (r) { + var t, + n = r.split('@'), + o = a(n.pop()), + i = n.shift() || '', + s = + i + .replace(//, '$2') + .replace(/\([^\)]*\)/g, '') || void 0; + i.match(/\(([^\)]*)\)/) && + (t = i.replace(/^[^\(]+\(([^\)]*)\)$/, '$1')); + var u = + void 0 === t || '[arguments not available]' === t + ? void 0 + : t.split(','); + return new e(s, u, o[0], o[1], o[2]); + }); + return s; + }, + } + ); + }); + }, + function (e, r, t) { + var n, o, i; + !(function (t, a) { + 'use strict'; + (o = []), + (n = a), + (i = 'function' == typeof n ? n.apply(r, o) : n), + !(void 0 !== i && (e.exports = i)); + })(this, function () { + 'use strict'; + function e(e) { + return !isNaN(parseFloat(e)) && isFinite(e); + } + function r(e, r, t, n, o) { + void 0 !== e && this.setFunctionName(e), + void 0 !== r && this.setArgs(r), + void 0 !== t && this.setFileName(t), + void 0 !== n && this.setLineNumber(n), + void 0 !== o && this.setColumnNumber(o); + } + return ( + (r.prototype = { + getFunctionName: function () { + return this.functionName; + }, + setFunctionName: function (e) { + this.functionName = String(e); + }, + getArgs: function () { + return this.args; + }, + setArgs: function (e) { + if ( + '[object Array]' !== Object.prototype.toString.call(e) + ) + throw new TypeError('Args must be an Array'); + this.args = e; + }, + getFileName: function () { + return this.fileName; + }, + setFileName: function (e) { + this.fileName = String(e); + }, + getLineNumber: function () { + return this.lineNumber; + }, + setLineNumber: function (r) { + if (!e(r)) + throw new TypeError('Line Number must be a Number'); + this.lineNumber = Number(r); + }, + getColumnNumber: function () { + return this.columnNumber; + }, + setColumnNumber: function (r) { + if (!e(r)) + throw new TypeError('Column Number must be a Number'); + this.columnNumber = Number(r); + }, + toString: function () { + var r = this.getFunctionName() || '{anonymous}', + t = '(' + (this.getArgs() || []).join(',') + ')', + n = this.getFileName() ? '@' + this.getFileName() : '', + o = e(this.getLineNumber()) + ? ':' + this.getLineNumber() + : '', + i = e(this.getColumnNumber()) + ? ':' + this.getColumnNumber() + : ''; + return r + t + n + o + i; + }, + }), + r + ); + }); + }, + function (e, r) { + 'use strict'; + function t(e) { + return {}.toString + .call(e) + .match(/\s([a-zA-Z]+)/)[1] + .toLowerCase(); + } + function n(e, r) { + return t(e) === r; + } + function o() { + var e, + r, + i, + a, + s, + u, + c = arguments[0] || {}, + l = 1, + p = arguments.length, + f = !0, + g = t(c); + for ( + 'object' !== g && + 'array' !== g && + 'function' !== g && + (c = {}); + p > l; + l++ + ) + if (null !== (e = arguments[l])) + for (r in e) + e.hasOwnProperty(r) && + ((i = c[r]), + (a = e[r]), + c !== a && + (f && a && (n(a, 'object') || (s = n(a, 'array'))) + ? (s + ? ((s = !1), (u = [])) + : (u = i && n(i, 'object') ? i : {}), + (c[r] = o(u, a))) + : void 0 !== a && (c[r] = a))); + return c; + } + function i(e) { + var r, + n = t(e); + return (r = { object: {}, array: [] }[n]), o(r, e), r; + } + function a(e) { + if (!n(e, 'string')) throw new Error('received invalid input'); + for ( + var r = p, + t = r.parser[r.strictMode ? 'strict' : 'loose'].exec(e), + o = {}, + i = 14; + i--; -},{"rollbar-browser":2}],2:[function(require,module,exports){ -!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var t=r();for(var n in t)("object"==typeof exports?exports:e)[n]=t[n]}}(this,function(){return function(e){function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var t={};return r.m=e,r.c=t,r.p="",r(0)}([function(e,r,t){e.exports=t(1)},function(e,r,t){"use strict";function n(){var e="undefined"==typeof JSON?{}:JSON;o.setupJSON(e)}var o=t(2),i=t(3);n();var a=window._rollbarConfig,s=a&&a.globalAlias||"Rollbar",u=window[s]&&"undefined"!=typeof window[s].shimId;!u&&a?o.wrapper.init(a):(window.Rollbar=o.wrapper,window.RollbarNotifier=i.Notifier),e.exports=o.wrapper},function(e,r,t){"use strict";function n(e,r,t){!t[4]&&window._rollbarWrappedError&&(t[4]=window._rollbarWrappedError,window._rollbarWrappedError=null),e.uncaughtError.apply(e,t),r&&r.apply(window,t)}function o(e,r){if(r.hasOwnProperty&&r.hasOwnProperty("addEventListener")){var t=r.addEventListener;r.addEventListener=function(r,n,o){t.call(this,r,e.wrap(n),o)};var n=r.removeEventListener;r.removeEventListener=function(e,r,t){n.call(this,e,r&&r._wrapped||r,t)}}}var i=t(3),a=t(7),s=i.Notifier;window._rollbarWrappedError=null;var u={};u.init=function(e,r){var t=new s(r);if(t.configure(e),e.captureUncaught){var i;i=r&&a.isType(r._rollbarOldOnError,"function")?r._rollbarOldOnError:window.onerror,window.onerror=function(){var e=Array.prototype.slice.call(arguments,0);n(t,i,e)};var u,c,l=["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"];for(u=0;u=6e4&&(E=o,_=0);var i=window._globalRollbarOptions.maxItems,a=window._globalRollbarOptions.itemsPerMinute,s=function(){return!t.ignoreRateLimit&&i>=1&&x>=i},u=function(){return!t.ignoreRateLimit&&a>=1&&_>=a};return s()?void n(new Error(i+" max items reached")):u()?void n(new Error(a+" items per minute reached")):(x++,_++,s()&&y._log(y.options.uncaughtErrorLevel,"maxItems has been hit. Ignoring errors for the remainder of the current page load.",null,{maxItems:i},null,!1,!0),t.ignoreRateLimit&&delete t.ignoreRateLimit,void v.post(e,r,t,function(e,r){return e?n(e):n(null,r)}))}var g,h=t(4),d=t(7),m=t(8),v=m.XHR,w=null;s.NOTIFIER_VERSION="1.4.4",s.DEFAULT_ENDPOINT="api.rollbar.com/api/1/",s.DEFAULT_SCRUB_FIELDS=["pw","pass","passwd","password","secret","confirm_password","confirmPassword","password_confirmation","passwordConfirmation","access_token","accessToken","secret_key","secretKey","secretToken"],s.DEFAULT_LOG_LEVEL="debug",s.DEFAULT_REPORT_LEVEL="debug",s.DEFAULT_UNCAUGHT_ERROR_LEVEL="warning",s.DEFAULT_ITEMS_PER_MIN=60,s.DEFAULT_MAX_ITEMS=0,s.LEVELS={debug:0,info:1,warning:2,error:3,critical:4},window._rollbarPayloadQueue=[],window._globalRollbarOptions={startTime:(new Date).getTime(),maxItems:s.DEFAULT_MAX_ITEMS,itemsPerMinute:s.DEFAULT_ITEMS_PER_MIN};var y,b=s.prototype;b._getLogArgs=function(e){for(var r,t,n,i,a,u,c=this.options.logLevel||s.DEFAULT_LOG_LEVEL,l=[],p=0;pr;++r)e=t[r],o.push({name:e.name,description:e.description});this._browserPlugins=o}return this._browserPlugins},b._scrub=function(e){function r(e,r,t,n,o,i){return r+d.redact(i)}function t(e){var t;if(d.isType(e,"string"))for(t=0;tc;c++){if(n=t.frames[c],o=n.filename,!d.isType(o,"string"))return!0;for(l=0;s>l;l++)if(a=r[l],u=new RegExp(a),u.test(o))return!0}}catch(p){return this.configure({hostWhiteList:null}),this.error("Error while reading your configuration's hostWhiteList option. Removing custom hostWhiteList.",p),!0}return!1},b._messageIsIgnored=function(e){var r,t,n,o,i,a,s;try{if(i=!1,n=this.options.ignoredMessages,s=e.data.body.trace,!n||0===n.length)return!1;if(!s)return!1;for(r=s.exception.message,o=n.length,t=0;o>t&&(a=new RegExp(n[t],"gi"),!(i=a.test(r)));t++);}catch(u){this.configure({ignoredMessages:null}),this.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return i},b._enqueuePayload=function(e,r,t,n){var o={callback:n,accessToken:this.options.accessToken,endpointUrl:this._route("item/"),payload:e},a=function(){if(n){var e="This item was not sent to Rollbar because it was ignored. This can happen if a custom checkIgnore() function was used or if the item's level was less than the notifier' reportLevel. See https://rollbar.com/docs/notifier/rollbar.js/configuration for more details.";n(null,{err:0,result:{id:null,uuid:null,message:e}})}};if(this._internalCheckIgnore(r,t,e))return void a();try{if(d.isType(this.options.checkIgnore,"function")&&this.options.checkIgnore(r,t,e))return void a()}catch(s){this.configure({checkIgnore:null}),this.error("Error while calling custom checkIgnore() function. Removing custom checkIgnore().",s)}if(this._urlIsWhitelisted(e)&&!this._messageIsIgnored(e)){if(this.options.verbose){if(e.data&&e.data.body&&e.data.body.trace){var u=e.data.body.trace,c=u.exception.message;this.logger(c)}this.logger("Sending payload -",o)}d.isType(this.options.logFunction,"function")&&this.options.logFunction(o);try{d.isType(this.options.transform,"function")&&this.options.transform(e)}catch(s){this.configure({transform:null}),this.error("Error while calling custom transform() function. Removing custom transform().",s)}this.options.enabled&&(window._rollbarPayloadQueue.push(o),i())}},b._internalCheckIgnore=function(e,r,t){var n=r[0],o=s.LEVELS[n]||0,i=s.LEVELS[this.options.reportLevel]||0;if(i>o)return!0;var a=this.options?this.options.plugins:{};if(a&&a.jquery&&a.jquery.ignoreAjaxErrors)try{return!!t.body.message.extra.isAjax}catch(u){return!1}return!1},b._log=function(e,r,t,n,o,i,a){var s=null;if(t)if(t.stack){if(s=t._savedStackTrace?t._savedStackTrace:h.parse(t),t===this.lastError)return;this.lastError=t}else r=String(t),t=null;var u=this._buildPayload(new Date,e,r,s,n);a&&(u.ignoreRateLimit=!0),this._enqueuePayload(u,i?!0:!1,[e,r,t,n],o)},b.log=u(),b.debug=u("debug"),b.info=u("info"),b.warn=u("warning"),b.warning=u("warning"),b.error=u("error"),b.critical=u("critical"),b.uncaughtError=o(function(e,r,t,n,o,i){if(i=i||null,o&&o.stack)return void this._log(this.options.uncaughtErrorLevel,e,o,i,null,!0);if(r&&r.stack)return void this._log(this.options.uncaughtErrorLevel,e,r,i,null,!0);var a={url:r||"",line:t};a.func=h.guessFunctionName(a.url,a.line),a.context=h.gatherContext(a.url,a.line);var s={mode:"onerror",message:o?String(o):e||"uncaught exception",url:document.location.href,stack:[a],useragent:navigator.userAgent},u=this._buildPayload(new Date,this.options.uncaughtErrorLevel,e,s);this._enqueuePayload(u,!0,[this.options.uncaughtErrorLevel,e,r,t,n,o])}),b.global=o(function(e){e=e||{},d.merge(window._globalRollbarOptions,e),void 0!==e.maxItems&&(x=0),void 0!==e.itemsPerMinute&&(_=0)}),b.configure=o(function(e){d.merge(this.options,e),this.global(e)}),b.scope=o(function(e){var r=new s(this);return d.merge(r.options.payload,e),r}),b.wrap=function(e,r){try{var t;if(t=d.isType(r,"function")?r:function(){return r||{}},!d.isType(e,"function"))return e;if(e._isWrap)return e;if(!e._wrapped){e._wrapped=function(){try{return e.apply(this,arguments)}catch(r){throw r.stack||(r._savedStackTrace=h.parse(r)),r._rollbarContext=t()||{},r._rollbarContext._wrappedSource=e.toString(),window._rollbarWrappedError=r,r}},e._wrapped._isWrap=!0;for(var n in e)e.hasOwnProperty(n)&&(e._wrapped[n]=e[n])}return e._wrapped}catch(o){return e}},s.processPayloads=function(e){return e?void p():void i()};var E=(new Date).getTime(),x=0,_=0;e.exports={Notifier:s,setupJSON:n,topLevelNotifier:a}},function(e,r,t){"use strict";function n(){return l}function o(){return null}function i(e){var r={};return r._stackFrame=e,r.url=e.fileName,r.line=e.lineNumber,r.func=e.functionName,r.column=e.columnNumber,r.args=e.args,r.context=o(r.url,r.line),r}function a(e){function r(){var r=[];try{r=c.parse(e)}catch(t){r=[]}for(var n=[],o=0;ot;++t)o.push(r(e[t]));return o},t=Array.prototype.filter?function(e,r){return e.filter(r)}:function(e,r){var t,n=e.length,o=[];for(t=0;n>t;++t)r(e[t])&&o.push(e[t]);return o},{parse:function(e){if("undefined"!=typeof e.stacktrace||"undefined"!=typeof e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(o))return this.parseV8OrIE(e);if(e.stack&&e.stack.match(n))return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var r=e.replace(/[\(\)\s]/g,"").split(":"),t=r.pop(),n=r[r.length-1];if(!isNaN(parseFloat(n))&&isFinite(n)){var o=r.pop();return[r.join(":"),o,t]}return[r.join(":"),t,void 0]},parseV8OrIE:function(t){var n=this.extractLocation,o=r(t.stack.split("\n").slice(1),function(r){var t=r.replace(/^\s+/,"").split(/\s+/).slice(1),o=n(t.pop()),i=t[0]&&"Anonymous"!==t[0]?t[0]:void 0;return new e(i,void 0,o[0],o[1],o[2])});return o},parseFFOrSafari:function(o){var i=t(o.stack.split("\n"),function(e){return!!e.match(n)}),a=this.extractLocation,s=r(i,function(r){var t=r.split("@"),n=a(t.pop()),o=t.shift()||void 0;return new e(o,void 0,n[0],n[1],n[2])});return s},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(r){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=r.message.split("\n"),o=[],i=2,a=n.length;a>i;i+=2){var s=t.exec(n[i]);s&&o.push(new e(void 0,void 0,s[2],s[1]))}return o},parseOpera10:function(r){for(var t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=r.stacktrace.split("\n"),o=[],i=0,a=n.length;a>i;i+=2){var s=t.exec(n[i]);s&&o.push(new e(s[3]||void 0,void 0,s[2],s[1]))}return o},parseOpera11:function(o){var i=t(o.stack.split("\n"),function(e){return!!e.match(n)&&!e.match(/^Error created at/)}),a=this.extractLocation,s=r(i,function(r){var t,n=r.split("@"),o=a(n.pop()),i=n.shift()||"",s=i.replace(//,"$2").replace(/\([^\)]*\)/g,"")||void 0;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var u=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new e(s,u,o[0],o[1],o[2])});return s}}})},function(e,r,t){var n,o,i;!function(t,a){"use strict";o=[],n=a,i="function"==typeof n?n.apply(r,o):n,!(void 0!==i&&(e.exports=i))}(this,function(){"use strict";function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function r(e,r,t,n,o){void 0!==e&&this.setFunctionName(e),void 0!==r&&this.setArgs(r),void 0!==t&&this.setFileName(t),void 0!==n&&this.setLineNumber(n),void 0!==o&&this.setColumnNumber(o)}return r.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(e){this.functionName=String(e)},getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getFileName:function(){return this.fileName},setFileName:function(e){this.fileName=String(e)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(r){if(!e(r))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(r)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(r){if(!e(r))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(r)},toString:function(){var r=this.getFunctionName()||"{anonymous}",t="("+(this.getArgs()||[]).join(",")+")",n=this.getFileName()?"@"+this.getFileName():"",o=e(this.getLineNumber())?":"+this.getLineNumber():"",i=e(this.getColumnNumber())?":"+this.getColumnNumber():"";return r+t+n+o+i}},r})},function(e,r){"use strict";function t(e){return{}.toString.call(e).match(/\s([a-zA-Z]+)/)[1].toLowerCase()}function n(e,r){return t(e)===r}function o(){var e,r,i,a,s,u,c=arguments[0]||{},l=1,p=arguments.length,f=!0,g=t(c);for("object"!==g&&"array"!==g&&"function"!==g&&(c={});p>l;l++)if(null!==(e=arguments[l]))for(r in e)e.hasOwnProperty(r)&&(i=c[r],a=e[r],c!==a&&(f&&a&&(n(a,"object")||(s=n(a,"array")))?(s?(s=!1,u=[]):u=i&&n(i,"object")?i:{},c[r]=o(u,a)):void 0!==a&&(c[r]=a)));return c}function i(e){var r,n=t(e);return r={object:{},array:[]}[n],o(r,e),r}function a(e){if(!n(e,"string"))throw new Error("received invalid input");for(var r=p,t=r.parser[r.strictMode?"strict":"loose"].exec(e),o={},i=14;i--;)o[r.key[i]]=t[i]||"";return o[r.q.name]={},o[r.key[12]].replace(r.q.parser,function(e,t,n){t&&(o[r.q.name][t]=n)}),o}function s(e){var r=a(e);return""===r.anchor&&(r.source=r.source.replace("#","")),e=r.source.replace("?"+r.query,"")}function u(e,r){var t,o,i,a=n(e,"object"),s=n(e,"array"),c=[];if(a)for(t in e)e.hasOwnProperty(t)&&c.push(t);else if(s)for(i=0;ie;e++)try{r=t[e]();break}catch(o){}return r},post:function(e,r,t,n){if(!o.isType(t,"object"))throw new Error("Expected an object to POST");t=i.stringify(t),n=n||function(){};var s=a.createXMLHTTPObject();if(s)try{try{var u=function(){try{u&&4===s.readyState&&(u=void 0,200===s.status?n(null,i.parse(s.responseText)):n(o.isType(s.status,"number")&&s.status>=400&&s.status<600?new Error(String(s.status)):new Error))}catch(e){var r;r=e&&e.stack?e:new Error(e),n(r)}};s.open("POST",e,!0),s.setRequestHeader&&(s.setRequestHeader("Content-Type","application/json"),s.setRequestHeader("X-Rollbar-Access-Token",r)),s.onreadystatechange=u,s.send(t)}catch(c){if("undefined"!=typeof XDomainRequest){var l=function(){n(new Error)},p=function(){n(new Error)},f=function(){n(null,i.parse(s.responseText))};s=new XDomainRequest,s.onprogress=function(){},s.ontimeout=l,s.onerror=p,s.onload=f,s.open("POST",e,!0),s.send(t)}}}catch(g){n(g)}}};e.exports={XHR:a,setupJSON:n}}])}); -},{}]},{},[1]); + ) + o[r.key[i]] = t[i] || ''; + return ( + (o[r.q.name] = {}), + o[r.key[12]].replace(r.q.parser, function (e, t, n) { + t && (o[r.q.name][t] = n); + }), + o + ); + } + function s(e) { + var r = a(e); + return ( + '' === r.anchor && (r.source = r.source.replace('#', '')), + (e = r.source.replace('?' + r.query, '')) + ); + } + function u(e, r) { + var t, + o, + i, + a = n(e, 'object'), + s = n(e, 'array'), + c = []; + if (a) for (t in e) e.hasOwnProperty(t) && c.push(t); + else if (s) for (i = 0; i < e.length; ++i) c.push(i); + for (i = 0; i < c.length; ++i) + (t = c[i]), + (o = e[t]), + (a = n(o, 'object')), + (s = n(o, 'array')), + a || s ? (e[t] = u(o, r)) : (e[t] = r(t, o)); + return e; + } + function c(e) { + return (e = String(e)), new Array(e.length + 1).join('*'); + } + function l() { + var e = new Date().getTime(), + r = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace( + /[xy]/g, + function (r) { + var t = (e + 16 * Math.random()) % 16 | 0; + return ( + (e = Math.floor(e / 16)), + ('x' === r ? t : (7 & t) | 8).toString(16) + ); + }, + ); + return r; + } + var p = { + strictMode: !1, + key: [ + 'source', + 'protocol', + 'authority', + 'userInfo', + 'user', + 'password', + 'host', + 'port', + 'relative', + 'path', + 'directory', + 'file', + 'query', + 'anchor', + ], + q: { name: 'queryKey', parser: /(?:^|&)([^&=]*)=?([^&]*)/g }, + parser: { + strict: + /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, + loose: + /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/, + }, + }, + f = { + copy: i, + isType: n, + merge: o, + parseUri: a, + parseUriOptions: p, + redact: c, + sanitizeUrl: s, + traverse: u, + typeName: t, + uuid4: l, + }; + e.exports = f; + }, + function (e, r, t) { + 'use strict'; + function n(e) { + i = e; + } + var o = t(7), + i = null, + a = { + XMLHttpFactories: [ + function () { + return new XMLHttpRequest(); + }, + function () { + return new ActiveXObject('Msxml2.XMLHTTP'); + }, + function () { + return new ActiveXObject('Msxml3.XMLHTTP'); + }, + function () { + return new ActiveXObject('Microsoft.XMLHTTP'); + }, + ], + createXMLHTTPObject: function () { + var e, + r = !1, + t = a.XMLHttpFactories, + n = t.length; + for (e = 0; n > e; e++) + try { + r = t[e](); + break; + } catch (o) {} + return r; + }, + post: function (e, r, t, n) { + if (!o.isType(t, 'object')) + throw new Error('Expected an object to POST'); + (t = i.stringify(t)), (n = n || function () {}); + var s = a.createXMLHTTPObject(); + if (s) + try { + try { + var u = function () { + try { + u && + 4 === s.readyState && + ((u = void 0), + 200 === s.status + ? n(null, i.parse(s.responseText)) + : n( + o.isType(s.status, 'number') && + s.status >= 400 && + s.status < 600 + ? new Error(String(s.status)) + : new Error(), + )); + } catch (e) { + var r; + (r = e && e.stack ? e : new Error(e)), n(r); + } + }; + s.open('POST', e, !0), + s.setRequestHeader && + (s.setRequestHeader( + 'Content-Type', + 'application/json', + ), + s.setRequestHeader('X-Rollbar-Access-Token', r)), + (s.onreadystatechange = u), + s.send(t); + } catch (c) { + if ('undefined' != typeof XDomainRequest) { + var l = function () { + n(new Error()); + }, + p = function () { + n(new Error()); + }, + f = function () { + n(null, i.parse(s.responseText)); + }; + (s = new XDomainRequest()), + (s.onprogress = function () {}), + (s.ontimeout = l), + (s.onerror = p), + (s.onload = f), + s.open('POST', e, !0), + s.send(t); + } + } + } catch (g) { + n(g); + } + }, + }; + e.exports = { XHR: a, setupJSON: n }; + }, + ]); + }); + }, + {}, + ], + }, + {}, + [1], +); diff --git a/examples/browserify/index.js b/examples/browserify/index.js index 20e61c917..24afbd396 100644 --- a/examples/browserify/index.js +++ b/examples/browserify/index.js @@ -5,7 +5,7 @@ var rollbarConfig = { captureUncaught: true, payload: { environment: 'development', - } + }, }; var Rollbar = rollbar.init(rollbarConfig); diff --git a/examples/csp-errors.html b/examples/csp-errors.html index df17e531f..9c239cc60 100644 --- a/examples/csp-errors.html +++ b/examples/csp-errors.html @@ -1,10 +1,9 @@ - - - Generate CSP error for test automation - - - - + + + Generate CSP error for test automation + + + diff --git a/examples/error.html b/examples/error.html index 9202d68c6..4f7d9c324 100644 --- a/examples/error.html +++ b/examples/error.html @@ -1,49 +1,61 @@ - - - Generate errors for test automation - - - - -
-

- Generate errors for test automation -

-
- - - - + // set hash location + window.location.hash = 'test'; + }; + + + +
+

Generate errors for test automation

+
+ + + + + diff --git a/examples/extension-exceptions/test.html b/examples/extension-exceptions/test.html index ded6fa72c..155b4e727 100644 --- a/examples/extension-exceptions/test.html +++ b/examples/extension-exceptions/test.html @@ -1,53 +1,64 @@ - - - - -
- - - - - + + + + +
+ + + + + diff --git a/examples/functions.js b/examples/functions.js index 9dbba52ab..12a0788f5 100644 --- a/examples/functions.js +++ b/examples/functions.js @@ -3,7 +3,7 @@ function functionA() { try { var a = b; - } catch(e) { + } catch (e) { Rollbar.error(e); } diff --git a/examples/include_custom_object.html b/examples/include_custom_object.html index 1982723b0..6cd05d133 100644 --- a/examples/include_custom_object.html +++ b/examples/include_custom_object.html @@ -2,15 +2,15 @@ - -

- -

- See results: rollbar/rollbar.js#420 - + +

+ +

+ See results: + rollbar/rollbar.js#420 diff --git a/examples/itemsPerMinute.html b/examples/itemsPerMinute.html index a13184e6c..6fb31b090 100644 --- a/examples/itemsPerMinute.html +++ b/examples/itemsPerMinute.html @@ -2,22 +2,448 @@ diff --git a/examples/no-conflict/README.md b/examples/no-conflict/README.md index a97c0e3bf..ecc66de1e 100644 --- a/examples/no-conflict/README.md +++ b/examples/no-conflict/README.md @@ -1,5 +1,5 @@ -* npm install -* npm start +- npm install +- npm start This only uses a server to get around CORS for loading the rollbar library from a local file via the snippet. diff --git a/examples/no-conflict/server.js b/examples/no-conflict/server.js index 9b342d384..982a0c7ed 100644 --- a/examples/no-conflict/server.js +++ b/examples/no-conflict/server.js @@ -27,5 +27,9 @@ app.listen(port, '0.0.0.0', function onStart(err) { if (err) { console.log(err); } - console.info('==> 🌎 Listening on port %s. Open up http://0.0.0.0:%s/ in your browser.', port, port); + console.info( + '==> 🌎 Listening on port %s. Open up http://0.0.0.0:%s/ in your browser.', + port, + port, + ); }); diff --git a/examples/no-conflict/test.html b/examples/no-conflict/test.html index 1f904e546..aa6d387d2 100644 --- a/examples/no-conflict/test.html +++ b/examples/no-conflict/test.html @@ -1,15 +1,13 @@ - + diff --git a/examples/no-conflict/tool.js b/examples/no-conflict/tool.js index 9ec6ebbc7..f1a706550 100644 --- a/examples/no-conflict/tool.js +++ b/examples/no-conflict/tool.js @@ -4,9 +4,9 @@ var Rollbar = require('rollbar/dist/rollbar.noconflict.umd'); const rollbar = new Rollbar({ accessToken: 'POST_CLIENT_ITEM_TOKEN', captureUncaught: true, - captureUnhandledRejections: true -}) + captureUnhandledRejections: true, +}); module.exports = function tool(x) { - rollbar.log('foobar got data', {x}) -} + rollbar.log('foobar got data', { x }); +}; diff --git a/examples/no-conflict/webpack.config.js b/examples/no-conflict/webpack.config.js index b365dcc93..217ed0611 100644 --- a/examples/no-conflict/webpack.config.js +++ b/examples/no-conflict/webpack.config.js @@ -3,31 +3,35 @@ const path = require('path'); const webpack = require('webpack'); -module.exports = [{ - name: 'frontend', - devtool: 'eval-source-map', - entry: path.join(__dirname, '/tool.js'), - output: { - path: path.join(__dirname, '/dist/'), - filename: 'tool.js', - libraryTarget: 'umd', - library: 'tool' +module.exports = [ + { + name: 'frontend', + devtool: 'eval-source-map', + entry: path.join(__dirname, '/tool.js'), + output: { + path: path.join(__dirname, '/dist/'), + filename: 'tool.js', + libraryTarget: 'umd', + library: 'tool', + }, + plugins: [ + new webpack.optimize.OccurrenceOrderPlugin(), + new webpack.NoErrorsPlugin(), + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('development'), + }), + ], + module: { + loaders: [ + { + test: /\.jsx?$/, + exclude: /node_modules/, + loader: 'babel', + query: { + presets: ['es2015', 'stage-0'], + }, + }, + ], + }, }, - plugins: [ - new webpack.optimize.OccurrenceOrderPlugin(), - new webpack.NoErrorsPlugin(), - new webpack.DefinePlugin({ - 'process.env.NODE_ENV': JSON.stringify('development') - }) - ], - module: { - loaders: [{ - test: /\.jsx?$/, - exclude: /node_modules/, - loader: 'babel', - query: { - "presets": ["es2015", "stage-0"] - } - }] - } -}]; +]; diff --git a/examples/node-dist/index.js b/examples/node-dist/index.js index f4acb4515..912896e34 100644 --- a/examples/node-dist/index.js +++ b/examples/node-dist/index.js @@ -1,13 +1,13 @@ -"use strict"; +'use strict'; module.exports = function error() { - class CustomError extends Error { - constructor(message) { - super(`Lorem "${message}" ipsum dolor.`); - this.name = 'CustomError'; - } + class CustomError extends Error { + constructor(message) { + super(`Lorem "${message}" ipsum dolor.`); + this.name = 'CustomError'; } - // TypeScript code snippet will include `` - var error = new CustomError('foo'); - throw error; + } + // TypeScript code snippet will include `` + var error = new CustomError('foo'); + throw error; }; //# sourceMappingURL=index.js.map diff --git a/examples/node-typescript/src/index.ts b/examples/node-typescript/src/index.ts index 359069972..e65331758 100644 --- a/examples/node-typescript/src/index.ts +++ b/examples/node-typescript/src/index.ts @@ -1,5 +1,4 @@ export = function error() { - class CustomError extends Error { constructor(message: string) { super(`Lorem "${message}" ipsum dolor.`); @@ -7,6 +6,6 @@ export = function error() { } } // TypeScript code snippet will include `` - var error = new CustomError('foo'); + var error = new CustomError('foo'); throw error; -} +}; diff --git a/examples/node-typescript/tsconfig.json b/examples/node-typescript/tsconfig.json index 9eba31973..c8a924fce 100644 --- a/examples/node-typescript/tsconfig.json +++ b/examples/node-typescript/tsconfig.json @@ -5,10 +5,6 @@ "outDir": "dist", "sourceMap": true }, - "include": [ - "src/**/*.ts" - ], - "exclude": [ - "node_modules" - ] + "include": ["src/**/*.ts"], + "exclude": ["node_modules"] } diff --git a/examples/react/src/TestError.js b/examples/react/src/TestError.js index a1b1a9186..dea3f3b3d 100644 --- a/examples/react/src/TestError.js +++ b/examples/react/src/TestError.js @@ -23,7 +23,9 @@ class TestError extends React.Component { return (

Rollbar Example for React Child Component

- +
); } diff --git a/examples/react/src/index.html b/examples/react/src/index.html index e31c48889..dd446a8f9 100644 --- a/examples/react/src/index.html +++ b/examples/react/src/index.html @@ -1,12 +1,12 @@ - + - - - - - React Example - - -
- + + + + + React Example + + +
+ diff --git a/examples/react/src/index.js b/examples/react/src/index.js index 2654adc92..ed0f23707 100644 --- a/examples/react/src/index.js +++ b/examples/react/src/index.js @@ -1,6 +1,6 @@ -import React from "react"; -import ReactDOM from "react-dom"; -import Rollbar from "rollbar"; +import React from 'react'; +import ReactDOM from 'react-dom'; +import Rollbar from 'rollbar'; import ErrorBoundary from './ErrorBoundary'; import TestError from './TestError'; @@ -14,7 +14,7 @@ class App extends React.Component { accessToken: 'POST_CLIENT_ITEM_TOKEN', captureUncaught: true, captureUnhandledRejections: true, - }) + }), }; this.logInfo = this.logInfo.bind(this); @@ -34,15 +34,19 @@ class App extends React.Component { render() { return ( -

Rollbar Example for React

- - - - +

Rollbar Example for React

+ + + +
); } } -ReactDOM.render(, document.getElementById("index")); +ReactDOM.render(, document.getElementById('index')); diff --git a/examples/react/webpack.config.js b/examples/react/webpack.config.js index caa6a091a..74db617d6 100644 --- a/examples/react/webpack.config.js +++ b/examples/react/webpack.config.js @@ -1,15 +1,15 @@ -const HtmlWebPackPlugin = require("html-webpack-plugin"); +const HtmlWebPackPlugin = require('html-webpack-plugin'); const htmlPlugin = new HtmlWebPackPlugin({ - template: "./src/index.html", - filename: "./index.html" + template: './src/index.html', + filename: './index.html', }); module.exports = (_env, argv) => ({ output: { // rollbar.js tests require modified asset path. // Detect whether running JIT or building the webpack bundle. - publicPath: (argv.build ? '/examples/react/dist/' : '') + publicPath: argv.build ? '/examples/react/dist/' : '', }, module: { rules: [ @@ -17,10 +17,10 @@ module.exports = (_env, argv) => ({ test: /\.js$/, exclude: /node_modules/, use: { - loader: "babel-loader" - } - } - ] + loader: 'babel-loader', + }, + }, + ], }, - plugins: [htmlPlugin] + plugins: [htmlPlugin], }); diff --git a/examples/requirejs/README.md b/examples/requirejs/README.md index 736fcdc4d..faa6e598f 100644 --- a/examples/requirejs/README.md +++ b/examples/requirejs/README.md @@ -2,35 +2,34 @@ 1. Require and initialize the Rollbar javascript module: - ```js - - // - // Download the latest rollbar.umd.nojson.min.js and place in current directory. - var rollbarConfig = { - accessToken: '...', - captureUncaught: true, - payload: { - environment: 'development', - } - }; - - // Require the Rollbar library - require(["rollbar.umd.nojson.min.js"], function(Rollbar) { - var rollbar = Rollbar.init(rollbarConfig); - rollbar.info('Hello world'); - }); - ``` +```js +// +// Download the latest rollbar.umd.nojson.min.js and place in current directory. +var rollbarConfig = { + accessToken: '...', + captureUncaught: true, + payload: { + environment: 'development', + }, +}; + +// Require the Rollbar library +require(['rollbar.umd.nojson.min.js'], function (Rollbar) { + var rollbar = Rollbar.init(rollbarConfig); + rollbar.info('Hello world'); +}); +``` 2. Report exceptions and messages in your code: - ```js - try { - foo(); - rollbar.debug('foo() called'); - } catch (e) { - rollbar.error('Problem calling foo()', e); - } - ``` +```js +try { + foo(); + rollbar.debug('foo() called'); +} catch (e) { + rollbar.error('Problem calling foo()', e); +} +``` ## Test the example diff --git a/examples/requirejs/test.html b/examples/requirejs/test.html index b749cd5fc..9b8eed9e8 100644 --- a/examples/requirejs/test.html +++ b/examples/requirejs/test.html @@ -9,7 +9,7 @@ captureUncaught: true, payload: { environment: 'development', - } + }, }; // You can either use the snippet or load asynchronously via requirejs @@ -18,21 +18,20 @@ // NOTE: you must use the name "rollbar" here. require.config({ paths: { - rollbar: '../../dist/rollbar.umd' - } + rollbar: '../../dist/rollbar.umd', + }, }); - require(['rollbar'], - // Note: clicking on the "Foo" button below before the Rollbar - // module is loaded and initialized will not Report the - // exception to Rollbar. - function(Rollbar) { + require([ + 'rollbar', + ], // Note: clicking on the "Foo" button below before the Rollbar + // module is loaded and initialized will not Report the + // exception to Rollbar. + function (Rollbar) { + var rollbar = new Rollbar(_rollbarConfig); - var rollbar = new Rollbar(_rollbarConfig); - - rollbar.info('Hello world'); - } - ); + rollbar.info('Hello world'); + }); diff --git a/examples/script.html b/examples/script.html index 4cec3f6eb..d7fafeb8b 100644 --- a/examples/script.html +++ b/examples/script.html @@ -3,11 +3,11 @@ diff --git a/examples/snippet.html b/examples/snippet.html index 5b351f930..f6058d1ff 100644 --- a/examples/snippet.html +++ b/examples/snippet.html @@ -3,20 +3,446 @@ - + diff --git a/examples/test.html b/examples/test.html index d7fc037cd..45bce20d1 100644 --- a/examples/test.html +++ b/examples/test.html @@ -1,15 +1,13 @@ - + diff --git a/examples/universal-browser/README.md b/examples/universal-browser/README.md index a97c0e3bf..ecc66de1e 100644 --- a/examples/universal-browser/README.md +++ b/examples/universal-browser/README.md @@ -1,5 +1,5 @@ -* npm install -* npm start +- npm install +- npm start This only uses a server to get around CORS for loading the rollbar library from a local file via the snippet. diff --git a/examples/universal-browser/server.js b/examples/universal-browser/server.js index 3b38cf72e..8c2815b63 100644 --- a/examples/universal-browser/server.js +++ b/examples/universal-browser/server.js @@ -10,9 +10,9 @@ const app = express(); app.use(express.static(path.join(__dirname))); app.get('/rollbar.js', function response(req, res) { var t = (req.query.t || 0.01) * 100; - console.log("Waiting: ", t, "ms"); - setTimeout(function() { - res.sendFile(path.join(__dirname, '../../dist/rollbar.umd.js')) + console.log('Waiting: ', t, 'ms'); + setTimeout(function () { + res.sendFile(path.join(__dirname, '../../dist/rollbar.umd.js')); }, t); }); @@ -21,12 +21,16 @@ app.get('/test', function response(req, res) { }); app.get('/sample', function response(req, res) { - res.status(200).json({'hello': 'world'}); + res.status(200).json({ hello: 'world' }); }); app.listen(port, '0.0.0.0', function onStart(err) { if (err) { console.log(err); } - console.info('==> 🌎 Listening on port %s. Open up http://0.0.0.0:%s/ in your browser.', port, port); + console.info( + '==> 🌎 Listening on port %s. Open up http://0.0.0.0:%s/ in your browser.', + port, + port, + ); }); diff --git a/examples/universal-browser/test-with-non-default-options.html b/examples/universal-browser/test-with-non-default-options.html index 73f7fb9a5..1d0e475e2 100644 --- a/examples/universal-browser/test-with-non-default-options.html +++ b/examples/universal-browser/test-with-non-default-options.html @@ -2,23 +2,448 @@ -

Test snippet with non-default options.

diff --git a/examples/universal-browser/test.html b/examples/universal-browser/test.html index 3b6ff5257..2bb38cc82 100644 --- a/examples/universal-browser/test.html +++ b/examples/universal-browser/test.html @@ -1,15 +1,13 @@ - +
@@ -62,7 +486,12 @@
- +