rollbar 3.0.0-beta.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.git-blame-ignore-revs +3 -1
- package/AGENTS.md +21 -0
- package/CONTRIBUTING.md +68 -73
- package/babel.config.json +7 -0
- package/bower.json +1 -1
- package/dist/plugins/jquery.min.js +1 -1
- package/dist/rollbar.cjs +2216 -2022
- package/dist/rollbar.js +6098 -5886
- package/dist/rollbar.js.map +1 -1
- package/dist/rollbar.min.cjs +1 -1
- package/dist/rollbar.min.cjs.LICENSE.txt +1 -1
- package/dist/rollbar.min.js +1 -1
- package/dist/rollbar.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.min.js.map +1 -1
- package/dist/rollbar.named-amd.js +6097 -5886
- package/dist/rollbar.named-amd.js.map +1 -1
- package/dist/rollbar.named-amd.min.js +1 -1
- package/dist/rollbar.named-amd.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.named-amd.min.js.map +1 -1
- package/dist/rollbar.noconflict.umd.js +6097 -5886
- package/dist/rollbar.noconflict.umd.js.map +1 -1
- package/dist/rollbar.noconflict.umd.min.js +1 -1
- package/dist/rollbar.noconflict.umd.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.noconflict.umd.min.js.map +1 -1
- package/dist/rollbar.replay.js +8123 -7924
- package/dist/rollbar.replay.js.map +1 -1
- package/dist/rollbar.replay.min.js +1 -1
- package/dist/rollbar.replay.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.replay.min.js.map +1 -1
- package/dist/rollbar.replay.noconflict.umd.js +8122 -7924
- package/dist/rollbar.replay.noconflict.umd.js.map +1 -1
- package/dist/rollbar.replay.noconflict.umd.min.js +1 -1
- package/dist/rollbar.replay.noconflict.umd.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.replay.noconflict.umd.min.js.map +1 -1
- package/dist/rollbar.replay.umd.js +8122 -7924
- package/dist/rollbar.replay.umd.js.map +1 -1
- package/dist/rollbar.replay.umd.min.js +1 -1
- package/dist/rollbar.replay.umd.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.replay.umd.min.js.map +1 -1
- package/dist/rollbar.snippet.js +1 -1
- package/dist/rollbar.umd.js +6097 -5886
- package/dist/rollbar.umd.js.map +1 -1
- package/dist/rollbar.umd.min.js +1 -1
- package/dist/rollbar.umd.min.js.LICENSE.txt +1 -1
- package/dist/rollbar.umd.min.js.map +1 -1
- package/eslint.config.js +151 -0
- package/index.d.ts +45 -13
- package/package.json +26 -6
- package/src/api.js +130 -136
- package/src/apiUtility.js +2 -2
- package/src/browser/bundles/rollbar.snippet.js +1 -0
- package/src/browser/core.js +31 -42
- package/src/browser/domUtility.js +11 -17
- package/src/browser/globalSetup.js +3 -3
- package/src/browser/replay/checkoutWatchdog.js +104 -0
- package/src/browser/replay/recorder.d.ts +5 -2
- package/src/browser/replay/recorder.js +22 -4
- package/src/browser/replay/replay.js +8 -4
- package/src/browser/replay/replayPredicates.js +1 -1
- package/src/browser/rollbar.js +5 -4
- package/src/browser/rollbarReplay.js +6 -5
- package/src/browser/rollbarWrapper.js +2 -2
- package/src/browser/shim.js +15 -15
- package/src/browser/telemetry.js +26 -22
- package/src/browser/transforms.js +4 -4
- package/src/browser/transport/xhr.js +4 -4
- package/src/browser/transport.js +9 -10
- package/src/browser/wrapGlobals.js +3 -4
- package/src/defaults.js +1 -1
- package/src/errorParser.js +1 -1
- package/src/logger.js +1 -0
- package/src/notifier.js +102 -100
- package/src/predicates.js +3 -4
- package/src/rateLimiter.js +107 -104
- package/src/react-native/rollbar.js +9 -10
- package/src/react-native/transforms.js +4 -5
- package/src/react-native/transport.js +7 -7
- package/src/rollbar.js +7 -4
- package/src/scrub.js +16 -20
- package/src/server/locals.js +7 -7
- package/src/server/parser.js +9 -6
- package/src/server/rollbar.js +54 -49
- package/src/server/sourceMap/stackTrace.js +7 -6
- package/src/server/telemetry/urlHelpers.js +2 -1
- package/src/server/telemetry.js +10 -10
- package/src/server/transforms.js +10 -6
- package/src/server/transport.js +8 -7
- package/src/telemetry.js +22 -25
- package/src/tracing/tracer.js +2 -2
- package/src/tracing/tracing.js +2 -2
- package/src/truncation.js +6 -6
- package/src/utility/headers.js +4 -2
- package/src/utility/traverse.js +1 -1
- package/src/utility.js +111 -33
- package/tsconfig.json +16 -0
- package/tsconfig.test.json +10 -0
- package/{web-test-runner.config.mjs → web-test-runner.config.js} +10 -0
- package/{webpack.config.cjs → webpack.config.js} +39 -27
- package/.eslintrc +0 -27
- package/eslint.config.mjs +0 -33
- package/src/merge.js +0 -61
package/dist/rollbar.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see rollbar.min.js.LICENSE.txt */
|
|
2
|
-
!function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{parse:function(){return Et}});var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=function(t){if(!t||"[object Object]"!==n.call(t))return!1;var e,o=r.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&r.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!o&&!i)return!1;for(e in t);return void 0===e||r.call(t,e)};var i=function t(){var e,r,n,i,a,s=Object.create(null),u=null,l=arguments.length;for(e=0;e<l;e++)if(null!=(u=arguments[e]))for(a in u)r=s[a],s!==(n=u[a])&&(n&&o(n)?(i=r&&o(r)?r:{},s[a]=t(i,n)):void 0!==n&&(s[a]=n));return s};function a(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return s(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){u=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function s(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(t,e){return e===c(t)}function c(t){var e=u(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function f(t){return l(t,"function")}function p(t){var e=u(t);return null!=t&&("object"==e||"function"==e)}function h(t){return Number.isFinite(t)}function d(t){return l(t,"error")||l(t,"exception")}var y={debug:0,info:1,warning:2,error:3,critical:4};function v(t){var e=function(t){if(!l(t,"string"))return;for(var e=m,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,i=e.key.length;o<i;++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)"}var m={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 b(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}function g(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&f(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function w(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function k(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function _(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function S(t){return function t(e,r){var n,o,i,a={};try{for(o in e)(n=e[o])&&(l(n,"object")||l(n,"array"))?r.includes(n)?a[o]="Removed circular reference: "+c(n):((i=r.slice()).push(n),a[o]=t(n,i)):a[o]=n}catch(t){a="Failed cloning custom data: "+t.message}return a}(t,[t])}function O(t,e,r,n,o){for(var i,a,s,u,l,f,p=[],h=[],d=0,y=t.length;d<y;++d){var v=c(f=t[d]);switch(h.push(v),v){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":u=_(e,f);break;case"date":p.push(f);break;case"error":case"domexception":case"exception":a?p.push(f):a=f;break;case"object":case"array":if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}if(n&&"object"===v&&!l){for(var m=0,b=n.length;m<b;++m)if(void 0!==f[n[m]]){l=f;break}if(l)break}s?p.push(f):s=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){a?p.push(f):a=f;break}p.push(f)}}s&&(s=S(s)),p.length>0&&(s||(s=S({})),s.extraArgs=S(p));var g,w={message:i,err:a,custom:s,timestamp:A(),callback:u,notifier:r,diagnostic:{},uuid:(g=A(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)})))};return w.data=w.data||{},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)}(w,s),n&&l&&(w.request=l),o&&(w.lambdaContext=o),w._originalArgs=t,w.diagnostic.original_arg_types=h,w}var x=["log","network","dom","navigation","error","manual"],E=["critical","error","warning","info","debug"];function I(t,e){for(var r=0;r<t.length;++r)if(t[r]===e)return!0;return!1}function j(t,e){t.attributes=t.attributes||[];var r,n=a(e);try{for(n.s();!(r=n.n()).done;){var o=r.value;void 0!==o.value&&t.attributes.push(o)}}catch(t){n.e(t)}finally{n.f()}}function P(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}}function T(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function A(){return Date.now?+Date.now():+new Date}function R(t,e,r,n){var o=i(t,e,r);return o=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}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function C(t){this.startTime=A(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(t)}function L(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function N(t,e,r,n,o,i,a){var s=null;return r&&(r=new Error(r)),r||n||(s=function(t,e,r,n,o){var i,a=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 s={body:{message:{body:i,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:a,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:r,shouldSend:n,payload:s}}C.globalSettings={startTime:A(),maxItems:void 0,itemsPerMinute:void 0},C.prototype.configureGlobal=function(t){void 0!==t.startTime&&(C.globalSettings.startTime=t.startTime),void 0!==t.maxItems&&(C.globalSettings.maxItems=t.maxItems),void 0!==t.itemsPerMinute&&(C.globalSettings.itemsPerMinute=t.itemsPerMinute)},C.prototype.shouldSend=function(t,e){var r=(e=e||A())-this.startTime;(r<0||r>=6e4)&&(this.startTime=e,this.perMinCounter=0);var n=C.globalSettings.maxItems,o=C.globalSettings.itemsPerMinute;if(L(t,n,this.counter))return N(this.platform,this.platformOptions,n+" max items reached",!1);if(L(t,o,this.perMinCounter))return N(this.platform,this.platformOptions,o+" items per minute reached",!1);this.counter++,this.perMinCounter++;var i=!L(t,n,this.counter),a=i;return i=i&&!L(t,o,this.perMinCounter),N(this.platform,this.platformOptions,null,i,n,o,a)},C.prototype.setPlatformOptions=function(t,e){this.platform=t,this.platformOptions=e};var q=C;function D(t){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D(t)}function M(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,U(n.key),n)}}function U(t){var e=function(t,e){if("object"!=D(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=D(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==D(e)?e:e+""}var H,F,J,V=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=i(r,t),this}},{key:"addPredicate",value:function(t){return f(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&f(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&j(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,(function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)}))}catch(r){var s;this._dequeuePendingRequest(i),t.replayId&&(null===(s=this.replay)||void 0===s||s.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;f(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval((function(){e._maybeCallWait()}),500)))}},{key:"_applyPredicates",value: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}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,(function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)})):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&h(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval((function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}}),this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||P(t,"body.trace.exception.message")||P(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=P(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!f(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&M(e.prototype,r),n&&M(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();H=V,J=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(F=U(F="RETRIABLE_ERRORS"))in H?Object.defineProperty(H,F,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[F]=J;var W=V;function B(t,e){this.queue=t,this.options=e,this.transforms=[],this.diagnostic={}}B.prototype.configure=function(t){this.queue&&this.queue.configure(t);var e=this.options;return this.options=i(e,t),this},B.prototype.addTransform=function(t){return f(t)&&this.transforms.push(t),this},B.prototype.log=function(t,e){if(e&&f(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))},B.prototype._applyTransforms=function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)};var G=B;function $(t,e,r,n,o,a,s){this.options=i(t),this.logger=r,$.rateLimiter.configureGlobal(this.options),$.rateLimiter.setPlatformOptions(s,this.options),this.api=e,this.queue=new W($.rateLimiter,e,r,this.options,a),this.tracing=o;var u=this.options.tracer||null;X(u)?(this.tracer=u,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new G(this.queue,this.options),this.telemeter=n,z(t),this.lastError=null,this.lastErrorHash="none"}function z(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function X(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)}$.rateLimiter=new q({maxItems:0,itemsPerMinute:60}),$.prototype.global=function(t){return $.rateLimiter.configureGlobal(t),this},$.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=i(r,t,n);var o=this.options.tracer||null;return X(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),z(t),this.global(this.options),X(t.tracer)&&(this.tracer=t.tracer),this},$.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},$.prototype.debug=function(t){this._log("debug",t)},$.prototype.info=function(t){this._log("info",t)},$.prototype.warn=function(t){this._log("warning",t)},$.prototype.warning=function(t){this._log("warning",t)},$.prototype.error=function(t){this._log("error",t)},$.prototype.critical=function(t){this._log("critical",t)},$.prototype.wait=function(t){this.queue.wait(t)},$.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},$.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},$.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},$.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},$.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},$.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{e.level=e.level||t,this._addTracingAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},$.prototype._addTracingAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:null===(r=this.tracing)||void 0===r?void 0:r.sessionId},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];j(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},$.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},$.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)},$.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=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(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}}}};var Z=$;function Q(t){if(!l(t.context,"string")){var e=g(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function K(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=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),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function Y(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=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:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function tt(t){return tt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tt(t)}function et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function rt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?et(Object(r),!0).forEach((function(e){nt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):et(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function nt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=tt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=tt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==tt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ot(){ot=function(){return e};var t,e={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function c(t,e,r,n){var i=e&&e.prototype instanceof m?e:m,a=Object.create(i.prototype),s=new T(n||[]);return o(a,"_invoke",{value:E(t,r,s)}),a}function f(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=c;var p="suspendedStart",h="suspendedYield",d="executing",y="completed",v={};function m(){}function b(){}function g(){}var w={};l(w,a,(function(){return this}));var k=Object.getPrototypeOf,_=k&&k(k(A([])));_&&_!==r&&n.call(_,a)&&(w=_);var S=g.prototype=m.prototype=Object.create(w);function O(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(o,i,a,s){var u=f(t[o],t,i);if("throw"!==u.type){var l=u.arg,c=l.value;return c&&"object"==tt(c)&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(c).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;o(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,o){r(t,n,e,o)}))}return i=i?i.then(o,o):o()}})}function E(e,r,n){var o=p;return function(i,a){if(o===d)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var s=n.delegate;if(s){var u=I(s,n);if(u){if(u===v)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=y,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=d;var l=f(e,r,n);if("normal"===l.type){if(o=n.done?y:h,l.arg===v)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(o=y,n.method="throw",n.arg=l.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),v;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,v;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,v):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function T(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function A(e){if(e||""===e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o<e.length;)if(n.call(e,o))return r.value=e[o],r.done=!1,r;return r.value=t,r.done=!0,r};return i.next=i}}throw new TypeError(tt(e)+" is not iterable")}return b.prototype=g,o(S,"constructor",{value:g,configurable:!0}),o(g,"constructor",{value:b,configurable:!0}),b.displayName=l(g,u,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,l(t,u,"GeneratorFunction")),t.prototype=Object.create(S),t},e.awrap=function(t){return{__await:t}},O(x.prototype),l(x.prototype,s,(function(){return this})),e.AsyncIterator=x,e.async=function(t,r,n,o,i){void 0===i&&(i=Promise);var a=new x(c(t,r,n,o),i);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(S),l(S,u,"Generator"),l(S,a,(function(){return this})),l(S,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=A,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(P),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function o(n,o){return s.type="throw",s.arg=e,r.next=n,o&&(r.method="next",r.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=n.call(a,"catchLoc"),l=n.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),v},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),P(r),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;P(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:A(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),v}},e}function it(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}var at={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},st={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443};function ut(t,e,r,n){this.options=t,this.transport=e,this.url=r,this.truncation=n,this.accessToken=t.accessToken,this.transportOptions=lt(t,r),this.OTLPTransportOptions=ct(t,r)}function lt(t,e){return K(t,at,e)}function ct(t,e){var r;return K(t=rt(rt({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),st,e)}ut.prototype._postPromise=function(t){var e=t.accessToken,r=t.options,n=t.payload,o=t.headers,i=this;return new Promise((function(t,a){i.transport.post({accessToken:e,options:r,payload:n,headers:o,callback:function(e,r){return e?a(e):t(r)}})}))},ut.prototype.postItem=function(t,e){var r=Y(this.transportOptions,"POST"),n=Q(t),o=this;setTimeout((function(){o.transport.post({accessToken:o.accessToken,options:r,payload:n,callback:e})}),0)},ut.prototype.postSpans=function(){var t,e=(t=ot().mark((function t(e){var r,n,o=arguments;return ot().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=o.length>1&&void 0!==o[1]?o[1]:{},n=Y(this.OTLPTransportOptions,"POST"),t.next=4,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r});case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){it(i,n,o,a,s,"next",t)}function s(t){it(i,n,o,a,s,"throw",t)}a(void 0)}))});return function(t){return e.apply(this,arguments)}}(),ut.prototype.buildJsonPayload=function(t,e){var r,n=Q(t);return(r=this.truncation?this.truncation.truncate(n):g(n)).error?(e&&e(r.error),null):r.value},ut.prototype.postJsonPayload=function(t,e){var r=Y(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)},ut.prototype.configure=function(t){var e=this.oldOptions;return this.options=i(e,t),this.transportOptions=lt(this.options,this.url),this.OTLPTransportOptions=ct(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this};var ft=ut,pt=function(){},ht={debug:0,info:1,warn:2,error:3,disable:4},dt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pt("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pt("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pt("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pt("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return pt("info",e)},init:function(t){var e=t.logLevel;pt=function(t,r){ht[t]<ht[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},yt=dt;function vt(t){return vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vt(t)}function mt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function bt(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=vt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==vt(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var gt=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;h(l)&&(e=new AbortController,r=setTimeout((function(){e.abort()}),l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?mt(Object(r),!0).forEach((function(e){bt(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):mt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then((function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)})).catch((function(t){yt.error(t.message),u(t)}))};function wt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return kt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?kt(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function _t(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var St=function(t){var e,r=t.accessToken,n=t.url,o=t.method,i=t.payload,a=t.headers,s=t.callback,u=t.requestFactory,c=t.timeout;if(!(e=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 s(new Error("No way to send a request"));try{try{var f=function(){try{if(f&&4===e.readyState){f=void 0;var t=w(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void s(t.error,t.value,r)}if(function(t){return t&&l(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;yt.error(o)}s(new Error(String(e.status)))}else{s(_t("XHR response had no status code (likely connection failure)"))}}}catch(t){var i;i=t&&t.stack?t:new Error(t),s(i)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var p=0,d=Object.entries(null!=a?a:{});p<d.length;p++){var y=wt(d[p],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}h(c)&&(e.timeout=c),e.onreadystatechange=f,e.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"===n.substring(0,5)&&(n="http"+n.substring(5));var b=new XDomainRequest;b.onprogress=function(){},b.ontimeout=function(){s(_t("Request timed out","ETIMEDOUT"))},b.onerror=function(){s(new Error("Error during request"))},b.onload=function(){var t=w(b.responseText);s(t.error,t.value)},b.open(o,n,!0),b.send(i)}else s(new Error("Cannot find a method to transport a request"))}}catch(t){s(t)}};function Ot(t){this.truncation=t}Ot.prototype.get=function(t,e,r,n,o){n&&f(n)||(n=function(){}),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 a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=b(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},Ot.prototype.post=function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,s=t.requestFactory;return function(t){if(a&&f(a)||(a=function(){}),!t)return a(new Error("Cannot send empty request"));var o;if((o=e.truncation&&t.body?e.truncation.truncate(t):g(t)).error)return a(o.error);t=o.value;var u=b(n);e._makeZoneRequest({accessToken:r,url:u,method:"POST",payload:t,headers:i,callback:a,requestFactory:s,timeout:n.timeout,transport:n.transport})}(o)},Ot.prototype.postJsonPayload=function(t,e,r,n,o){n&&f(n)||(n=function(){});var i=b(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},Ot.prototype._makeZoneRequest=function(){var t="undefined"!=typeof window&&window||void 0!==n&&n,e=t&&t.Zone&&t.Zone.root,r=Array.prototype.slice.call(arguments);if(e){var n=this;e.run((function(){n._makeRequest.apply(void 0,r)}))}else this._makeRequest.apply(void 0,r)},Ot.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,(function(t){}),(function(t){e(new Error(t))}))}(e,r);"fetch"===n?gt(t):St(t)};var xt=Ot;function Et(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}var It=/(^|@)\S+:\d+/,jt=/^\s*at .*(\S+:\d+|\(native\))/m,Pt=/^(eval@)?(\[native code\])?$/;function Tt(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return Rt(o,e)}(t):t.stack?function(t,e){var r=Rt(t.stack.split("\n").filter((function(t){return!!t.match(It)&&!t.match(/^Error created at/)})),e);return r.map((function(t){var e,r=t.split("@"),n=At(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}}))}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return Rt(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(jt))return function(t,e){return Ct(t.stack,e)}(t,e);if(t.stack)return function(t,e){return Lt(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function At(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function Rt(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function Ct(t,e){return Rt(t.split("\n").filter((function(t){return!!t.match(jt)})),e).map((function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=At(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}}))}function Lt(t,e){return Rt(t.split("\n").filter((function(t){return!t.match(Pt)})),e).map((function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=At(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}}))}function Nt(t){return t.map((function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}}))}var qt=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Dt(){return null}function Mt(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 Ut(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Nt(Tt(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new Mt(r[o]));return n}(),message:t.message,name:Ht(t),rawStack:t.stack,rawException:t}}function Ht(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}var Ft={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(qt),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:Dt,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new Ut(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new Ut(r,e)},Stack:Ut,Frame:Mt};function Jt(t,e,r){if(t.err&&"DOMException"===Ft.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)}function Vt(t,e,r){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||Ft.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);!function(t,e){var r=t.data.custom||{},n=!1;try{for(var o=0;o<e.length;++o)e[o].hasOwnProperty("rollbarContext")&&(r=i(r,S(e[o].rollbarContext)),n=!0);n&&(t.data.custom=r)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){yt.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)}function Wt(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function Bt(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=i(t.data,{environment:n,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)}function Gt(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=Xt(t,n[a],e);o.push(s)}T(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=zt(t);if(n){T(t,"data.body",{trace:Xt(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=Ft.guessErrorClass(o.message),a=Zt(o,i[0],e),s=i[1];t.message=a+": "+s,$t(t,e,r)}}(t,e,r):$t(t,e,r)}function $t(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var a={body:n};o&&(a.extra=i(o)),T(t,"data.body",{message:a}),r(null,t)}function zt(t){var e=t.stackInfo.stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function Xt(t,e,r){var n=t&&t.data.description,o=t&&t.custom,a=zt(t),s=Ft.guessErrorClass(e.message),u={exception:{class:Zt(e,s[0],r),message:s[1]}};if(n&&(u.exception.description=n),a){var l,c,f,p,h,d,y,m;for(0===a.length&&(u.exception.stack=e.rawStack,u.exception.raw=String(e.rawException)),u.frames=[],y=0;y<a.length;++y)c={filename:(l=a[y]).url?v(l.url):"(unknown)",lineno:l.line||null,method:l.func&&"?"!==l.func?l.func:"[anonymous]",colno:l.column},r.sendFrameUrl&&(c.url=l.url),c.method&&c.method.endsWith&&c.method.endsWith("_rollbar_wrapped")||(f=p=h=null,(d=l.context?l.context.length:0)&&(m=Math.floor(d/2),p=l.context.slice(0,m),f=l.context[m],h=l.context.slice(m)),f&&(c.code=f),(p||h)&&(c.context={},p&&p.length&&(c.context.pre=p),h&&h.length&&(c.context.post=h)),l.args&&(c.args=l.args),u.frames.push(c));u.frames.reverse(),o&&(u.extra=i(o))}return u}function Zt(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function Qt(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Kt(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=i(t.data,n),r(null,t)}function Yt(t,e,r){t.telemetryEvents&&T(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function te(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=P(t,n);if(o||(o=P(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return T(t,n+".exception.description",t.message),void r(null,t);var a=P(t,n+".extra")||{};T(t,n+".extra",i(a,{message:t.message}))}r(null,t)}else r(null,t)}function ee(t){return function(e,r,n){var o,a=i(e),s=null;try{f(r.transform)&&(s=r.transform(a.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}p(o=s)&&l(o.then,"function")?s.then((function(t){t&&(a.data=t),n(null,a)}),(function(t){n(t,e)})):n(null,a)}}function re(t,e,r){if(!e.sendConfig)return r(null,t);var n=P(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function ne(t,e){f(t[e])&&(t[e]=t[e].toString())}function oe(t,e,r){var n=e._configuredOptions;ne(n,"transform"),ne(n,"checkIgnore"),ne(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function ie(t,e,r){var n=i(t.notifier.client.notifier.diagnostic,t.diagnostic);if(P(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.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){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=i(t.data.notifier.diagnostic,n),r(null,t)}function ae(t,e){return!P(e,"plugins.jquery.ignoreAjaxErrors")||!P(t,"body.message.extra.isAjax")}function se(t,e){var r=t.level,n=y[r]||0,o=e.reportLevel;return!(n<(y[o]||0))}function ue(t,e,r){if(!t)return!r;var n,o,i=t.frames;if(!i||0===i.length)return!r;for(var a=e.length,s=i.length,u=0;u<s;u++){if(!l(n=i[u].filename,"string"))return!r;for(var c=0;c<a;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function le(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=P(t,"body.trace_chain")||[P(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(ue(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function ce(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain)for(var n=e.trace_chain,o=0;o<n.length;o++){var i=n[o];r.push(P(i,"exception.message"))}e.trace&&r.push(P(e,"trace.exception.message"));e.message&&r.push(P(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}var fe="3.0.0-beta.5",pe="api.rollbar.com/api/1/item/",he="debug",de="debug",ye="error";function ve(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var me,be=[].concat(function(t){return function(t){if(Array.isArray(t))return ve(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return ve(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ve(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["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"]),ge={scrubFields:be};function we(t){return we="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},we(t)}function ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _e(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ke(Object(r),!0).forEach((function(e){Oe(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xe(n.key),n)}}function Oe(t,e,r){return(e=xe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xe(t){var e=function(t,e){if("object"!=we(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=we(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==we(e)?e:e+""}var Ee=null,Ie=function(){function t(r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),yt.init({logLevel:r.logLevel||"error"}),this.options=R(Pe,r,null,yt),this.options._configuredOptions=r,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,s=this.components.tracing,u=this.components.replay,l=new xt(a),c=new ft(this.options,l,e,a);if(s&&(this.tracing=new s(je(),c,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),u&&"undefined"!=typeof window){var p=this.options.replay;this.replay=new u({tracing:this.tracing,telemeter:this.telemeter,options:p}),p.enabled&&p.autoStart&&this.replay.recorder.start()}this.client=n||new Z(this.options,c,yt,this.telemeter,this.tracing,this.replay,"browser");var h=je(),d="undefined"!=typeof document&&document;this.isChrome=h.chrome&&h.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Jt).addTransform(Vt).addTransform(Wt).addTransform(Bt).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&T(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};T(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});T(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform(Gt).addTransform(te).addTransform(Yt).addTransform(re).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(Kt).addTransform(ee(yt)).addTransform(oe).addTransform(ie).addTransform(Qt);var n}(this.client.notifier,this,h),function(t){t.addPredicate(se).addPredicate(ae).addPredicate(function(t){return function(e,r){var n=!!e._isUncaught;delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{f(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(f(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(yt)).addPredicate(function(t){return function(e,r){return!le(e,r,"blocklist",t)}}(yt)).addPredicate(function(t){return function(e,r){return le(e,r,"safelist",t)}}(yt)).addPredicate(ce(yt))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,h,d),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(r),this.rollbar=this}return function(t,e,r){return e&&Se(t.prototype,e),r&&Se(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&yt.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=R(i,t,a,yt),this.options._configuredOptions=R(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(_e({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=je();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(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,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!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)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=k(t,e,r,n,o,"onerror","uncaught exception",Ft);d(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:d(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value: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)}}}},{key:"handleUnhandledRejection",value: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=g(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;d(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=k(r,"",0,0,null,"unhandledrejection","",Ft),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=f(e)?e:function(){return e||{}},!f(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped&&(t._rollbar_wrapped=function(){r&&f(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(l(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 o in t)t.hasOwnProperty(o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,a=t.length;i<a;++i)switch(c(o=t[i])){case"string":!e&&I(x,o)?e=o:!n&&I(E,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=_e({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){yt.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return O(t,yt,this)}}],[{key:"init",value:function(e,r){return Ee?Ee.global(e).configure(e):Ee=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(Ee)return Ee[t].apply(Ee,e);var r="Rollbar is not initialized";yt.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(f(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function je(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}me=Ie,Oe(Ie,"global",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("global",e)})),Oe(Ie,"configure",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("configure",e)})),Oe(Ie,"lastError",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("lastError",e)})),Oe(Ie,"log",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("log",e)})),Oe(Ie,"debug",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("debug",e)})),Oe(Ie,"info",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("info",e)})),Oe(Ie,"warn",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("warn",e)})),Oe(Ie,"warning",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("warning",e)})),Oe(Ie,"error",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("error",e)})),Oe(Ie,"critical",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("critical",e)})),Oe(Ie,"buildJsonPayload",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("buildJsonPayload",e)})),Oe(Ie,"sendJsonPayload",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("sendJsonPayload",e)})),Oe(Ie,"wrap",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("wrap",e)})),Oe(Ie,"captureEvent",(function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return me.callInstance("captureEvent",e)}));var Pe={environment:"unknown",version:fe,scrubFields:ge.scrubFields,logLevel:he,reportLevel:de,uncaughtErrorLevel:ye,endpoint:pe,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{enabled:!1,autoStart:!0,triggerDefaults:{samplingRatio:1,preDuration:300,postDuration:5},triggers:[{type:"occurrence",level:["error","critical"]}],debug:{logErrors:!0,logEmits:!1},inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,maskInputOptions:{password:!0,email:!1,tel:!1,text:!1,color:!1,date:!1,"datetime-local":!1,month:!1,number:!1,range:!1,search:!1,time:!1,url:!1,week:!1},maskAllInputs:!1,blockClass:"rb-block",maskTextClass:"rb-mask",ignoreClass:"rb-ignore",slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},Te=Ie,Ae=["otelAttributes"];function Re(t){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Re(t)}function Ce(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Le(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(r),!0).forEach((function(e){Ne(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ce(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Ne(t,e,r){return(e=De(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function qe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,De(n.key),n)}}function De(t){var e=function(t,e){if("object"!=Re(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Re(e)?e:e+""}var Me=100;function Ue(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var He=function(){return function(t,e,r){return e&&qe(t.prototype,e),r&&qe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=i(e);var o=this.options.maxTelemetryEvents||Me;this.maxQueueSize=Math.max(0,Math.min(o,Me)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})}),[{key:"configure",value:function(t){var e=this.options;this.options=i(e,t);var r=this.options.maxTelemetryEvents||Me,n=Math.max(0,Math.min(r,Me)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(f(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=t.filter((function(t){return"connectivity"!==t.type})),t=t.map((function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,Ae);return e})),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:Fe(t,r),type:t,timestamp_ms:o||A(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(f(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,Ue(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i,a=null;r?(a={message:t,level:e,type:"message",uuid:r},null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",a,Ue(n))):(a={message:t,level:e},null===(i=this.telemetrySpan)||void 0===i||i.addEvent("rollbar-log-event",a,Ue(n)));return this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var a=this.levelFromStatus(t.status_code),s=1e6*(t.end_time_ms||0),u={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":s.toString()};return null===(i=this.telemetrySpan)||void 0===i||i.addEvent("rollbar-network-event",u,Ue(t.start_time_ms)),this.capture("network",t,a,r,t.start_time_ms,u)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value: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)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:Ue(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,Ue(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:Ue(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Ue(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=Ue(r),t.otelAttributes.durationUnixNano=Ue(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,Ue(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,Ue(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=Le(Le({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=Le(Le({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=Le(Le({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=Le(Le({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,Ue(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},Ue(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,Ue(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value: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}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}])}();function Fe(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Je=He;function Ve(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function We(t){this.map={},t instanceof We?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)}We.prototype.append=function(t,e){t=Ve(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},We.prototype.get=function(t){return t=Ve(t),this.has(t)?this.map[t]:null},We.prototype.has=function(t){return this.map.hasOwnProperty(Ve(t))},We.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},We.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)};var Be=function(t){return"undefined"==typeof Headers?new We(t):new Headers(t)};var Ge=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};var $e=function(t,e,r){var n,o,i,a,s=l(t,"object"),u=l(t,"array"),c=[];if(r=r||{obj:[],mapped:[]},s){if(a=r.obj.indexOf(t),s&&-1!==a)return r.mapped[a]||r.obj[a];r.obj.push(t),a=r.obj.length-1}if(s)for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&c.push(n);else if(u)for(i=0;i<t.length;++i)c.push(i);var f=s?{}:[],p=!0;for(i=0;i<c.length;++i)o=t[n=c[i]],f[n]=e(n,o,r),p=p&&f[n]===t[n];return s&&!p&&(r.mapped[a]=f),p?t:f};function ze(t,e){var r=e.split("."),n=r.length-1;try{for(var o=0;o<=n;++o)o<n?t=t[r[o]]:t[r[o]]="********"}catch(t){}}var Xe=function(t,e,r){if(e=e||[],r)for(var n=0;n<r.length;++n)ze(t,r[n]);var o=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),i=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 a(t,e){return e+"********"}return $e(t,(function t(e,r,n){var s=function(t,e){var r;for(r=0;r<o.length;++r)if(o[r].test(t)){e="********";break}return e}(e,r);return s===r?l(r,"object")||l(r,"array")?$e(r,t,n):function(t){var e;if(l(t,"string"))for(e=0;e<i.length;++e)t=t.replace(i[e],a);return t}(s):s}))};function Ze(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Qe(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qe(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ke(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=Ye(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&"html"!==(e=tr(t)).tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function Ye(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 tr(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 a=["type","name","title","alt"];for(i.attributes=[],o=0;o<a.length;o++)r=a[o],(n=t.getAttribute(r))&&i.attributes.push({key:r,value:n});return i}function er(t){return er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},er(t)}function rr(t){return function(t){if(Array.isArray(t))return sr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ar(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,or(n.key),n)}}function or(t){var e=function(t,e){if("object"!=er(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==er(e)?e:e+""}function ir(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ar(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ar(t,e){if(t){if("string"==typeof t)return sr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sr(t,e):void 0}}function sr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var ur={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 lr(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function cr(t){var e,r=[],n=ir(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=ir(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var fr=function(){return function(t,e,r){return e&&nr(t.prototype,e),r&&nr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r,n,o,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=or(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",(function(){this.removeListeners("connectivity")})),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(l(s,"object")||(s=ur),this.autoInstrument=i(ur,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},this._document=a||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href}),[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=!!(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=cr(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=i(this.options,t);var e=t.autoInstrument,r=i(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(l(e,"object")||(e=ur),this.autoInstrument=i(ur,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value: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()}},{key:"deinstrumentNetwork",value:function(){lr(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&f(r[e])&&Ge(r,e,(function(e){return t.rollbar.wrap(e)}))}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;Ge(r,"open",(function(t){return function(e,r){var n=pr(r);return(l(r,"string")||n)&&(r=n?r.toString():r,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=A(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:A(),end_time_ms:null}),t.apply(this,arguments)}}),this.replacements,"network"),Ge(r,"setRequestHeader",(function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),l(r,"string")&&l(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}}),this.replacements,"network"),Ge(r,"send",(function(r){return function(n){var o=this;function i(){if(o.__rollbar_xhr&&(null===o.__rollbar_xhr.status_code&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=n),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=A()),o.readyState>3)){var e=A();o.__rollbar_xhr.end_time_ms=e;var r=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;r={};try{var a;if(!0===i){var s=o.getAllResponseHeaders();if(s){var u,l,c,f=ir(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){a=(u=c.value.split(": ")).shift(),l=u.join(": "),r[a]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,h=ir(i);try{for(h.s();!(p=h.n()).done;){var d=p.value;r[d]=o.getResponseHeader(d)}}catch(t){h.e(t)}finally{h.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=o.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(o.__rollbar_xhr.response=v);try{var m=o.status;m=1223===m?204:m,o.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(o.__rollbar_event,e,m),o.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(o.__rollbar_xhr)}catch(t){}}}return e("onload",o),e("onerror",o),e("onprogress",o),"onreadystatechange"in o&&f(o.onreadystatechange)?Ge(o,"onreadystatechange",(function(e){return t.rollbar.wrap(e,void 0,i)})):o.onreadystatechange=i,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}}),this.replacements,"network")}"fetch"in this._window&&Ge(this._window,"fetch",(function(e){return function(r,n){var o,i=Array.prototype.slice.call(arguments),a=i[0],s="GET",u=pr(a);l(a,"string")||u?o=u?a.toString():a:a&&(o=a.url,a.method&&(s=a.method)),i[1]&&i[1].method&&(s=i[1].method);var c={method:s,url:o,status_code:null,start_time_ms:A(),end_time_ms:null};if(i[1]&&i[1].headers){var f=Be(i[1].headers);c.request_content_type=f.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(c.request_headers=t.fetchHeaders(f,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(i[1]&&i[1].body?c.request=i[1].body:i[0]&&!l(i[0],"string")&&i[0].body&&(c.request=i[0].body));var p=t.captureNetwork(c,"fetch",void 0);return t.trackHttpErrors()&&(c.stack=(new Error).stack),e.apply(this,i).then((function(e){var r=A();c.end_time_ms=r,c.status_code=e.status,t.addOtelNetworkResponse(p,r,e.status),c.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(c.response={},o&&("function"==typeof o.then?o.then((function(e){e&&t.isJsonContentType(c.response_content_type)?c.response.body=t.scrubJson(e):c.response.body=e})):c.response.body=o),n&&(c.response.headers=n)),t.errorOnHttpStatus(c),e}))}}),this.replacements,"network")}},{key:"captureNetwork",value: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)}},{key:"isJsonContentType",value:function(t){return!!(t&&l(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(Xe(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=ir(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value: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})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(c(n=t[e])){case"object":(n=(n=g(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(" ")}(t);e.telemeter.captureLog(r,i,null,A()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],(function(e){return t.handleEvent("click",e)})),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],(function(e){return t.handleEvent("dragdrop",e)})),this.addListener("dom",this._window,["blur","focus"],(function(e){return t.handleEvent("focus",e)})),this.addListener("dom",this._window,["submit","invalid"],(function(e){return t.handleEvent("form",e)})),this.addListener("dom",this._window,["input","change"],(function(e){return t.handleEvent("input",e)})),this.addListener("dom",this._window,["resize"],(function(e){return t.handleEvent("resize",e)})),this.addListener("dom",this._document,["DOMContentLoaded"],(function(e){return t.handleEvent("contentLoaded",e)}))}},{key:"handleEvent",value:function(t,e){try{return{click:this.handleClick,dragdrop:this.handleDrag,focus:this.handleFocus,form:this.handleForm,input:this.handleInput,resize:this.handleResize,contentLoaded:this.handleContentLoaded}[t].call(this,e)}catch(r){console.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Ke(t.target),timestamp:A()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Ke(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:A()})}},{key:"handleForm",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Ke(t.target);console.log("handleForm",r,n,t)}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:A()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=ir([].concat(rr(t.dataTransfer.files),rr(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Ke(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:A()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=tr(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=Ze(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=Ze(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=Ze(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Ke(t.target),value:s,timestamp:A()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&lr(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;Ge(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"),Ge(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")}}},{key:"handleUrlChange",value:function(t,e){var r=Et(this._location.href),n=Et(e),o=Et(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,null,A());this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],(function(e){return t.handleConnectivity(e)}))}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:A()})}},{key:"handleCspEvent",value: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",null,A()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=ir(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push((function(){e.removeEventListener(r,n,a)}))};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function pr(t){return"undefined"!=typeof URL&&t instanceof URL}var hr=fr;function dr(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 a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var yr=function(t,e,r){if(t){var n,o,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&dr(e,t[o].prototype,r)}};function vr(t,e){return[t,g(t,e)]}function mr(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function br(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain)for(var i=o.trace_chain,a=0;a<i.length;a++)n=mr(n=i[a].frames,r),i[a].frames=n;else o.trace&&(n=mr(n=o.trace.frames,r),o.trace.frames=n);return[t,g(t,e)]}function gr(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function wr(t,e,r){return e=$e(e,(function e(r,n,o){switch(c(n)){case"string":return gr(t,n);case"object":case"array":return $e(n,e,o);default:return n}})),[e,g(e,r)]}function kr(t){return t.exception&&(delete t.exception.description,t.exception.message=gr(255,t.exception.message)),t.frames=mr(t.frames,1),t}function _r(t,e){var r=t.data.body;if(r.trace_chain)for(var n=r.trace_chain,o=0;o<n.length;o++)n[o]=kr(n[o]);else r.trace&&(r.trace=kr(r.trace));return[t,g(t,e)]}function Sr(t,e){return 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}(t)>e}var Or={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[vr,br,wr.bind(null,1024),wr.bind(null,512),wr.bind(null,256),_r];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!Sr(i.value,r))return i;return i},raw:vr,truncateFrames:br,truncateStrings:wr,maybeTruncateValue:gr};function xr(t){return xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xr(t)}function Er(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ir(n.key),n)}}function Ir(t){var e=function(t,e){if("object"!=xr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==xr(e)?e:e+""}var jr=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return function(t,e,r){return e&&Er(t.prototype,e),r&&Er(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])}(),Pr=new jr;function Tr(t){return Tr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tr(t)}function Ar(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Rr(n.key),n)}}function Rr(t){var e=function(t,e){if("object"!=Tr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Tr(e)?e:e+""}var Cr=function(){return function(t,e,r){return e&&Ar(t.prototype,e),r&&Ar(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=Pr}),[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||Pr,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}])}();var Lr={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,(function(t){return t.toString(16).padStart(2,"0")})).join("")}};function Nr(t){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nr(t)}function qr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Dr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?qr(Object(r),!0).forEach((function(e){Ur(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Mr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Hr(n.key),n)}}function Ur(t,e,r){return(e=Hr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Hr(t){var e=function(t,e){if("object"!=Nr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Nr(e)?e:e+""}var Fr="RollbarSession",Jr=function(){return function(t,e,r){return e&&Mr(t.prototype,e),r&&Mr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Ur(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}}),[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(Fr);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:Lr.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(Fr,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=Dr(Dr({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(Dr({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}])}();function Vr(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function Wr(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var Br={fromMillis:Vr,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:Wr,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?Wr(Vr(performance.timeOrigin),Vr(performance.now())):Vr(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function Gr(t){return Gr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gr(t)}function $r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||Xr(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zr(t){return function(t){if(Array.isArray(t))return Zr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Xr(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xr(t,e){if(t){if("string"==typeof t)return Zr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Zr(t,e):void 0}}function Zr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Qr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Kr(n.key),n)}}function Kr(t){var e=function(t,e){if("object"!=Gr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Gr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Gr(e)?e:e+""}var Yr=function(){return function(t,e,r){return e&&Qr(t.prototype,e),r&&Qr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r}),[{key:"export",value:function(t,e){tn.push.apply(tn,zr(t))}},{key:"toPayload",value:function(){var t=this,e=tn.slice();if(tn.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Xr(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map((function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}}))}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map((function(t){var e=$r(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}}))};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:Br.toNanos(t.startTime),endTimeUnixNano:Br.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map((function(t){return{timeUnixNano:Br.toNanos(t.time),name:t.name,attributes:n(t.attributes)}})))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map((function(t){var r=$r(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}}))}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map((function(t){return{key:t.key,value:e._transformAnyValue(t.value)}}))}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=Gr(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map((function(t){return e._transformAnyValue(t)}))}}:"object"===r?{kvlistValue:{values:Object.entries(t).map((function(t){var r=$r(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}}))}}:{stringValue:String(t)}}}])}(),tn=[];function en(t){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(t)}function rn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return nn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nn(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function nn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function on(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,an(n.key),n)}}function an(t){var e=function(t,e){if("object"!=en(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=en(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==en(e)?e:e+""}var sn=function(){return function(t,e,r){return e&&on(t.prototype,e),r&&on(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]}),[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=rn(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){yt.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}])}();function un(t){return un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},un(t)}function ln(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return cn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function fn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,pn(n.key),n)}}function pn(t){var e=function(t,e){if("object"!=un(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=un(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==un(e)?e:e+""}var hn=function(){return function(t,e,r){return e&&fn(t.prototype,e),r&&fn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this}),[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||Br.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=ln(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||Br.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||Br.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}])}();function dn(t){return dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dn(t)}function yn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function vn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?yn(Object(r),!0).forEach((function(e){mn(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):yn(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function mn(t,e,r){return(e=gn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,gn(n.key),n)}}function gn(t){var e=function(t,e){if("object"!=dn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=dn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==dn(e)?e:e+""}var wn=function(){return function(t,e,r){return e&&bn(t.prototype,e),r&&bn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e}),[{key:"startSpan",value:function(t){var e,r,n,o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),s=this.tracing.getSpan(a),u=null==s?void 0:s.spanContext(),l=Lr.gen(8),c=null;u?(n=u.traceId,c=u.traceState,o=u.spanId):n=Lr.gen(16);var f={traceId:n,spanId:l,traceFlags:0,traceState:c},p={attributes:vn(vn({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=i.resource)||void 0===r?void 0:r.attributes)||{})};return new hn({resource:p,scope:this.tracing.scope,session:this.tracing.session.session,context:a,spanContext:f,name:t,kind:0,parentSpanId:o,spanProcessor:this.spanProcessor,startTime:i.startTime,usePerformance:i.usePerformance})}}])}();function kn(t){return kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kn(t)}function _n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Sn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(r),!0).forEach((function(e){On(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function On(t,e,r){return(e=En(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,En(n.key),n)}}function En(t){var e=function(t,e){if("object"!=kn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kn(e)?e:e+""}var In,jn=(In="Rollbar Context Key SPAN",Symbol.for(In)),Pn=function(){return function(t,e,r){return e&&xn(t.prototype,e),r&&xn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}((function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new Jr(this,n)),this.createTracer()}),[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:Sn(Sn({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return Lr.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new Cr,this.exporter=new Yr(this.api,this.options),this.spanProcessor=new sn(this.exporter,this.options.tracing),this.tracer=new wn(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(jn)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(jn,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}])}();Te.setComponents({telemeter:Je,instrumenter:hr,wrapGlobals:yr,scrub:Xe,truncation:Or,tracing:Pn});var Tn=Te,An="undefined"!=typeof window&&window._rollbarConfig,Rn=An&&An.globalAlias||"Rollbar",Cn="undefined"!=typeof window&&window[Rn]&&"function"==typeof window[Rn].shimId&&void 0!==window[Rn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Cn&&An){var Ln=new Tn(An);window[Rn]=Ln}else"undefined"!=typeof window?(window.rollbar=Tn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=Tn,self._rollbarDidLoad=!0)}();
|
|
2
|
+
!function(){"use strict";var t={d:function(e,r){for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,u=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return s=t.done,t},e:function(t){u=!0,a=t},f:function(){try{s||null==r.return||r.return()}finally{if(u)throw a}}}}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){return e===a(t)}function a(t){var e=o(t);return"object"!==e?e:t?t instanceof Error?"error":{}.toString.call(t).match(/\s([a-zA-Z]+)/)[1].toLowerCase():"null"}function s(t){return i(t,"function")}function u(t){return null!=t&&("object"==o(t)||"function"==typeof t)}function l(t,e){return null!=t&&(Object.hasOwn?Object.hasOwn(t,e):Object.prototype.hasOwnProperty.call(t,e))}function c(t){return Number.isFinite(t)}function f(t){return i(t,"error")||i(t,"exception")}function p(){return"********"}t.r(e),t.d(e,{parse:function(){return fn}});var d={debug:0,info:1,warning:2,error:3,critical:4};function h(t){var e=function(t){if(!i(t,"string"))return;for(var e=y,r=e.parser[e.strictMode?"strict":"loose"].exec(t),n={},o=0,a=e.key.length;o<a;++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)"}var y={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 v(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}function m(t,e){var r,n;try{r=JSON.stringify(t)}catch(o){if(e&&s(e))try{r=e(t)}catch(t){n=t}else n=o}return{error:n,value:r}}function b(t){var e,r;try{e=JSON.parse(t)}catch(t){r=t}return{error:r,value:e}}function g(t,e,r,n,o,i,a,s){var u={url:e||"",line:r,column:n};u.func=s.guessFunctionName(u.url,u.line),u.context=s.gatherContext(u.url,u.line);var l="undefined"!=typeof document&&document&&document.location&&document.location.href,c="undefined"!=typeof window&&window&&window.navigator&&window.navigator.userAgent;return{mode:i,message:o?String(o):t||a,url:l,stack:[u],useragent:c}}function w(t,e){return function(r,n){try{e(r,n)}catch(e){t.error(e)}}}function k(t){return function t(e,r){var n,o,s,u={};try{for(o in e)(n=e[o])&&(i(n,"object")||i(n,"array"))?r.includes(n)?u[o]="Removed circular reference: "+a(n):((s=r.slice()).push(n),u[o]=t(n,s)):u[o]=n}catch(t){u="Failed cloning custom data: "+t.message}return u}(t,[t])}function S(t,e,r,n,o){for(var i,s,u,l,c,f,p=[],d=[],h=0,y=t.length;h<y;++h){var v=a(f=t[h]);switch(d.push(v),v){case"undefined":break;case"string":i?p.push(f):i=f;break;case"function":l=w(e,f);break;case"date":p.push(f);break;case"error":case"domexception":case"exception":s?p.push(f):s=f;break;case"object":case"array":if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){s?p.push(f):s=f;break}if(n&&"object"===v&&!c){for(var m=0,b=n.length;m<b;++m)if(void 0!==f[n[m]]){c=f;break}if(c)break}u?p.push(f):u=f;break;default:if(f instanceof Error||"undefined"!=typeof DOMException&&f instanceof DOMException){s?p.push(f):s=f;break}p.push(f)}}u&&(u=k(u)),p.length>0&&(u||(u=k({})),u.extraArgs=k(p));var g,S={message:i,err:s,custom:u,timestamp:T(),callback:l,notifier:r,diagnostic:{},uuid:(g=T(),"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var e=(g+16*Math.random())%16|0;return g=Math.floor(g/16),("x"===t?e:7&e|8).toString(16)}))};return S.data=S.data||{},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)}(S,u),n&&c&&(S.request=c),o&&(S.lambdaContext=o),S._originalArgs=t,S.diagnostic.original_arg_types=d,S}var _=["log","network","dom","navigation","error","manual"],O=["critical","error","warning","info","debug"];function x(t,e){var n,o=r(t);try{for(o.s();!(n=o.n()).done;){if(n.value===e)return!0}}catch(t){o.e(t)}finally{o.f()}return!1}function E(t,e){t.attributes=t.attributes||[];var n,o=r(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;void 0!==i.value&&t.attributes.push(i)}}catch(t){o.e(t)}finally{o.f()}}function j(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}}function I(t,e,r){if(t){Object.setPrototypeOf(t,null);var n=e.split("."),o=n.length;if(!(o<1))if(1!==o)try{for(var i=t[n[0]]||{},a=i,s=1;s<o-1;++s)i[n[s]]=i[n[s]]||{},i=i[n[s]];i[n[o-1]]=r,t[n[0]]=a}catch(t){return}else t[n[0]]=r}}function T(){return Date.now?Date.now():Number(new Date)}function P(t,e,r,n){var o=A(t,e,r);return o=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}(o,n),!e||e.overwriteScrubFields||e.scrubFields&&(o.scrubFields=(t.scrubFields||[]).concat(e.scrubFields)),o}function A(){function t(t){if(!t||"[object Object]"!==Object.prototype.toString.call(t))return!1;var e,r=l(t,"constructor"),n=t.constructor&&t.constructor.prototype&&l(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!r&&!n)return!1;for(e in t);return void 0===e||l(t,e)}var e,r,n,o,i,a=Object.create(null),s=null,u=arguments.length;for(e=0;e<u;e++)if(null!=(s=arguments[e]))for(i in s)r=a[i],a!==(n=s[i])&&(n&&t(n)?(o=r&&t(r)?r:{},a[i]=A(o,n)):void 0!==n&&(a[i]=n));return a}var R=function(t,e,r){var n,o,a,s,u=i(t,"object"),c=i(t,"array"),f=[];if(r=r||{obj:[],mapped:[]},u){if(s=r.obj.indexOf(t),u&&-1!==s)return r.mapped[s]||r.obj[s];r.obj.push(t),s=r.obj.length-1}if(u)for(n in t)l(t,n)&&f.push(n);else if(c)for(a=0;a<t.length;++a)f.push(a);var p=u?{}:[],d=!0;for(a=0;a<f.length;++a)o=t[n=f[a]],p[n]=e(n,o,r),d=d&&p[n]===t[n];return u&&!d&&(r.mapped[s]=p),d?t:p};function C(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||q(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function L(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=q(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function q(t,e){if(t){if("string"==typeof t)return N(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?N(t,e):void 0}}function N(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function D(t,e){var r=e.split("."),n=r.length-1;try{var o,i=L(r.entries());try{for(i.s();!(o=i.n()).done;){var a=C(o.value,2),s=a[0],u=a[1];s<n?t=t[u]:t[u]=p()}}catch(t){i.e(t)}finally{i.f()}}catch(t){}}var M=function(t,e,r){if(e=e||[],r){var n,o=L(r);try{for(o.s();!(n=o.n()).done;){D(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var a=function(t){var e,r=[],n=L(t);try{for(n.s();!(e=n.n()).done;){var o="^\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?$";r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return r}(e),s=function(t){var e,r=[],n=L(t);try{for(n.s();!(e=n.n()).done;){var o="\\[?(%5[bB])?"+e.value+"\\[?(%5[bB])?\\]?(%5[dD])?";r.push(new RegExp("("+o+"=)([^&\\n]+)","igm"))}}catch(t){n.e(t)}finally{n.f()}return r}(e);function u(t,e){return e+"********"}return R(t,function t(e,r,n){var o=function(t,e){var r,n=L(a);try{for(n.s();!(r=n.n()).done;)if(r.value.test(t)){e=p();break}}catch(t){n.e(t)}finally{n.f()}return e}(e,r);return o===r?i(r,"object")||i(r,"array")?R(r,t,n):function(t){if(i(t,"string")){var e,r=L(s);try{for(r.s();!(e=r.n()).done;){var n=e.value;t=t.replace(n,u)}}catch(t){r.e(t)}finally{r.f()}}return t}(o):o})},U=["otelAttributes"];function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function F(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?F(Object(r),!0).forEach(function(e){V(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):F(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function V(t,e,r){return(e=W(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,W(n.key),n)}}function W(t){var e=function(t,e){if("object"!=H(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=H(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==H(e)?e:e+""}var $=100;function G(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}var z=function(){return t=function t(e,r){var n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=[],this.options=A(e);var o=this.options.maxTelemetryEvents||$;this.maxQueueSize=Math.max(0,Math.min(o,$)),this.tracing=r,this.telemetrySpan=null===(n=this.tracing)||void 0===n?void 0:n.startSpan("rollbar-telemetry",{})},e=[{key:"configure",value:function(t){var e=this.options;this.options=A(e,t);var r=this.options.maxTelemetryEvents||$,n=Math.max(0,Math.min(r,$)),o=0;this.queue.length>n&&(o=this.queue.length-n),this.maxQueueSize=n,this.queue.splice(0,o)}},{key:"copyEvents",value:function(){var t=Array.prototype.slice.call(this.queue,0);if(s(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=(t=t.filter(function(t){return"connectivity"!==t.type})).map(function(t){t.otelAttributes;var e=function(t,e){if(null==t)return{};var r,n,o=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(n=0;n<i.length;n++)r=i[n],-1===e.indexOf(r)&&{}.propertyIsEnumerable.call(t,r)&&(o[r]=t[r])}return o}(t,U);return e}),t}},{key:"exportTelemetrySpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.telemetrySpan&&(this.telemetrySpan.end(t),this.telemetrySpan=this.tracing.startSpan("rollbar-telemetry",{}))}},{key:"capture",value:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:null,a={level:X(t,r),type:t,timestamp_ms:o||T(),body:e,source:"client"};n&&(a.uuid=n),i&&(a.otelAttributes=i);try{if(s(this.options.filterTelemetry)&&this.options.filterTelemetry(a))return!1}catch(t){this.options.filterTelemetry=null}return this.push(a),a}},{key:"captureEvent",value:function(t,e,r,n){return this.capture(t,e,r,n)}},{key:"captureError",value:function(t,e,r,n){var o,i=t.message||String(t),a={message:i};t.stack&&(a.stack=t.stack);var s={message:i,level:e,type:"error",uuid:r};return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-occurrence-event",s,G(n)),this.capture("error",a,e,r,n,s)}},{key:"captureLog",value:function(t,e,r,n){var o,i=r?"rollbar-occurrence-event":"rollbar-log-event",a=J({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,G(n)),this.capture("log",{message:t},e,r,n,a)}},{key:"captureNetwork",value:function(t,e,r,n){var o,i,a;e=e||"xhr",t.subtype=t.subtype||e,n&&(t.request=n);var s=this.levelFromStatus(t.status_code),u=1e6*(t.end_time_ms||0),l={type:t.subtype,method:t.method,url:t.url,statusCode:t.status_code,"request.headers":JSON.stringify(t.request_headers||{}),"response.headers":JSON.stringify((null===(o=t.response)||void 0===o?void 0:o.headers)||{}),"response.timeUnixNano":u.toString()},c=t.request,f=null===(i=t.response)||void 0===i?void 0:i.body;return c&&(l["request.body"]=JSON.stringify(c)),f&&(l["response.body"]=JSON.stringify(f)),null===(a=this.telemetrySpan)||void 0===a||a.addEvent("rollbar-network-event",l,G(t.start_time_ms)),this.capture("network",t,s,r,t.start_time_ms,l)}},{key:"levelFromStatus",value:function(t){return t>=200&&t<400?"info":0===t||t>=400?"error":"info"}},{key:"captureDom",value: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)}},{key:"captureInput",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.value,a=t.timestamp,s="rollbar-input-event",u={type:s,subtype:r,element:o,value:i},l={type:r,isSynthetic:n,element:o,value:i,endTimeUnixNano:G(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,G(a)),this.capture("dom",u,"info",null,a,l))}},{key:"captureClick",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-click-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o,endTimeUnixNano:G(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,G(i)),this.capture("dom",s,"info",null,i,u))}},{key:"_getRepeatedEvent",value:function(t,e){var r=this._lastEvent(this.queue);if(r&&r.body.type===t&&r.otelAttributes.target===e.target)return r}},{key:"_updateRepeatedEvent",value:function(t,e,r){var n=Math.max(r-t.timestamp_ms,1);t.body.value=e.value,t.otelAttributes.value=e.value,t.otelAttributes.height=e.height,t.otelAttributes.width=e.width,t.otelAttributes.textZoomRatio=e.textZoomRatio,t.otelAttributes.endTimeUnixNano=G(r),t.otelAttributes.durationUnixNano=G(n),t.otelAttributes.count=(t.otelAttributes.count||1)+1,t.otelAttributes.rate=t.otelAttributes.count/(n/1e3)}},{key:"_lastEvent",value:function(t){return t.length>0?t[t.length-1]:null}},{key:"captureFocus",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.timestamp,a="rollbar-focus-event",s={type:a,subtype:r,element:o},u={type:r,isSynthetic:n,element:o};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,G(i)),this.capture("dom",s,"info",null,i,u)}},{key:"captureResize",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.width,i=t.height,a=t.textZoomRatio,s=t.timestamp,u="rollbar-resize-event",l={type:u,subtype:r,width:o,height:i,textZoomRatio:a},c={type:r,isSynthetic:n,width:o,height:i,textZoomRatio:a},f=this._getRepeatedEvent(u,c);return f?this._updateRepeatedEvent(f,c,s):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(u,c,G(s)),this.capture("dom",l,"info",null,s,c))}},{key:"captureDragDrop",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.element,i=t.dropEffect,a=t.effectAllowed,s=t.kinds,u=t.mediaTypes,l=t.timestamp,c="rollbar-dragdrop-event",f={type:c,subtype:r,isSynthetic:n},p={type:r,isSynthetic:n};return"dragstart"===r&&(f=J(J({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=J(J({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=J(J({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=J(J({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,G(l)),this.capture("dom",f,"info",null,l,p)}},{key:"captureNavigation",value:function(t,e,r,n){var o;return null===(o=this.telemetrySpan)||void 0===o||o.addEvent("rollbar-navigation-event",{"previous.url.full":t,"url.full":e},G(n)),this.capture("navigation",{from:t,to:e},"info",r,n)}},{key:"captureDomContentLoaded",value:function(t){return this.capture("navigation",{subtype:"DOMContentLoaded"},"info",void 0,t&&t.getTime())}},{key:"captureLoad",value:function(t){return this.capture("navigation",{subtype:"load"},"info",void 0,t&&t.getTime())}},{key:"captureConnectivityChange",value:function(t){var e,r=t.type,n=t.isSynthetic,o=t.timestamp,i="rollbar-connectivity-event",a={type:i,subtype:r},s={type:r,isSynthetic:n};return null===(e=this.telemetrySpan)||void 0===e||e.addEvent(i,s,G(o)),this.capture("connectivity",a,"info",null,o,s)}},{key:"_captureRollbarItem",value: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}},{key:"push",value:function(t){this.queue.push(t),this.queue.length>this.maxQueueSize&&this.queue.shift()}}],e&&B(t.prototype,e),r&&B(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function X(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var Z=z;function Q(t){return Q="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(t)}function K(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Y(n.key),n)}}function Y(t){var e=function(t,e){if("object"!=Q(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Q(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Q(e)?e:e+""}var tt=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this._currentContext=e?new Map(e):new Map}return e=t,(r=[{key:"getValue",value:function(t){return this._currentContext.get(t)}},{key:"setValue",value:function(e,r){var n=new t(this._currentContext);return n._currentContext.set(e,r),n}},{key:"deleteValue",value:function(e){var r=new t(self._currentContext);return r._currentContext.delete(e),r}}])&&K(e.prototype,r),n&&K(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),et=new tt;function rt(t){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(t)}function nt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ot(n.key),n)}}function ot(t){var e=function(t,e){if("object"!=rt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=rt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==rt(e)?e:e+""}var it=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.currentContext=et},e=[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||et,e}},{key:"exitContext",value:function(t){return this.currentContext=t,this.currentContext}},{key:"with",value:function(t,e,r){var n=this.enterContext(t);try{for(var o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return e.call.apply(e,[r].concat(i))}finally{this.exitContext(n)}}}],e&&nt(t.prototype,e),r&&nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function at(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function st(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var ut={fromMillis:at,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:st,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?st(at(performance.timeOrigin),at(performance.now())):at(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function lt(t){return lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lt(t)}function ct(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||pt(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ft(t){return function(t){if(Array.isArray(t))return dt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||pt(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pt(t,e){if(t){if("string"==typeof t)return dt(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,yt(n.key),n)}}function yt(t){var e=function(t,e){if("object"!=lt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==lt(e)?e:e+""}var vt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e,this.options=r},e=[{key:"export",value:function(t,e){mt.push.apply(mt,ft(t))}},{key:"toPayload",value:function(){var t=this,e=mt.slice();if(mt.length=0,!e||!e.length)return{resourceSpans:[]};var r,n=e[0]&&e[0].resource||{},o=new Map,i=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=pt(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}(e);try{for(i.s();!(r=i.n()).done;){var a=r.value,s=a.instrumentationScope?"".concat(a.instrumentationScope.name,":").concat(a.instrumentationScope.version):"default:1.0.0";o.has(s)||o.set(s,{scope:a.instrumentationScope||{name:"default",version:"1.0.0",attributes:[]},spans:[]}),o.get(s).spans.push(this._transformSpan(a))}}catch(t){i.e(t)}finally{i.f()}return{resourceSpans:[{resource:this._transformResource(n),scopeSpans:Array.from(o.values()).map(function(e){return{scope:t._transformInstrumentationScope(e.scope),spans:e.spans}})}]}}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.api.postSpans(t,e)}},{key:"_transformSpan",value:function(t){var e,r=this,n=function(t){return Object.entries(t||{}).map(function(t){var e=ct(t,2),n=e[0],o=e[1];return{key:n,value:r._transformAnyValue(o)}})};return{traceId:t.spanContext.traceId,spanId:t.spanContext.spanId,parentSpanId:t.parentSpanId||"",name:t.name,kind:t.kind||1,startTimeUnixNano:ut.toNanos(t.startTime),endTimeUnixNano:ut.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map(function(t){return{timeUnixNano:ut.toNanos(t.time),name:t.name,attributes:n(t.attributes)}}))}}},{key:"_transformResource",value:function(t){var e=this,r=t.attributes||{};return{attributes:Object.entries(r).map(function(t){var r=ct(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}},{key:"_transformInstrumentationScope",value:function(t){var e=this;return{name:t.name||"",version:t.version||"",attributes:(t.attributes||[]).map(function(t){return{key:t.key,value:e._transformAnyValue(t.value)}})}}},{key:"_transformAnyValue",value:function(t){var e=this;if(null==t)return{stringValue:""};var r=lt(t);return"string"===r?{stringValue:t}:"number"===r?Number.isInteger(t)?{intValue:t.toString()}:{doubleValue:t}:"boolean"===r?{boolValue:t}:Array.isArray(t)?{arrayValue:{values:t.map(function(t){return e._transformAnyValue(t)})}}:"object"===r?{kvlistValue:{values:Object.entries(t).map(function(t){var r=ct(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}:{stringValue:String(t)}}}],e&&ht(t.prototype,e),r&&ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),mt=[];var bt={gen:function(){var t=new Uint8Array(arguments.length>0&&void 0!==arguments[0]?arguments[0]:16);return crypto.getRandomValues(t),Array.from(t,function(t){return t.toString(16).padStart(2,"0")}).join("")}};function gt(t){return gt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gt(t)}function wt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function kt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?wt(Object(r),!0).forEach(function(e){_t(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):wt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function St(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ot(n.key),n)}}function _t(t,e,r){return(e=Ot(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ot(t){var e=function(t,e){if("object"!=gt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=gt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==gt(e)?e:e+""}var xt="RollbarSession",Et=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),_t(this,"_attributes",void 0),this.options=r,this.tracing=e,this.window=e.window,this.session=null,this._attributes={}},e=[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.session||(this.getSession()||this.createSession(),this.initSessionAttributes(t)),this}},{key:"getSession",value:function(){try{var t=this.window.sessionStorage.getItem(xt);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:bt.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(xt,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=kt(kt({},this._attributes),t),this}},{key:"setUser",value:function(t){return this.setAttributes({"user.id":null==t?void 0:t.id,"user.email":null==t?void 0:t.email,"user.name":(null==t?void 0:t.name)||(null==t?void 0:t.username)}),this}},{key:"initSessionAttributes",value:function(t){var e,r,n;return this.setAttributes(kt({"session.id":this.session.id,"browser.brands":null===(e=navigator.userAgentData)||void 0===e?void 0:e.brands,"browser.language":navigator.language,"browser.mobile":null===(r=navigator.userAgentData)||void 0===r?void 0:r.mobile,"browser.platform":null===(n=navigator.userAgentData)||void 0===n?void 0:n.platform,"client.address":"$remote_ip","rollbar.notifier.framework":"browser-js","user_agent.original":navigator.userAgent},t)),this}}],e&&St(t.prototype,e),r&&St(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),jt=function(){},It={debug:0,info:1,warn:2,error:3,disable:4},Tt={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return jt("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return jt("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return jt("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return jt("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return jt("info",e)},init:function(t){var e=t.logLevel;jt=function(t,r){It[t]<It[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},Pt=Tt;function At(t){return At="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(t)}function Rt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ct(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ct(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Ct(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Lt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qt(n.key),n)}}function qt(t){var e=function(t,e){if("object"!=At(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==At(e)?e:e+""}var Nt=function(){return t=function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.exporter=e,this.options=r,this.pendingSpans=new Map,this.transforms=[this.userTransform.bind(this)]},e=[{key:"addTransform",value:function(t){this.transforms.unshift(t)}},{key:"userTransform",value:function(t){this.options.transformSpan&&this.options.transformSpan({span:t})}},{key:"applyTransforms",value:function(t){var e,r=Rt(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){Pt.error("Error running span transform callback",t)}}}catch(t){r.e(t)}finally{r.f()}}},{key:"onStart",value:function(t,e){this.pendingSpans.set(t.span.spanContext.spanId,t)}},{key:"onEnd",value:function(t){this.applyTransforms(t.span),this.exporter.export([t.export()]),this.pendingSpans.delete(t.span.spanContext.spanId)}}],e&&Lt(t.prototype,e),r&&Lt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Dt(t){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(t)}function Mt(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return Ut(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ut(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Ht(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Ft(n.key),n)}}function Ft(t){var e=function(t,e){if("object"!=Dt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Dt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Dt(e)?e:e+""}var Jt=function(){return t=function t(e){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.usePerformance=e.usePerformance,this.initReadableSpan(e),this.spanProcessor=e.spanProcessor,this.spanProcessor.onStart(this,e.context),e.attributes&&this.setAttributes(e.attributes),this},e=[{key:"initReadableSpan",value:function(t){var e;this.span={name:t.name,kind:t.kind,spanContext:t.spanContext,parentSpanId:t.parentSpanId,startTime:t.startTime||ut.now(t.usePerformance),endTime:[0,0],status:{code:0,message:""},attributes:{"session.id":null===(e=t.session)||void 0===e?void 0:e.id},links:[],events:[],duration:0,ended:!1,resource:t.resource,instrumentationScope:t.scope,droppedAttributesCount:0,droppedEventsCount:0,droppedLinksCount:0}}},{key:"spanContext",value:function(){return this.span.spanContext}},{key:"spanId",get:function(){return this.span.spanContext.spanId}},{key:"traceId",get:function(){return this.span.spanContext.traceId}},{key:"setAttribute",value:function(t,e){return null==e||this.span.ended||0===t.length||(this.span.attributes[t]=e),this}},{key:"setAttributes",value:function(t){for(var e=0,r=Object.entries(t);e<r.length;e++){var n=Mt(r[e],2),o=n[0],i=n[1];this.setAttribute(o,i)}return this}},{key:"addEvent",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0;return this.span.ended||this.span.events.push({name:t,attributes:e,time:r||ut.now(),droppedAttributesCount:0}),this}},{key:"isRecording",value:function(){return!1===this.span.ended}},{key:"end",value:function(t,e){t&&this.setAttributes(t),this.span.endTime=e||ut.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}],e&&Ht(t.prototype,e),r&&Ht(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Vt(t){return Vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(t)}function Bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Wt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Bt(Object(r),!0).forEach(function(e){$t(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Bt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function $t(t,e,r){return(e=zt(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Gt(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,zt(n.key),n)}}function zt(t){var e=function(t,e){if("object"!=Vt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Vt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Vt(e)?e:e+""}var Xt=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.spanProcessor=r,this.tracing=e},e=[{key:"startSpan",value:function(t){var e,r,n,o,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.tracing.contextManager.active(),u=this.tracing.getSpan(s),l=null==u?void 0:u.spanContext(),c=bt.gen(8),f=null;l?(o=l.traceId,f=l.traceState,i=l.spanId):o=bt.gen(16);var p={traceId:o,spanId:c,traceFlags:0,traceState:f},d={attributes:Wt(Wt({},(null===(e=this.tracing.resource)||void 0===e?void 0:e.attributes)||{}),(null===(r=a.resource)||void 0===r?void 0:r.attributes)||{})};return new Jt({resource:d,scope:this.tracing.scope,session:null===(n=this.tracing.session)||void 0===n?void 0:n.session,context:s,spanContext:p,name:t,kind:0,parentSpanId:i,spanProcessor:this.spanProcessor,startTime:a.startTime,usePerformance:a.usePerformance})}}],e&&Gt(t.prototype,e),r&&Gt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Kt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Qt(Object(r),!0).forEach(function(e){Yt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Yt(t,e,r){return(e=ee(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function te(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ee(n.key),n)}}function ee(t){var e=function(t,e){if("object"!=Zt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Zt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Zt(e)?e:e+""}var re,ne=(re="Rollbar Context Key SPAN",Symbol.for(re)),oe=function(){return t=function t(e,r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=r,this.options=n,this.window=e,this.window.sessionStorage&&(this.session=new Et(this,n)),this.createTracer()},e=[{key:"configure",value:function(t){this.options=t}},{key:"initSession",value:function(){this.session&&this.session.init()}},{key:"sessionId",get:function(){return this.session?this.session.session.id:null}},{key:"resource",get:function(){var t,e;return{attributes:Kt(Kt({},this.options.resource||{}),{},{"rollbar.environment":null!==(t=null===(e=this.options.payload)||void 0===e?void 0:e.environment)&&void 0!==t?t:this.options.environment})}}},{key:"scope",get:function(){return{name:"rollbar-browser-js",version:this.options.version}}},{key:"idGen",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16;return bt.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new it,this.exporter=new vt(this.api,this.options),this.spanProcessor=new Nt(this.exporter,this.options.tracing),this.tracer=new Xt(this,this.spanProcessor)}},{key:"getTracer",value:function(){return this.tracer}},{key:"addSpanTransform",value:function(t){this.spanProcessor.addTransform(t)}},{key:"getSpan",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active()).getValue(ne)}},{key:"setSpan",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.contextManager.active(),e=arguments.length>1?arguments[1]:void 0;return t.setValue(ne,e)}},{key:"startSpan",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.contextManager.active();return this.tracer.startSpan(t,e,r)}},{key:"with",value:function(t,e,r){for(var n,o=arguments.length,i=new Array(o>3?o-3:0),a=3;a<o;a++)i[a-3]=arguments[a];return(n=this.contextManager).with.apply(n,[t,e,r].concat(i))}},{key:"withSpan",value:function(t,e,r,n){var o=this.startSpan(t,e);return this.with(this.setSpan(this.contextManager.active(),o),r,n,o)}}],e&&te(t.prototype,e),r&&te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ie(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||se(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ae(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=se(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function se(t,e){if(t){if("string"==typeof t)return ue(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ue(t,e):void 0}}function ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function le(t,e){return[t,m(t,e)]}function ce(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function fe(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=ae(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=ce(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=ce(n=o.trace.frames,r),o.trace.frames=n);return[t,m(t,e)]}function pe(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function de(t,e,r){return e=R(e,function e(r,n,o){switch(a(n)){case"string":return pe(t,n);case"object":case"array":return R(n,e,o);default:return n}}),[e,m(e,r)]}function he(t){return t.exception&&(delete t.exception.description,t.exception.message=pe(255,t.exception.message)),t.frames=ce(t.frames,1),t}function ye(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=ae(o.entries());try{for(i.s();!(n=i.n()).done;){var a=ie(n.value,2),s=a[0],u=a[1];o[s]=he(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=he(r.trace));return[t,m(t,e)]}function ve(t,e){return 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}(t)>e}var me={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[le,fe,de.bind(null,1024),de.bind(null,512),de.bind(null,256),ye];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!ve(i.value,r))return i;return i},raw:le,truncateFrames:fe,truncateStrings:de,maybeTruncateValue:pe};function be(t){if(!i(t.context,"string")){var e=m(t.context);e.error?t.context="Error: could not serialize 'context'":t.context=e.value||"",t.context.length>255&&(t.context=t.context.substr(0,255))}return{data:t}}function ge(t,e,r){var n=e.hostname,o=e.protocol,i=e.port,a=e.path,s=e.search,u=t.timeout,l=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),c=t.proxy;if(t.endpoint){var f=r.parse(t.endpoint);n=f.hostname,o=f.protocol,i=f.port,a=f.pathname,s=f.search}return{timeout:u,hostname:n,protocol:o,port:i,path:a,search:s,proxy:c,transport:l}}function we(t,e){var r=t.protocol||"https:",n=t.port||("http:"===r?80:"https:"===r?443:void 0),o=t.hostname,i=t.path,a=t.timeout,s=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:a,protocol:r,hostname:o,path:i,port:n,method:e,transport:s}}function ke(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function Se(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ke(Object(r),!0).forEach(function(e){_e(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ke(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function _e(t,e,r){return(e=Te(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Oe(t){return Oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Oe(t)}function xe(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var u=n&&n.prototype instanceof s?n:s,l=Object.create(u.prototype);return Ee(l,"_invoke",function(r,n,o){var i,s,u,l=0,c=o||[],f=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,s=0,u=t,p.n=r,a}};function d(r,n){for(s=r,u=n,e=0;!f&&l&&!o&&e<c.length;e++){var o,i=c[e],d=p.p,h=i[2];r>3?(o=h===n)&&(u=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(s=0,p.v=n,p.n=i[1]):d<h&&(o=r<3||i[0]>n||n>h)&&(i[4]=r,i[5]=n,p.n=h,s=0))}if(o||r>1)return a;throw f=!0,n}return function(o,c,h){if(l>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,h),s=c,u=h;(e=s<2?t:u)||!f;){i||(s?s<3?(s>1&&(p.n=-1),d(s,u)):p.n=u:p.v=u);try{if(l=2,i){if(s||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,s<2&&(s=0)}else 1===s&&(e=i.return)&&e.call(i),s<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=t}else if((e=(f=p.n<0)?u:r.call(n,p))!==a)break}catch(e){i=t,s=1,u=e}finally{l=1}}return{value:e,done:f}}}(r,o,i),!0),l}var a={};function s(){}function u(){}function l(){}e=Object.getPrototypeOf;var c=[][n]?e(e([][n]())):(Ee(e={},n,function(){return this}),e),f=l.prototype=s.prototype=Object.create(c);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,Ee(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Ee(f,"constructor",l),Ee(l,"constructor",u),u.displayName="GeneratorFunction",Ee(l,o,"GeneratorFunction"),Ee(f),Ee(f,o,"Generator"),Ee(f,n,function(){return this}),Ee(f,"toString",function(){return"[object Generator]"}),(xe=function(){return{w:i,m:p}})()}function Ee(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ee=function(t,e,r,n){function i(e,r){Ee(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},Ee(t,e,r,n)}function je(t,e,r,n,o,i,a){try{var s=t[i](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,o)}function Ie(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Te(n.key),n)}}function Te(t){var e=function(t,e){if("object"!=Oe(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Oe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Oe(e)?e:e+""}var Pe={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},Ae={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},Re=function(){return t=function t(e,r,n,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.options=e,this.transport=r,this.url=n,this.truncation=o,this.accessToken=e.accessToken,this.transportOptions=Ce(e,n),this.OTLPTransportOptions=Le(e,n)},e=[{key:"_postPromise",value:function(t){var e=this,r=t.accessToken,n=t.options,o=t.payload,i=t.headers;return new Promise(function(t,a){e.transport.post({accessToken:r,options:n,payload:o,headers:i,callback:function(e,r){return e?a(e):t(r)}})})}},{key:"postItem",value:function(t,e){var r=this,n=we(this.transportOptions,"POST"),o=be(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=xe().m(function t(e){var r,n,o=arguments;return xe().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=we(this.OTLPTransportOptions,"POST"),t.a(2,this._postPromise({accessToken:this.accessToken,options:n,payload:e,headers:r}))},t,this)}),o=function(){var t=this,e=arguments;return new Promise(function(r,o){var i=n.apply(t,e);function a(t){je(i,r,o,a,s,"next",t)}function s(t){je(i,r,o,a,s,"throw",t)}a(void 0)})},function(t){return o.apply(this,arguments)})},{key:"buildJsonPayload",value:function(t,e){var r,n=be(t);return(r=this.truncation?this.truncation.truncate(n):m(n)).error?(e&&e(r.error),null):r.value}},{key:"postJsonPayload",value:function(t,e){var r=we(this.transportOptions,"POST");this.transport.postJsonPayload(this.accessToken,r,t,e)}},{key:"configure",value:function(t){var e=this.options;return this.options=A(e,t),this.transportOptions=Ce(this.options,this.url),this.OTLPTransportOptions=Le(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&Ie(t.prototype,e),r&&Ie(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function Ce(t,e){return ge(t,Pe,e)}function Le(t,e){var r;return ge(t=Se(Se({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),Ae,e)}var qe=Re,Ne="3.0.0",De="api.rollbar.com/api/1/item/",Me="debug",Ue="debug",He="error",Fe=/(^|@)\S+:\d+/,Je=/^\s*at .*(\S+:\d+|\(native\))/m,Ve=/^(eval@)?(\[native code\])?$/;function Be(t,e){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return function(t,e){return!t.stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),o=[],i=2,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({file:s[2],line:+s[1],raw:n[i]})}return $e(o,e)}(t):t.stack?function(t,e){var r=$e(t.stack.split("\n").filter(function(t){return!!t.match(Fe)&&!t.match(/^Error created at/)}),e);return r.map(function(t){var e,r=t.split("@"),n=We(r.pop()),o=r.shift()||"",i=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;return o.match(/\(([^)]*)\)/)&&(e=o.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:i,args:void 0===e||"[arguments not available]"===e?void 0:e.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}(t,e):function(t,e){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),o=[],i=0,a=n.length;i<a;i+=2){var s=r.exec(n[i]);s&&o.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[i]})}return $e(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(Je))return function(t,e){return Ge(t.stack,e)}(t,e);if(t.stack)return function(t,e){return ze(t.stack,e)}(t,e);if(null!=e&&e.allowEmpty)return[];throw new Error("Cannot parse given Error object")}function We(t){if(!t.includes(":"))return[t,void 0,void 0];var e=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(t.replace(/[()]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]}function $e(t,e){return e&&null!=e.slice?Array.isArray(e.slice)?t.slice(e.slice[0],e.slice[1]):t.slice(0,e.slice):t}function Ge(t,e){return $e(t.split("\n").filter(function(t){return!!t.match(Je)}),e).map(function(t){t.includes("(eval ")&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var e=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=e.match(/ (\(.+\)$)/);e=r?e.replace(r[0],""):e;var n=We(r?r[1]:e);return{function:r&&e||void 0,file:["eval","<anonymous>"].includes(n[0])?void 0:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:t}})}function ze(t,e){return $e(t.split("\n").filter(function(t){return!t.match(Ve)}),e).map(function(t){if(t.includes(" > eval")&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),t.includes("@")||t.includes(":")){var e=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,r=t.match(e),n=r&&r[1]?r[1]:void 0,o=We(t.replace(e,""));return{function:n,file:o[0],line:o[1]?+o[1]:void 0,col:o[2]?+o[2]:void 0,raw:t}}return{function:t}})}function Xe(t){return t.map(function(t){return{functionName:t.function,args:t.args,fileName:t.file,lineNumber:t.line,columnNumber:t.col,source:t.raw}})}var Ze=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Qe(){return null}function Ke(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 Ye(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Xe(Be(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new Ke(r[o]));return n}(),message:t.message,name:tr(t),rawStack:t.stack,rawException:t}}function tr(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}var er={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Ze),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:Qe,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new Ye(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new Ye(r,e)},Stack:Ye,Frame:Ke};function rr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return nr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function or(t,e){var r=t.level,n=d[r]||0,o=e.reportLevel;return!(n<(d[o]||0))}function ir(t,e,r){if(!t)return!r;var n,o,a=t.frames;if(!a||0===a.length)return!r;for(var s=e.length,u=a.length,l=0;l<u;l++){if(!i(n=a[l].filename,"string"))return!r;for(var c=0;c<s;c++)if(o=e[c],new RegExp(o).test(n))return!0}return!1}function ar(t,e,r,n){var o,i,a=!1;"blocklist"===r&&(a=!0);try{if(o=a?e.hostBlockList:e.hostSafeList,i=j(t,"body.trace_chain")||[j(t,"body.trace")],!o||0===o.length)return!a;if(0===i.length||!i[0])return!a;for(var s=i.length,u=0;u<s;u++)if(ir(i[u],o,a))return!0}catch(t){a?e.hostBlockList=null:e.hostSafeList=null;var l=a?"hostBlockList":"hostSafeList";return n.error("Error while reading your configuration's "+l+" option. Removing custom "+l+".",t),!a}return!1}function sr(t){return function(e,r){var n,o,i,a,s,u;try{if(!(i=r.ignoredMessages)||0===i.length)return!0;if(u=function(t){var e=t.body,r=[];if(e.trace_chain){var n,o=rr(e.trace_chain);try{for(o.s();!(n=o.n()).done;){var i=n.value;r.push(j(i,"exception.message"))}}catch(t){o.e(t)}finally{o.f()}}e.trace&&r.push(j(e,"trace.exception.message"));e.message&&r.push(j(e,"message.body"));return r}(e),0===u.length)return!0;for(a=i.length,n=0;n<a;n++)for(s=new RegExp(i[n],"gi"),o=0;o<u.length;o++)if(s.test(u[o]))return!1}catch(e){r.ignoredMessages=null,t.error("Error while reading your configuration's ignoredMessages option. Removing custom ignoredMessages.")}return!0}}function ur(t){return ur="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ur(t)}function lr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,cr(n.key),n)}}function cr(t){var e=function(t,e){if("object"!=ur(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ur(e)?e:e+""}var fr=function(){return t=function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.queue=e,this.options=r,this.transforms=[],this.diagnostic={}},e=[{key:"configure",value:function(t){var e;null===(e=this.queue)||void 0===e||e.configure(t);var r=this.options;return this.options=A(r,t),this}},{key:"addTransform",value:function(t){return s(t)&&this.transforms.push(t),this}},{key:"log",value:function(t,e){var r=this;if(e=s(e)?e:function(){},!this.options.enabled)return e(new Error("Rollbar is not enabled"),null);this.queue.addPendingItem(t);var n=t.err;this._applyTransforms(t,function(o,i){if(o)return r.queue.removePendingItem(t),e(o,null);r.queue.addItem(i,e,n,t)})}},{key:"_applyTransforms",value:function(t,e){var r=-1,n=this.transforms.length,o=this.transforms,i=this.options,a=function(t,s){t?e(t,null):++r!==n?o[r](s,i,a):e(null,s)};a(null,t)}}],e&&lr(t.prototype,e),r&&lr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function pr(t){return pr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pr(t)}function dr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,hr(n.key),n)}}function hr(t){var e=function(t,e){if("object"!=pr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==pr(e)?e:e+""}var yr,vr,mr,br=function(){function t(e,r,n,o,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rateLimiter=e,this.api=r,this.logger=n,this.options=o,this.replay=i,this.predicates=[],this.pendingItems=[],this.pendingRequests=[],this.retryQueue=[],this.retryHandle=null,this.waitCallback=null,this.waitIntervalID=null}return e=t,r=[{key:"configure",value:function(t){var e;null===(e=this.api)||void 0===e||e.configure(t);var r=this.options;return this.options=A(r,t),this}},{key:"addPredicate",value:function(t){return s(t)&&this.predicates.push(t),this}},{key:"addPendingItem",value:function(t){this.pendingItems.push(t)}},{key:"removePendingItem",value:function(t){var e=this.pendingItems.indexOf(t);-1!==e&&this.pendingItems.splice(e,1)}},{key:"addItem",value:function(t,e,r,n){var o=this;e&&s(e)||(e=function(){});var i=t.data,a=this._applyPredicates(i);if(a.stop)return this.removePendingItem(n),void e(a.err);if(this._maybeLog(i,r),this.removePendingItem(n),this.options.transmit){this.replay&&i.body&&(t.replayId=this.replay.capture(null,i.uuid,{type:"occurrence",level:t.level}),t.replayId&&E(t.data,[{key:"replay_id",value:t.replayId}])),this.pendingRequests.push(i);try{this._makeApiRequest(i,function(r,n,a){o._dequeuePendingRequest(i),t.replayId&&o.replay.sendOrDiscardReplay(t.replayId,r,n,a),e(r,n)})}catch(r){var u;this._dequeuePendingRequest(i),t.replayId&&(null===(u=this.replay)||void 0===u||u.discard(t.replayId)),e(r)}}else e(new Error("Transmit disabled"))}},{key:"wait",value:function(t){var e=this;s(t)&&(this.waitCallback=t,this._maybeCallWait()||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitIntervalID=setInterval(function(){e._maybeCallWait()},500)))}},{key:"_applyPredicates",value: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}}},{key:"_makeApiRequest",value:function(t,e){var r=this,n=this.rateLimiter.shouldSend(t);n.shouldSend?this.api.postItem(t,function(n,o,i){n?r._maybeRetry(n,t,e):e(n,o,i)}):n.error?e(n.error):this.api.postItem(n.payload,e)}},{key:"_maybeRetry",value:function(e,r,n){var o=!1;if(this.options.retryInterval){for(var i=0,a=t.RETRIABLE_ERRORS.length;i<a;i++)if(e.code===t.RETRIABLE_ERRORS[i]){o=!0;break}o&&c(this.options.maxRetries)&&(r.retries=r.retries?r.retries+1:1,r.retries>this.options.maxRetries&&(o=!1))}o?this._retryApiRequest(r,n):n(e)}},{key:"_retryApiRequest",value:function(t,e){var r=this;this.retryQueue.push({item:t,callback:e}),this.retryHandle||(this.retryHandle=setInterval(function(){for(;r.retryQueue.length;){var t=r.retryQueue.shift();r._makeApiRequest(t.item,t.callback)}},this.options.retryInterval))}},{key:"_dequeuePendingRequest",value:function(t){var e=this.pendingRequests.indexOf(t);-1!==e&&(this.pendingRequests.splice(e,1),this._maybeCallWait())}},{key:"_maybeLog",value:function(t,e){if(this.logger&&this.options.verbose){var r=e||j(t,"body.trace.exception.message")||j(t,"body.trace_chain.0.exception.message");if(r)return void this.logger.error(r);(r=j(t,"body.message.body"))&&this.logger.log(r)}}},{key:"_maybeCallWait",value:function(){return!(!s(this.waitCallback)||0!==this.pendingItems.length||0!==this.pendingRequests.length||(this.waitIntervalID&&(this.waitIntervalID=clearInterval(this.waitIntervalID)),this.waitCallback(),0))}}],r&&dr(e.prototype,r),n&&dr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();yr=br,mr=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(vr=hr(vr="RETRIABLE_ERRORS"))in yr?Object.defineProperty(yr,vr,{value:mr,enumerable:!0,configurable:!0,writable:!0}):yr[vr]=mr;var gr=br;function wr(t){return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wr(t)}function kr(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Sr(n.key),n)}}function Sr(t){var e=function(t,e){if("object"!=wr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=wr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==wr(e)?e:e+""}var _r=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.startTime=Date.now(),this.counter=0,this.perMinCounter=0,this.platform=null,this.platformOptions={},this.configureGlobal(e)}return function(t,e,r){return e&&kr(t.prototype,e),r&&kr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"configureGlobal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.startTime,n=e.maxItems,o=e.itemsPerMinute;void 0!==r&&(t.globalSettings.startTime=r),void 0!==n&&(t.globalSettings.maxItems=n),void 0!==o&&(t.globalSettings.itemsPerMinute=o)}},{key:"shouldSend",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),n=r-this.startTime;(n<0||n>=6e4)&&(this.startTime=r,this.perMinCounter=0);var o=t.globalSettings.maxItems,i=t.globalSettings.itemsPerMinute;if(Or(e,o,this.counter))return xr(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(Or(e,i,this.perMinCounter))return xr(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!Or(e,o,this.counter),s=a,u=a&&!Or(e,i,this.perMinCounter);return xr(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function Or(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function xr(t,e,r,n,o,i,a){var s=null,u=r?new Error(r):null;return u||n||(s=function(t,e,r,n,o){var i=e.environment||e.payload&&e.payload.environment,a=o?"item per minute limit reached, ignoring errors until timeout":"maxItems has been hit, ignoring errors until reset.",s={body:{message:{body:a,extra:{maxItems:r,itemsPerMinute:n}}},language:"javascript",environment:i,notifier:{version:e.notifier&&e.notifier.version||e.version}};"browser"===t?(s.platform="browser",s.framework="browser-js",s.notifier.name="rollbar-browser-js"):"server"===t?(s.framework=e.framework||"node-js",s.notifier.name=e.notifier.name):"react-native"===t&&(s.framework=e.framework||"react-native",s.notifier.name=e.notifier.name);return s}(t,e,o,i,a)),{error:u,shouldSend:n,payload:s}}!function(t,e,r){(e=Sr(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(_r,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});var Er=_r;function jr(t,e,r,n,o,i,a){this.options=A(t),this.logger=r,jr.rateLimiter.configureGlobal(this.options),jr.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new gr(jr.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Tr(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new fr(this.queue,this.options),this.telemeter=n,Ir(t),this.lastError=null,this.lastErrorHash="none"}function Ir(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Tr(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)}jr.rateLimiter=new Er({maxItems:0,itemsPerMinute:60}),jr.prototype.global=function(t){return jr.rateLimiter.configureGlobal(t),this},jr.prototype.configure=function(t,e){var r=this.options,n={};e&&(n={payload:e}),this.options=A(r,t,n);var o=this.options.tracer||null;return Tr(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),Ir(t),this.global(this.options),Tr(t.tracer)&&(this.tracer=t.tracer),this},jr.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},jr.prototype.debug=function(t){this._log("debug",t)},jr.prototype.info=function(t){this._log("info",t)},jr.prototype.warn=function(t){this._log("warning",t)},jr.prototype.warning=function(t){this._log("warning",t)},jr.prototype.error=function(t){this._log("error",t)},jr.prototype.critical=function(t){this._log("critical",t)},jr.prototype.wait=function(t){this.queue.wait(t)},jr.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},jr.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},jr.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},jr.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},jr.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},jr.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{e.level=e.level||t,this._addItemAttributes(e),this._addTracingInfo(e);var o=this.telemeter;o&&(o._captureRollbarItem(e),e.telemetryEvents=o.copyEvents()||[]),this.notifier.log(e,r)}catch(t){r&&r(t),this.logger.error(t)}},jr.prototype._addItemAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:null===(r=this.tracing)||void 0===r?void 0:r.sessionId},{key:"span_id",value:null==n?void 0:n.spanId},{key:"trace_id",value:null==n?void 0:n.traceId}];t._isUncaught&&o.push({key:"is_uncaught",value:"true"}),E(t.data,o),null==n||n.addEvent("rollbar.occurrence",[{key:"rollbar.occurrence.uuid",value:t.uuid}])},jr.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},jr.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)},jr.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=".concat(t.uuid)),e.setTag("rollbar.occurrence_url","https://rollbar.com/occurrence/uuid/?uuid=".concat(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}}}};var Pr=jr;function Ar(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Rr(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=A(t.data,n),r(null,t)}function Cr(t,e,r){t.telemetryEvents&&I(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function Lr(t,e,r){if(t.message){var n="data.body.trace_chain.0",o=j(t,n);if(o||(o=j(t,n="data.body.trace")),o){if(!o.exception||!o.exception.description)return I(t,n+".exception.description",t.message),void r(null,t);I(t,n+".extra",A(j(t,n+".extra")||{},{message:t.message}))}r(null,t)}else r(null,t)}function qr(t){return function(e,r,n){var o,a=A(e),l=null;try{s(r.transform)&&(l=r.transform(a.data,e))}catch(o){return r.transform=null,t.error("Error while calling custom transform() function. Removing custom transform().",o),void n(null,e)}u(o=l)&&i(o.then,"function")?l.then(function(t){t&&(a.data=t),n(null,a)},function(t){n(t,e)}):n(null,a)}}function Nr(t,e,r){if(!e.sendConfig)return r(null,t);var n=j(t,"data.custom")||{};n._rollbarConfig=e,t.data.custom=n,r(null,t)}function Dr(t,e){s(t[e])&&(t[e]=t[e].toString())}function Mr(t,e,r){var n=e._configuredOptions;Dr(n,"transform"),Dr(n,"checkIgnore"),Dr(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Ur(t,e,r){var n=A(t.notifier.client.notifier.diagnostic,t.diagnostic);if(j(t,"err._isAnonymous")&&(n.is_anonymous=!0),t._isUncaught&&(n.is_uncaught=t._isUncaught),t.err)try{n.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){n.raw_error={failed:String(t)}}t.data.notifier.diagnostic=A(t.data.notifier.diagnostic,n),r(null,t)}function Hr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Fr=[].concat(function(t){return function(t){if(Array.isArray(t))return Hr(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return Hr(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Hr(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(["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"]),Jr={scrubFields:Fr};function Vr(t,e){return!j(e,"plugins.jquery.ignoreAjaxErrors")||!j(t,"body.message.extra.isAjax")}function Br(t,e,r){if(t.err&&"DOMException"===er.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)}function Wr(t,e,n){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||er.parse(t.err,t.skipFrames),e.addErrorContext&&function(t){var e=[],n=t.err;e.push(n);for(;n.nested||n.cause;)n=n.nested||n.cause,e.push(n);!function(t,e){var n=t.data.custom||{},o=!1;try{var i,a=r(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;l(s,"rollbarContext")&&(n=A(n,k(s.rollbarContext)),o=!0)}}catch(t){a.e(t)}finally{a.f()}o&&(t.data.custom=n)}catch(e){t.diagnostic.error_context="Failed: "+e.message}}(t,e)}(t)}catch(e){Pt.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}n(null,t)}function $r(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function Gr(t,e,r){var n=e.payload&&e.payload.environment||e.environment;t.data=A(t.data,{environment:n,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)}function zr(t,e,r){t.stackInfo?t.stackInfo.traceChain?function(t,e,r){for(var n=t.stackInfo.traceChain,o=[],i=n.length,a=0;a<i;a++){var s=Qr(t,n[a],e);o.push(s)}I(t,"data.body",{trace_chain:o}),r(null,t)}(t,e,r):function(t,e,r){var n=Zr(t);if(n){I(t,"data.body",{trace:Qr(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=er.guessErrorClass(o.message),a=Kr(o,i[0],e),s=i[1];t.message=a+": "+s,Xr(t,e,r)}}(t,e,r):Xr(t,e,r)}function Xr(t,e,r){var n=t.message,o=t.custom;n||(n="Item sent with null or missing arguments.");var i={body:n};o&&(i.extra=A(o)),I(t,"data.body",{message:i}),r(null,t)}function Zr(t){var e=((arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||t.stackInfo).stack;return e&&0===e.length&&t._unhandledStackInfo&&t._unhandledStackInfo.stack&&(e=t._unhandledStackInfo.stack),e}function Qr(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Zr(t,e),a=er.guessErrorClass(e.message),s={exception:{class:Kr(e,a[0],r),message:a[1]}};if(n&&(s.exception.description=n),i){var u,l,c,f,p,d,y,v;for(0===i.length&&(s.exception.stack=e.rawStack,s.exception.raw=String(e.rawException)),s.frames=[],y=0;y<i.length;++y)l={filename:(u=i[y]).url?h(u.url):"(unknown)",lineno:u.line||null,method:u.func&&"?"!==u.func?u.func:"[anonymous]",colno:u.column},r.sendFrameUrl&&(l.url=u.url),l.method&&l.method.endsWith&&l.method.endsWith("_rollbar_wrapped")||(c=f=p=null,(d=u.context?u.context.length:0)&&(v=Math.floor(d/2),f=u.context.slice(0,v),c=u.context[v],p=u.context.slice(v)),c&&(l.code=c),(f||p)&&(l.context={},f&&f.length&&(l.context.pre=f),p&&p.length&&(l.context.post=p)),u.args&&(l.args=u.args),s.frames.push(l));s.frames.reverse(),o&&(s.extra=A(o))}return s}function Kr(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}function Yr(t){return Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yr(t)}function tn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function en(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=Yr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Yr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Yr(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var rn=function(t){var e,r,n=t.accessToken,o=t.url,i=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.timeout;c(l)&&(e=new AbortController,r=setTimeout(function(){e.abort()},l)),s=function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?tn(Object(r),!0).forEach(function(e){en(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):tn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}({"Content-Type":"application/json","X-Rollbar-Access-Token":n,signal:e&&e.signal},s),fetch(o,{method:i,headers:s,body:a}).then(function(t){r&&clearTimeout(r);var e=t.headers,n=o.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.get("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.get("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.get("Rollbar-Replay-RateLimit-Reset")}:{},i=t.json();u(null,i,n)}).catch(function(t){Pt.error(t.message),u(t)})};function nn(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return on(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?on(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function on(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function an(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var sn=function(t){var e,r=t.accessToken,n=t.url,o=t.method,a=t.payload,s=t.headers,u=t.callback,l=t.requestFactory,f=t.timeout;if(!(e=l?l():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 u(new Error("No way to send a request"));try{try{var p=function(){try{if(p&&4===e.readyState){p=void 0;var t=b(e.responseText);if(function(t){return t&&t.status&&200===t.status}(e)){var r=n.endsWith("/api/1/item/")?{"Rollbar-Replay-Enabled":e.getResponseHeader("Rollbar-Replay-Enabled"),"Rollbar-Replay-RateLimit-Remaining":e.getResponseHeader("Rollbar-Replay-RateLimit-Remaining"),"Rollbar-Replay-RateLimit-Reset":e.getResponseHeader("Rollbar-Replay-RateLimit-Reset")}:{};return void u(t.error,t.value,r)}if(function(t){return t&&i(t.status,"number")&&t.status>=400&&t.status<600}(e)){if(403===e.status){var o=t.value&&t.value.message;Pt.error(o)}u(new Error(String(e.status)))}else{u(an("XHR response had no status code (likely connection failure)"))}}}catch(t){var a;a=t&&t.stack?t:new Error(t),u(a)}};if(e.open(o,n,!0),e.setRequestHeader){e.setRequestHeader("Content-Type","application/json"),e.setRequestHeader("X-Rollbar-Access-Token",r);for(var d=0,h=Object.entries(null!=s?s:{});d<h.length;d++){var y=nn(h[d],2),v=y[0],m=y[1];e.setRequestHeader(v,m)}}c(f)&&(e.timeout=f),e.onreadystatechange=p,e.send(a)}catch(t){if("undefined"!=typeof XDomainRequest){if(!window||!window.location)return u(new Error("No window available during request, unknown environment"));"http:"===window.location.href.substring(0,5)&&"https"===n.substring(0,5)&&(n="http"+n.substring(5));var g=new XDomainRequest;g.onprogress=function(){},g.ontimeout=function(){u(an("Request timed out","ETIMEDOUT"))},g.onerror=function(){u(new Error("Error during request"))},g.onload=function(){var t=b(g.responseText);u(t.error,t.value)},g.open(o,n,!0),g.send(a)}else u(new Error("Cannot find a method to transport a request"))}}catch(t){u(t)}};function un(t){this.truncation=t}un.prototype.get=function(t,e,r,n,o){n&&s(n)||(n=function(){}),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 a,s=e.path.indexOf("?"),u=e.path.indexOf("#");-1!==s&&(-1===u||u>s)?(a=e.path,e.path=a.substring(0,s)+i+"&"+a.substring(s+1)):-1!==u?(a=e.path,e.path=a.substring(0,u)+i+a.substring(u)):e.path=e.path+i}(t,e,r);var i=v(e);this._makeZoneRequest({accessToken:t,url:i,method:"GET",callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},un.prototype.post=function(t){var e,r=t.accessToken,n=t.options,o=t.payload,i=t.headers,a=t.callback,u=t.requestFactory;if(a&&s(a)||(a=function(){}),!o)return a(new Error("Cannot send empty request"));if((e=this.truncation&&o.body?this.truncation.truncate(o):m(o)).error)return a(e.error);var l=v(n);this._makeZoneRequest({accessToken:r,url:l,method:"POST",payload:e.value,headers:i,callback:a,requestFactory:u,timeout:n.timeout,transport:n.transport})},un.prototype.postJsonPayload=function(t,e,r,n,o){n&&s(n)||(n=function(){});var i=v(e);this._makeZoneRequest({accessToken:t,url:i,method:"POST",payload:r,callback:n,requestFactory:o,timeout:e.timeout,transport:e.transport})},un.prototype._makeZoneRequest=function(){var t=this,e="undefined"!=typeof window&&window||"undefined"!=typeof self&&self,r=e&&e.Zone&&e.Zone.root,n=Array.prototype.slice.call(arguments);r?r.run(function(){t._makeRequest.apply(void 0,n)}):this._makeRequest.apply(void 0,n)},un.prototype._makeRequest=function(t){var e=t.payload,r=t.callback,n=t.transport;if("undefined"!=typeof RollbarProxy)return function(t,e){(new RollbarProxy).sendJsonPayload(t,function(t){},function(t){e(new Error(t))})}(e,r);"fetch"===n?rn(t):sn(t)};var ln,cn=un;function fn(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 pn(t){return pn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pn(t)}function dn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function hn(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?dn(Object(r),!0).forEach(function(e){vn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):dn(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function yn(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,mn(n.key),n)}}function vn(t,e,r){return(e=mn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function mn(t){var e=function(t,e){if("object"!=pn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=pn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==pn(e)?e:e+""}var bn=null,gn=function(){function t(r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Pt.init({logLevel:r.logLevel||"error"}),this.options=P(kn,r,null,Pt),this.options._configuredOptions=r,this.components=this.components||{};var o=this.components.telemeter,i=this.components.instrumenter;this.wrapGlobals=this.components.wrapGlobals,this.scrub=this.components.scrub;var a=this.components.truncation,u=this.components.tracing,l=this.components.replay,c=new cn(a),f=new qe(this.options,c,e,a);if(u&&(this.tracing=new u(wn(),f,this.options),this.tracing.initSession()),o&&(this.telemeter=new o(this.options,this.tracing)),l&&"undefined"!=typeof window){var p=this.options.replay;this.replay=new l({tracing:this.tracing,telemeter:this.telemeter,options:p}),p.enabled&&p.autoStart&&this.replay.recorder.start()}this.client=n||new Pr(this.options,f,Pt,this.telemeter,this.tracing,this.replay,"browser");var d=wn(),h="undefined"!=typeof document&&document;this.isChrome=d.chrome&&d.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform(Br).addTransform(Wr).addTransform($r).addTransform(Gr).addTransform(function(t){return function(e,r,n){var o={};t&&t.location&&(o.url=t.location.href,o.query_string=t.location.search);var i="$remote_ip";r.captureIp?!0!==r.captureIp&&(i+="_anonymize"):i=null,i&&(o.user_ip=i),Object.keys(o).length>0&&I(e,"data.request",o),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t)return n(null,e);var o=t.navigator||{},i=t.screen||{};I(e,"data.client",{runtime_ms:e.timestamp-t._rollbarStartTime,timestamp:Math.round(e.timestamp/1e3),javascript:{browser:o.userAgent,language:o.language,cookie_enabled:o.cookieEnabled,screen:{width:i.width,height:i.height}}}),n(null,e)}}(r)).addTransform(function(t){return function(e,r,n){if(!t||!t.navigator)return n(null,e);for(var o,i=[],a=t.navigator.plugins||[],s=0,u=a.length;s<u;++s)o=a[s],i.push({name:o.name,description:o.description});I(e,"data.client.javascript.plugins",i),n(null,e)}}(r)).addTransform(zr).addTransform(Lr).addTransform(Cr).addTransform(Nr).addTransform((n=e.scrub,function(t,e,r){if(n){var o=e.scrubFields||[],i=e.scrubPaths||[];t.data=n(t.data,o,i)}r(null,t)})).addTransform(Rr).addTransform(qr(Pt)).addTransform(Mr).addTransform(Ur).addTransform(Ar);var n}(this.client.notifier,this,d),function(t){t.addPredicate(or).addPredicate(Vr).addPredicate(function(t){return function(e,r){var n=Boolean(e._isUncaught);delete e._isUncaught;var o=e._originalArgs;delete e._originalArgs;try{s(r.onSendCallback)&&r.onSendCallback(n,o,e)}catch(e){r.onSendCallback=null,t.error("Error while calling onSendCallback, removing",e)}try{if(s(r.checkIgnore)&&r.checkIgnore(n,o,e))return!1}catch(e){r.checkIgnore=null,t.error("Error while calling custom checkIgnore(), removing",e)}return!0}}(Pt)).addPredicate(function(t){return function(e,r){return!ar(e,r,"blocklist",t)}}(Pt)).addPredicate(function(t){return function(e,r){return ar(e,r,"safelist",t)}}(Pt)).addPredicate(sr(Pt))}(this.client.queue),this.setupUnhandledCapture(),i&&(this.instrumenter=new i(this.options,this.client.telemeter,this,d,h),this.instrumenter.instrument()),this.setSessionAttributesFromOptions(r),this.rollbar=this}return function(t,e,r){return e&&yn(t.prototype,e),r&&yn(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"global",value:function(t){return this.client.global(t),this}},{key:"configure",value:function(t,e){var r,n,o;t.logLevel&&Pt.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=P(i,t,a,Pt),this.options._configuredOptions=P(i._configuredOptions,t,a),null===(r=this.tracing)||void 0===r||r.configure(this.options),null===(n=this.replay)||void 0===n||n.configure(this.options.replay),this.client.configure(this.options,e),null===(o=this.instrumenter)||void 0===o||o.configure(this.options),this.setupUnhandledCapture(),this}},{key:"lastError",value:function(){return this.client.lastError}},{key:"log",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.log(t),{uuid:e}}},{key:"debug",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.debug(t),{uuid:e}}},{key:"info",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.info(t),{uuid:e}}},{key:"warn",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warn(t),{uuid:e}}},{key:"warning",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.warning(t),{uuid:e}}},{key:"error",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.error(t),{uuid:e}}},{key:"critical",value:function(){var t=this._createItem(arguments),e=t.uuid;return this.client.critical(t),{uuid:e}}},{key:"buildJsonPayload",value:function(t){return this.client.buildJsonPayload(t)}},{key:"sendJsonPayload",value:function(t){return this.client.sendJsonPayload(t)}},{key:"triggerDirectReplay",value:function(t){return this.triggerReplay(hn({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=wn();this.unhandledExceptionsInitialized||(this.options.captureUncaught||this.options.handleUncaughtExceptions)&&(!function(t,e,r){if(t){var n;if("function"==typeof e._rollbarOldOnError)n=e._rollbarOldOnError;else if(t.onerror){for(n=t.onerror;n._rollbarOldOnError;)n=n._rollbarOldOnError;e._rollbarOldOnError=n}e.handleAnonymousErrors();var o=function(){var r=Array.prototype.slice.call(arguments,0);!function(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,e,n,r)};r&&(o._rollbarOldOnError=n),t.onerror=o}}(t,this),this.wrapGlobals&&this.options.wrapGlobalEventHandlers&&this.wrapGlobals(t,this),this.unhandledExceptionsInitialized=!0),this.unhandledRejectionsInitialized||(this.options.captureUnhandledRejections||this.options.handleUnhandledRejections)&&(!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)}}(t,this),this.unhandledRejectionsInitialized=!0)}},{key:"handleUncaughtException",value:function(t,e,r,n,o,i){if(this.options.captureUncaught||this.options.handleUncaughtExceptions){if(this.options.inspectAnonymousErrors&&this.isChrome&&null===o&&""===e)return"anonymous";var a,s=g(t,e,r,n,o,"onerror","uncaught exception",er);f(o)?(a=this._createItem([t,o,i]))._unhandledStackInfo=s:f(e)?(a=this._createItem([t,e,i]))._unhandledStackInfo=s:(a=this._createItem([t,i])).stackInfo=s,a.level=this.options.uncaughtErrorLevel,a._isUncaught=!0,this.client.log(a)}}},{key:"handleAnonymousErrors",value:function(){var t=this;if(this.options.inspectAnonymousErrors&&this.isChrome){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)}}}},{key:"handleUnhandledRejection",value: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=m(t);n.value&&(r=n.value)}var o,i=t&&t._rollbarContext||e&&e._rollbarContext;f(t)?o=this._createItem([r,t,i]):(o=this._createItem([r,t,i])).stackInfo=g(r,"",0,0,null,"unhandledrejection","",er),o.level=this.options.uncaughtErrorLevel,o._isUncaught=!0,o._originalArgs=o._originalArgs||[],o._originalArgs.push(e),this.client.log(o)}}},{key:"wrap",value:function(t,e,r){try{var n;if(n=s(e)?e:function(){return e||{}},!s(t))return t;if(t._isWrap)return t;if(!t._rollbar_wrapped)for(var o in t._rollbar_wrapped=function(){r&&s(r)&&r.apply(this,arguments);try{return t.apply(this,arguments)}catch(r){var e=r;throw e&&window._rollbarWrappedError!==e&&(i(e,"string")&&(e=new String(e)),e._rollbarContext=n()||{},e._rollbarContext._wrappedSource=t.toString(),window._rollbarWrappedError=e),e}},t._rollbar_wrapped._isWrap=!0,t)l(t,o)&&"_rollbar_wrapped"!==o&&(t._rollbar_wrapped[o]=t[o]);return t._rollbar_wrapped}catch(e){return t}}},{key:"captureEvent",value:function(){var t=function(t){for(var e,r,n,o,i=0,s=t.length;i<s;++i)switch(a(o=t[i])){case"string":!e&&x(_,o)?e=o:!n&&x(O,o)&&(n=o);break;case"object":r=o}return{type:e||"manual",metadata:r||{},level:n}}(arguments);return this.client.captureEvent(t.type,t.metadata,t.level)}},{key:"setSessionUser",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&this.tracing.session.setUser(t)}},{key:"setSessionAttributes",value:function(t){var e;null!==(e=this.tracing)&&void 0!==e&&e.session&&(t=hn({},t),this.tracing.session.setAttributes(t))}},{key:"setSessionAttributesFromOptions",value:function(t){var e,r,n,o,i,a=t.person||(null===(e=t.payload)||void 0===e?void 0:e.person);a&&this.setSessionUser(a);var s=(null===(r=t.client)||void 0===r||null===(r=r.javascript)||void 0===r?void 0:r.code_version)||t.codeVersion||t.code_version||(null===(n=t.payload)||void 0===n||null===(n=n.client)||void 0===n||null===(n=n.javascript)||void 0===n?void 0:n.code_version)||(null===(o=t.payload)||void 0===o?void 0:o.code_version)||(null===(i=t.payload)||void 0===i?void 0:i.codeVersion);this.setSessionAttributes({"rollbar.codeVersion":s,"rollbar.notifier.name":"rollbar-browser-js","rollbar.notifier.version":t.version})}},{key:"captureDomContentLoaded",value:function(t,e){return e||(e=new Date),this.client.captureDomContentLoaded(e)}},{key:"captureLoad",value:function(t,e){return e||(e=new Date),this.client.captureLoad(e)}},{key:"loadFull",value:function(){Pt.info("Unexpected Rollbar.loadFull() called on a Notifier instance. This can happen when Rollbar is loaded multiple times.")}},{key:"_createItem",value:function(t){return S(t,Pt,this)}}],[{key:"init",value:function(e,r){return bn?bn.global(e).configure(e):bn=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(bn)return bn[t].apply(bn,e);var r="Rollbar is not initialized";Pt.error(r);var n=function(t){for(var e=0,r=t.length;e<r;++e)if(s(t[e]))return t[e];return}(e);n&&n(new Error(r))}}])}();function wn(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}ln=gn,vn(gn,"global",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("global",e)}),vn(gn,"configure",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("configure",e)}),vn(gn,"lastError",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("lastError",e)}),vn(gn,"log",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("log",e)}),vn(gn,"debug",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("debug",e)}),vn(gn,"info",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("info",e)}),vn(gn,"warn",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("warn",e)}),vn(gn,"warning",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("warning",e)}),vn(gn,"error",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("error",e)}),vn(gn,"critical",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("critical",e)}),vn(gn,"buildJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("buildJsonPayload",e)}),vn(gn,"sendJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("sendJsonPayload",e)}),vn(gn,"wrap",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("wrap",e)}),vn(gn,"captureEvent",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return ln.callInstance("captureEvent",e)});var kn={environment:"unknown",version:Ne,scrubFields:Jr.scrubFields,logLevel:Me,reportLevel:Ue,uncaughtErrorLevel:He,endpoint:De,verbose:!1,enabled:!0,transmit:!0,sendConfig:!1,includeItemsInTelemetry:!0,captureIp:!0,inspectAnonymousErrors:!0,ignoreDuplicateErrors:!0,wrapGlobalEventHandlers:!1,replay:{enabled:!1,autoStart:!0,triggerDefaults:{samplingRatio:1,preDuration:300,postDuration:5},triggers:[{type:"occurrence",level:["error","critical"]}],debug:{logErrors:!0,logEmits:!1},inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,maskInputOptions:{password:!0,email:!1,tel:!1,text:!1,color:!1,date:!1,"datetime-local":!1,month:!1,number:!1,range:!1,search:!1,time:!1,url:!1,week:!1},maskAllInputs:!1,blockClass:"rb-block",maskTextClass:"rb-mask",ignoreClass:"rb-ignore",slimDOMOptions:{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}},tracing:{enabled:!1,endpoint:"api.rollbar.com/api/1/session/"}},Sn=gn;function _n(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function On(t){this.map={},t instanceof On?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)}On.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},On.prototype.get=function(t){return t=_n(t),this.has(t)?this.map[t]:null},On.prototype.has=function(t){return l(this.map,_n(t))},On.prototype.forEach=function(t,e){for(var r in this.map)l(this.map,r)&&t.call(e,this.map[r],r,this)},On.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)};var xn=function(t){return"undefined"==typeof Headers?new On(t):new Headers(t)};var En=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function jn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return In(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?In(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function In(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function Tn(t){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=Pn(t[i]),r=o+3*n.length+e.length,i<t.length-1&&r>=83){n.unshift("...");break}n.unshift(e),o+=e.length}return n.join(" > ")}(function(t){for(var e,r=[],n=0;t&&n<5&&(e=An(t))&&"html"!==e.tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function Pn(t){if(!t||!t.tagName)return"";var e=[t.tagName];t.id&&e.push("#"+t.id),t.classes&&e.push("."+t.classes.join("."));var r,n=jn(t.attributes);try{for(n.s();!(r=n.n()).done;){var o=r.value;e.push("["+o.key+'="'+o.value+'"]')}}catch(t){n.e(t)}finally{n.f()}return e.join("")}function An(t){if(!t||!t.tagName)return null;var e,r={};r.tagName=t.tagName.toLowerCase(),t.id&&(r.id=t.id),(e=t.className)&&"string"==typeof e&&(r.classes=e.split(/\s+/));r.attributes=[];for(var n=0,o=["type","name","title","alt"];n<o.length;n++){var i=o[n],a=t.getAttribute(i);a&&r.attributes.push({key:i,value:a})}return r}function Rn(t){return Rn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rn(t)}function Cn(t){return function(t){if(Array.isArray(t))return Mn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Dn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ln(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,qn(n.key),n)}}function qn(t){var e=function(t,e){if("object"!=Rn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Rn(e)?e:e+""}function Nn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Dn(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function Dn(t,e){if(t){if("string"==typeof t)return Mn(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Mn(t,e):void 0}}function Mn(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var Un={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 Hn(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function Fn(t){var e,r=[],n=Nn(t);try{for(n.s();!(e=n.n()).done;){var o=e.value;r.push(new RegExp(o,"i"))}}catch(t){n.e(t)}finally{n.f()}return function(t){var e=function(t){if(!t||!t.attributes)return null;var e,r=Nn(t.attributes);try{for(r.s();!(e=r.n()).done;){var n=e.value;if("name"===n.key)return n.value}}catch(t){r.e(t)}finally{r.f()}return null}(t);if(!e)return!1;for(var n=0,o=r;n<o.length;n++){if(o[n].test(e))return!0}return!1}}var Jn=function(){return function(t,e,r){return e&&Ln(t.prototype,e),r&&Ln(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}(function t(e,r,n,o,a){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){(e=qn(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(this,"deinstrumentConnectivity",function(){this.removeListeners("connectivity")}),this.options=e;var s=e.autoInstrument;!1===e.enabled||!1===s?this.autoInstrument={}:(i(s,"object")||(s=Un),this.autoInstrument=A(Un,s)),this.configureScrubbing(),this.telemeter=r,this.rollbar=n,this.diagnostic=n.client.notifier.diagnostic,this._window=o||{},this._document=a||{},this.replacements={network:[],log:[],navigation:[],connectivity:[]},this.eventRemovers={dom:[],connectivity:[],contentsecuritypolicy:[]},this._location=this._window.location,this._lastHref=this._location&&this._location.href},[{key:"configureScrubbing",value:function(){var t,e,r,n,o,i,a,s,u,l,c=this.options;this.scrubTelemetryInputs=Boolean(null!==(t=c.scrubTelemetryInputs)&&void 0!==t?t:null===(e=c.replay)||void 0===e?void 0:e.maskAllInputs),this.telemetryScrubber=c.telemetryScrubber,this.defaultValueScrubber=Fn(c.scrubFields),this.maskInputFn=null===(r=c.replay)||void 0===r?void 0:r.maskInputFn,this.maskInputOptions=(null===(n=c.replay)||void 0===n?void 0:n.maskInputOptions)||{},this.scrubClasses=[null===(o=c.replay)||void 0===o?void 0:o.blockClass,null===(i=c.replay)||void 0===i?void 0:i.ignoreClass,null===(a=c.replay)||void 0===a?void 0:a.maskTextClass].filter(Boolean),this.scrubSelectors=[null===(s=c.replay)||void 0===s?void 0:s.blockSelector,null===(u=c.replay)||void 0===u?void 0:u.ignoreSelector,null===(l=c.replay)||void 0===l?void 0:l.maskTextSelector].filter(Boolean)}},{key:"configure",value:function(t){this.options=A(this.options,t);var e=t.autoInstrument,r=A(this.autoInstrument);!1===t.enabled||!1===e?this.autoInstrument={}:(i(e,"object")||(e=Un),this.autoInstrument=A(Un,e)),this.configureScrubbing(),this.instrument(r)}},{key:"instrument",value: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()}},{key:"deinstrumentNetwork",value:function(){Hn(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&s(r[e])&&En(r,e,function(e){return t.rollbar.wrap(e)})}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;En(r,"open",function(t){return function(e,r){var n=Vn(r);return(i(r,"string")||n)&&(r=n?r.toString():r,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=T(),this.__rollbar_xhr.end_time_ms=null):this.__rollbar_xhr={method:e,url:r,status_code:null,start_time_ms:T(),end_time_ms:null}),t.apply(this,arguments)}},this.replacements,"network"),En(r,"setRequestHeader",function(e){return function(r,n){return this.__rollbar_xhr||(this.__rollbar_xhr={}),i(r,"string")&&i(n,"string")&&(t.autoInstrument.networkRequestHeaders&&(this.__rollbar_xhr.request_headers||(this.__rollbar_xhr.request_headers={}),this.__rollbar_xhr.request_headers[r]=n),"content-type"===r.toLowerCase()&&(this.__rollbar_xhr.request_content_type=n)),e.apply(this,arguments)}},this.replacements,"network"),En(r,"send",function(r){return function(n){var o=this;function i(){if(o.__rollbar_xhr&&(null===o.__rollbar_xhr.status_code&&(o.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(o.__rollbar_xhr.request=n),o.__rollbar_event=t.captureNetwork(o.__rollbar_xhr,"xhr",void 0)),o.readyState<2&&(o.__rollbar_xhr.start_time_ms=T()),o.readyState>3)){var e=T();o.__rollbar_xhr.end_time_ms=e;var r=null;if(o.__rollbar_xhr.response_content_type=o.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var i=t.autoInstrument.networkResponseHeaders;r={};try{var a;if(!0===i){var s=o.getAllResponseHeaders();if(s){var u,l,c,f=Nn(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){a=(u=c.value.split(": ")).shift(),l=u.join(": "),r[a]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,d=Nn(i);try{for(d.s();!(p=d.n()).done;){var h=p.value;r[h]=o.getResponseHeader(h)}}catch(t){d.e(t)}finally{d.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=o.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(o.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(o.__rollbar_xhr.response=v);try{var m=o.status;m=1223===m?204:m,o.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(o.__rollbar_event,e,m),o.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(o.__rollbar_xhr)}catch(t){}}}return e("onload",o),e("onerror",o),e("onprogress",o),"onreadystatechange"in o&&s(o.onreadystatechange)?En(o,"onreadystatechange",function(e){return t.rollbar.wrap(e,void 0,i)}):o.onreadystatechange=i,o.__rollbar_xhr&&t.trackHttpErrors()&&(o.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&En(this._window,"fetch",function(e){return function(r,n){var o,a=Array.prototype.slice.call(arguments),s=a[0],u="GET",l=Vn(s);i(s,"string")||l?o=l?s.toString():s:s&&(o=s.url,s.method&&(u=s.method)),a[1]&&a[1].method&&(u=a[1].method);var c={method:u,url:o,status_code:null,start_time_ms:T(),end_time_ms:null};if(a[1]&&a[1].headers){var f=xn(a[1].headers);c.request_content_type=f.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(c.request_headers=t.fetchHeaders(f,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(a[1]&&a[1].body?c.request=a[1].body:a[0]&&!i(a[0],"string")&&a[0].body&&(c.request=a[0].body));var p=t.captureNetwork(c,"fetch",void 0);return t.trackHttpErrors()&&(c.stack=(new Error).stack),e.apply(this,a).then(function(e){var r=T();c.end_time_ms=r,c.status_code=e.status,t.addOtelNetworkResponse(p,r,e.status),c.response_content_type=e.headers.get("Content-Type");var n=null;t.autoInstrument.networkResponseHeaders&&(n=t.fetchHeaders(e.headers,t.autoInstrument.networkResponseHeaders));var o=null;return t.autoInstrument.networkResponseBody&&"function"==typeof e.text&&(o=e.clone().text()),(n||o)&&(c.response={},o&&("function"==typeof o.then?o.then(function(e){e&&t.isJsonContentType(c.response_content_type)?c.response.body=t.scrubJson(e):c.response.body=e}):c.response.body=o),n&&(c.response.headers=n)),t.errorOnHttpStatus(c),e})}},this.replacements,"network")}},{key:"captureNetwork",value: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)}},{key:"isJsonContentType",value:function(t){return!!(t&&i(t,"string")&&t.toLowerCase().includes("json"))}},{key:"addOtelNetworkResponse",value:function(t,e,r){t.otelAttributes&&(t.otelAttributes["response.timeUnixNano"]=(1e6*e).toString(),t.otelAttributes.statusCode=r)}},{key:"scrubJson",value:function(t){return JSON.stringify(M(JSON.parse(t),this.options.scrubFields))}},{key:"fetchHeaders",value:function(t,e){var r={};try{if(!0===e){if("function"==typeof t.entries)for(var n=t.entries(),o=n.next();!o.done;)r[o.value[0]]=o.value[1],o=n.next()}else{var i,a=Nn(e);try{for(a.s();!(i=a.n()).done;){var s=i.value;r[s]=t.get(s)}}catch(t){a.e(t)}finally{a.f()}}}catch(t){}return r}},{key:"trackHttpErrors",value:function(){return this.autoInstrument.networkErrorOnHttp5xx||this.autoInstrument.networkErrorOnHttp4xx||this.autoInstrument.networkErrorOnHttp0}},{key:"errorOnHttpStatus",value: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})}}},{key:"deinstrumentConsole",value:function(){for(var t;this.replacements.log.length;)t=this.replacements.log.shift(),this._window.console[t[0]]=t[1]}},{key:"instrumentConsole",value:function(){var t;if(null!==(t=this._window)&&void 0!==t&&null!==(t=t.console)&&void 0!==t&&t.log){var e=this,r=this._window.console;try{for(var n=0,o=["debug","info","warn","error","log"];n<o.length;n++){i(o[n])}}catch(t){this.diagnostic.instrumentConsole={error:t.message}}}function i(t){var n=r[t],o=r,i="warn"===t?"warning":t;r[t]=function(){var t=Array.prototype.slice.call(arguments),r=function(t){var e,r,n,o=[];for(e=0,r=t.length;e<r;++e){switch(a(n=t[e])){case"object":(n=(n=m(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(" ")}(t);e.telemeter.captureLog(r,i,null,T()),n&&Function.prototype.apply.call(n,o,t)},e.replacements.log.push([t,n])}}},{key:"deinstrumentDom",value:function(){this.removeListeners("dom")}},{key:"instrumentDom",value:function(){var t=this;this.addListener("dom",this._window,["click","dblclick","contextmenu"],function(e){return t.handleEvent("click",e)}),this.addListener("dom",this._window,["dragstart","dragend","dragenter","dragleave","drop"],function(e){return t.handleEvent("dragdrop",e)}),this.addListener("dom",this._window,["blur","focus"],function(e){return t.handleEvent("focus",e)}),this.addListener("dom",this._window,["submit","invalid"],function(e){return t.handleEvent("form",e)}),this.addListener("dom",this._window,["input","change"],function(e){return t.handleEvent("input",e)}),this.addListener("dom",this._window,["resize"],function(e){return t.handleEvent("resize",e)}),this.addListener("dom",this._document,["DOMContentLoaded"],function(e){return t.handleEvent("contentLoaded",e)})}},{key:"handleEvent",value:function(t,e){try{return{click:this.handleClick,dragdrop:this.handleDrag,focus:this.handleFocus,form:this.handleForm,input:this.handleInput,resize:this.handleResize,contentLoaded:this.handleContentLoaded}[t].call(this,e)}catch(r){Pt.log("".concat(t," handler error"),e,r,r.stack)}}},{key:"handleContentLoaded",value:function(t){this.rollbar.triggerReplay({type:"navigation",path:new URL(this._location.href).pathname})}},{key:"handleClick",value:function(t){var e,r=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase();["input","select","textarea"].includes(r)||this.telemeter.captureClick({type:t.type,isSynthetic:!t.isTrusted,element:Tn(t.target),timestamp:T()})}},{key:"handleFocus",value:function(t){var e,r=t.type,n=null!==(e=t.target)&&void 0!==e&&e.window?"window":Tn(t.target);this.telemeter.captureFocus({type:r,isSynthetic:!t.isTrusted,element:n,timestamp:T()})}},{key:"handleForm",value:function(t){}},{key:"handleResize",value:function(t){var e=window.screen.width/window.innerWidth;this.telemeter.captureResize({type:t.type,isSynthetic:!t.isTrusted,width:window.innerWidth,height:window.innerHeight,textZoomRatio:e,timestamp:T()})}},{key:"handleDrag",value:function(t){var e,r,n,o,i,a,s=t.type;if("drop"===s){e=[],r=[];var u,l=Nn([].concat(Cn(t.dataTransfer.files),Cn(t.dataTransfer.items)));try{for(l.s();!(u=l.n()).done;){var c=u.value;c.kind&&c.type&&(e.push(c.kind),r.push(c.type))}}catch(t){l.e(t)}finally{l.f()}}["drop","dragstart"].includes(s)&&(n=null===(i=t.dataTransfer)||void 0===i?void 0:i.dropEffect,o=null===(a=t.dataTransfer)||void 0===a?void 0:a.effectAllowed);this.telemeter.captureDragDrop({type:s,isSynthetic:!t.isTrusted,element:Tn(t.target),dropEffect:n,effectAllowed:o,kinds:JSON.stringify(e),mediaTypes:JSON.stringify(r),timestamp:T()})}},{key:"scrubInputValue",value:function(t,e,r,n){var o="******";if("password"===n)return o;if(this.scrubTelemetryInputs)return o;var i=An(e);if(this.telemetryScrubber){if(this.telemetryScrubber(i))return o}else if(this.defaultValueScrubber(i))return o;return function(t,e,r){try{var n,o=jn(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if("string"==typeof i){if(t.classList.contains(i))return!0}else{var a,s=jn(t.classList);try{for(s.s();!(a=s.n()).done;){var u=a.value;if(i.test(u))return!0}}catch(t){s.e(t)}finally{s.f()}}}}catch(t){o.e(t)}finally{o.f()}var l,c=jn(r);try{for(c.s();!(l=c.n()).done;){var f=l.value;if(t.matches(f))return!0}}catch(t){c.e(t)}finally{c.f()}}catch(t){}return!1}(e,this.scrubClasses,this.scrubSelectors)?o:this.maskInputOptions[r.toLowerCase()]||this.maskInputOptions[n]?this.maskInputFn?this.maskInputFn(t,e):o:t}},{key:"handleInput",value:function(t){var e,r,n,o,i=t.type,a=null===(e=t.target)||void 0===e?void 0:e.tagName.toLowerCase(),s=null===(r=t.target)||void 0===r?void 0:r.value,u=(null===(n=t.target)||void 0===n||null===(n=n.attributes)||void 0===n||null===(n=n.type)||void 0===n?void 0:n.value)||(null===(o=t.target)||void 0===o?void 0:o.type);switch(void 0!==s&&(s=this.scrubInputValue(s,t.target,a,u)),i){case"input":if(["radio","checkbox"].includes(u))return;["select","textarea"].includes(a)&&(u=a);break;case"change":if(!["radio","checkbox"].includes(u))return;var l;if("checkbox"===u)s=null===(l=t.target)||void 0===l?void 0:l.checked}this.telemeter.captureInput({type:u,isSynthetic:!t.isTrusted,element:Tn(t.target),value:s,timestamp:T()})}},{key:"deinstrumentNavigation",value:function(){var t=this._window.chrome;!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState&&Hn(this.replacements,"navigation")}},{key:"instrumentNavigation",value:function(){var t=this._window.chrome;if(!(t&&t.app&&t.app.runtime)&&this._window.history&&this._window.history.pushState){var e=this;En(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"),En(this._window.history,"pushState",function(t){return function(){var r=arguments.length>2?arguments[2]:void 0;return r&&e.handleUrlChange(e._lastHref,String(r)),t.apply(this,arguments)}},this.replacements,"navigation")}}},{key:"handleUrlChange",value:function(t,e){var r=fn(this._location.href),n=fn(e),o=fn(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,null,T()),this.rollbar.triggerReplay({type:"navigation",path:e})}},{key:"instrumentConnectivity",value:function(){var t=this;this.addListener("connectivity",this._window,["online","offline"],function(e){return t.handleConnectivity(e)})}},{key:"handleConnectivity",value:function(t){var e=t.type;this.telemeter.captureConnectivityChange({type:e,isSynthetic:!t.isTrusted,timestamp:T()})}},{key:"handleCspEvent",value: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",null,T()),this.handleCspError(e)}},{key:"handleCspError",value:function(t){this.autoInstrument.errorOnContentSecurityPolicy&&this.rollbar.error(t)}},{key:"deinstrumentContentSecurityPolicy",value:function(){this.removeListeners("contentsecuritypolicy")}},{key:"instrumentContentSecurityPolicy",value:function(){if("addEventListener"in this._document){var t=this.handleCspEvent.bind(this);this.addListener("contentsecuritypolicy",this._document,["securitypolicyviolation"],t)}}},{key:"addListener",value:function(t,e,r,n){var o=this;if(e.addEventListener){var i,a=Nn(r);try{var s=function(){var r=i.value,a={capture:!0,passive:!0};e.addEventListener(r,n,a,!0),o.eventRemovers[t].push(function(){e.removeEventListener(r,n,a)})};for(a.s();!(i=a.n()).done;)s()}catch(t){a.e(t)}finally{a.f()}}}},{key:"removeListeners",value:function(t){for(;this.eventRemovers[t].length;)this.eventRemovers[t].shift()()}}])}();function Vn(t){return"undefined"!=typeof URL&&t instanceof URL}var Bn=Jn;function Wn(t,e,r){if(l(e,"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 a=function(t,e,r){i.call(this,t,e&&e._rollbar_wrapped||e,r)};a._rollbarOldRemove=i,a.belongsToShim=r,e.removeEventListener=a}}var $n=function(t,e,r){if(t){var n,o,i="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(n=0;n<i.length;++n)t[o=i[n]]&&t[o].prototype&&Wn(e,t[o].prototype,r)}};Sn.setComponents({telemeter:Z,instrumenter:Bn,wrapGlobals:$n,scrub:M,truncation:me,tracing:oe});var Gn=Sn,zn="undefined"!=typeof window&&window._rollbarConfig,Xn=zn&&zn.globalAlias||"Rollbar",Zn="undefined"!=typeof window&&window[Xn]&&"function"==typeof window[Xn].shimId&&void 0!==window[Xn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Zn&&zn){var Qn=new Gn(zn);window[Xn]=Qn}else"undefined"!=typeof window?(window.rollbar=Gn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=Gn,self._rollbarDidLoad=!0)}();
|