rollbar 3.0.0 → 3.1.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.
Files changed (40) hide show
  1. package/dist/rollbar.cjs +260 -3
  2. package/dist/rollbar.js +88 -2
  3. package/dist/rollbar.js.map +1 -1
  4. package/dist/rollbar.min.cjs +1 -1
  5. package/dist/rollbar.min.js +1 -1
  6. package/dist/rollbar.min.js.map +1 -1
  7. package/dist/rollbar.named-amd.js +88 -2
  8. package/dist/rollbar.named-amd.js.map +1 -1
  9. package/dist/rollbar.named-amd.min.js +1 -1
  10. package/dist/rollbar.named-amd.min.js.map +1 -1
  11. package/dist/rollbar.noconflict.umd.js +88 -2
  12. package/dist/rollbar.noconflict.umd.js.map +1 -1
  13. package/dist/rollbar.noconflict.umd.min.js +1 -1
  14. package/dist/rollbar.noconflict.umd.min.js.map +1 -1
  15. package/dist/rollbar.replay.js +88 -2
  16. package/dist/rollbar.replay.js.map +1 -1
  17. package/dist/rollbar.replay.min.js +1 -1
  18. package/dist/rollbar.replay.min.js.map +1 -1
  19. package/dist/rollbar.replay.noconflict.umd.js +88 -2
  20. package/dist/rollbar.replay.noconflict.umd.js.map +1 -1
  21. package/dist/rollbar.replay.noconflict.umd.min.js +1 -1
  22. package/dist/rollbar.replay.noconflict.umd.min.js.map +1 -1
  23. package/dist/rollbar.replay.umd.js +88 -2
  24. package/dist/rollbar.replay.umd.js.map +1 -1
  25. package/dist/rollbar.replay.umd.min.js +1 -1
  26. package/dist/rollbar.replay.umd.min.js.map +1 -1
  27. package/dist/rollbar.snippet.js +1 -1
  28. package/dist/rollbar.umd.js +88 -2
  29. package/dist/rollbar.umd.js.map +1 -1
  30. package/dist/rollbar.umd.min.js +1 -1
  31. package/dist/rollbar.umd.min.js.map +1 -1
  32. package/index.d.ts +15 -0
  33. package/package.json +2 -1
  34. package/src/browser/telemetry.js +25 -0
  35. package/src/defaults.js +1 -1
  36. package/src/rollbar.js +3 -1
  37. package/src/server/middleware/rollbarExpressMiddleware.js +63 -0
  38. package/src/server/rollbar.js +13 -0
  39. package/src/server/telemetry.js +120 -1
  40. package/src/utility.js +70 -0
@@ -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={};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)}();
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 dn}});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}function R(t,e,r){var n;if(null==e||!e.sessionId||!r)return!1;var o=null==t||null===(n=t.tracing)||void 0===n?void 0:n.propagation,a=null==o?void 0:o.enabledHeaders;if(!Array.isArray(a)||!a.includes("baggage"))return!1;var s=null==o?void 0:o.enabledCorsUrls;return!(!Array.isArray(s)||0===s.length)&&s.some(function(t){return i(t,"string")?r===t:!!i(t,"regexp")&&t.test(r)})}function C(t,e){var r,n,o=t[1],i=null===(r=o)||void 0===r?void 0:r.headers,a=(n=t[0],"undefined"!=typeof Request&&n instanceof Request&&t[0].headers),s=i||a;if(s||(o||(t[1]=o={}),s=o.headers={}),s instanceof Headers)for(var l=0,c=Object.keys(e);l<c.length;l++){var f=c[l];s.append(f,e[f])}else if(u(s))for(var p=0,d=Object.keys(e);p<d.length;p++){var h=d[p];s[h]=e[h]}}var L=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 q(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)||D(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 N(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=D(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 D(t,e){if(t){if("string"==typeof t)return M(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)?M(t,e):void 0}}function M(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,e){var r=e.split("."),n=r.length-1;try{var o,i=N(r.entries());try{for(i.s();!(o=i.n()).done;){var a=q(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 H=function(t,e,r){if(e=e||[],r){var n,o=N(r);try{for(o.s();!(n=o.n()).done;){U(t,n.value)}}catch(t){o.e(t)}finally{o.f()}}var a=function(t){var e,r=[],n=N(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=N(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 L(t,function t(e,r,n){var o=function(t,e){var r,n=N(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")?L(r,t,n):function(t){if(i(t,"string")){var e,r=N(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})},F=["otelAttributes"];function J(t){return J="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},J(t)}function V(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 B(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?V(Object(r),!0).forEach(function(e){W(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function W(t,e,r){return(e=G(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function $(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,G(n.key),n)}}function G(t){var e=function(t,e){if("object"!=J(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=J(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==J(e)?e:e+""}var z=100;function X(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||z;this.maxQueueSize=Math.max(0,Math.min(o,z)),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||z,n=Math.max(0,Math.min(r,z)),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,F);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:Q(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,X(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=B({message:t,level:e},r?{type:"message",uuid:r}:{});return null===(o=this.telemetrySpan)||void 0===o||o.addEvent(i,a,X(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,X(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:X(a)},c=this._getRepeatedEvent(s,l);return c?this._updateRepeatedEvent(c,l,a):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(s,l,X(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:X(i)},l=this._getRepeatedEvent(a,u);return l?this._updateRepeatedEvent(l,u,i):(null===(e=this.telemetrySpan)||void 0===e||e.addEvent(a,u,X(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=X(r),t.otelAttributes.durationUnixNano=X(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,X(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,X(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=B(B({},f),{},{element:o,dropEffect:i,effectAllowed:a}),p=B(B({},p),{},{element:o,dropEffect:i,effectAllowed:a})),"drop"===r&&(f=B(B({},f),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u}),p=B(B({},p),{},{element:o,dropEffect:i,effectAllowed:a,kinds:s,mediaTypes:u})),null===(e=this.telemetrySpan)||void 0===e||e.addEvent(c,p,X(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},X(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,X(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&&$(t.prototype,e),r&&$(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Q(t,e){if(e)return e;return{error:"error",manual:"info"}[t]||"info"}var K=Z;function Y(t){return Y="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},Y(t)}function tt(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,et(n.key),n)}}function et(t){var e=function(t,e){if("object"!=Y(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Y(e)?e:e+""}var rt=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}}])&&tt(e.prototype,r),n&&tt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}(),nt=new rt;function ot(t){return ot="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},ot(t)}function it(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,at(n.key),n)}}function at(t){var e=function(t,e){if("object"!=ot(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ot(e)?e:e+""}var st=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=nt},e=[{key:"active",value:function(){return this.currentContext}},{key:"enterContext",value:function(t){var e=this.currentContext;return this.currentContext=t||nt,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&&it(t.prototype,e),r&&it(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function ut(t){return[Math.trunc(t/1e3),Math.round(t%1e3*1e6)]}function lt(t,e){return[t[0]+e[0]+Math.trunc((t[1]+e[1])/1e9),(t[1]+e[1])%1e9]}var ct={fromMillis:ut,toMillis:function(t){return 1e3*t[0]+Math.round(t[1]/1e6)},toNanos:function(t){return 1e9*t[0]+t[1]},add:lt,now:function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0]?lt(ut(performance.timeOrigin),ut(performance.now())):ut(Date.now())},isHrTime:function(t){return Array.isArray(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]}};function ft(t){return ft="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},ft(t)}function pt(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)||ht(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 dt(t){return function(t){if(Array.isArray(t))return yt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||ht(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 ht(t,e){if(t){if("string"==typeof t)return yt(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)?yt(t,e):void 0}}function yt(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 vt(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,mt(n.key),n)}}function mt(t){var e=function(t,e){if("object"!=ft(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==ft(e)?e:e+""}var bt=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){gt.push.apply(gt,dt(t))}},{key:"toPayload",value:function(){var t=this,e=gt.slice();if(gt.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=ht(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=pt(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:ct.toNanos(t.startTime),endTimeUnixNano:ct.toNanos(t.endTime),attributes:n(t.attributes),events:(e=t.events,(e||[]).map(function(t){return{timeUnixNano:ct.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=pt(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=ft(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=pt(t,2),n=r[0],o=r[1];return{key:n,value:e._transformAnyValue(o)}})}}:{stringValue:String(t)}}}],e&&vt(t.prototype,e),r&&vt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),gt=[];var wt={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 kt(t){return kt="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},kt(t)}function St(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 _t(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?St(Object(r),!0).forEach(function(e){xt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):St(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function Ot(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,Et(n.key),n)}}function xt(t,e,r){return(e=Et(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Et(t){var e=function(t,e){if("object"!=kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==kt(e)?e:e+""}var jt="RollbarSession",It=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),xt(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(jt);if(!t)return null;this.session=JSON.parse(t)}catch(t){return null}return this}},{key:"createSession",value:function(){return this.session={id:wt.gen(),createdAt:Date.now()},this.setSession(this.session)}},{key:"setSession",value:function(t){var e=JSON.stringify(t);try{this.window.sessionStorage.setItem(jt,e)}catch(t){return null}return this}},{key:"attributes",get:function(){return this._attributes}},{key:"setAttributes",value:function(t){return this._attributes=_t(_t({},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(_t({"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&&Ot(t.prototype,e),r&&Ot(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}(),Tt=function(){},Pt={debug:0,info:1,warn:2,error:3,disable:4},At={error:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Tt("error",e)},warn:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Tt("warn",e)},info:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Tt("info",e)},debug:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Tt("debug",e)},log:function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Tt("info",e)},init:function(t){var e=t.logLevel;Tt=function(t,r){Pt[t]<Pt[e]||(r.unshift("Rollbar:"),console[t].apply(console,r))}}},Rt=At;function Ct(t){return Ct="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},Ct(t)}function Lt(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 qt(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)?qt(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 qt(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 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,Dt(n.key),n)}}function Dt(t){var e=function(t,e){if("object"!=Ct(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ct(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ct(e)?e:e+""}var Mt=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=Lt(this.transforms);try{for(r.s();!(e=r.n()).done;){var n=e.value;try{n(t)}catch(t){Rt.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&&Nt(t.prototype,e),r&&Nt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Ut(t){return Ut="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},Ut(t)}function Ht(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 Ft(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)?Ft(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 Ft(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 Jt(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,Vt(n.key),n)}}function Vt(t){var e=function(t,e){if("object"!=Ut(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ut(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ut(e)?e:e+""}var Bt=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||ct.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=Ht(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||ct.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||ct.now(this.usePerformance),this.span.ended=!0,this.spanProcessor.onEnd(this)}},{key:"export",value:function(){return this.span}}],e&&Jt(t.prototype,e),r&&Jt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Wt(t){return Wt="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},Wt(t)}function $t(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 Gt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?$t(Object(r),!0).forEach(function(e){zt(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$t(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function zt(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 Xt(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"!=Wt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Wt(e)?e:e+""}var Qt=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=wt.gen(8),f=null;l?(o=l.traceId,f=l.traceState,i=l.spanId):o=wt.gen(16);var p={traceId:o,spanId:c,traceFlags:0,traceState:f},d={attributes:Gt(Gt({},(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 Bt({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&&Xt(t.prototype,e),r&&Xt(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function Kt(t){return Kt="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},Kt(t)}function Yt(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 te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Yt(Object(r),!0).forEach(function(e){ee(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Yt(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function ee(t,e,r){return(e=ne(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function re(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,ne(n.key),n)}}function ne(t){var e=function(t,e){if("object"!=Kt(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Kt(e)?e:e+""}var oe,ie=(oe="Rollbar Context Key SPAN",Symbol.for(oe)),ae=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 It(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:te(te({},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 wt.gen(t)}},{key:"createTracer",value:function(){this.contextManager=new st,this.exporter=new bt(this.api,this.options),this.spanProcessor=new Mt(this.exporter,this.options.tracing),this.tracer=new Qt(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(ie)}},{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(ie,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&&re(t.prototype,e),r&&re(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function se(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)||le(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 ue(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=le(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 le(t,e){if(t){if("string"==typeof t)return ce(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)?ce(t,e):void 0}}function ce(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 fe(t,e){return[t,m(t,e)]}function pe(t,e){var r=t.length;return r>2*e?t.slice(0,e).concat(t.slice(r-e)):t}function de(t,e,r){r=void 0===r?30:r;var n,o=t.data.body;if(o.trace_chain){var i,a=ue(o.trace_chain);try{for(a.s();!(i=a.n()).done;){var s=i.value;n=pe(n=s.frames,r),s.frames=n}}catch(t){a.e(t)}finally{a.f()}}else o.trace&&(n=pe(n=o.trace.frames,r),o.trace.frames=n);return[t,m(t,e)]}function he(t,e){return e&&e.length>t?e.slice(0,t-3).concat("..."):e}function ye(t,e,r){return e=L(e,function e(r,n,o){switch(a(n)){case"string":return he(t,n);case"object":case"array":return L(n,e,o);default:return n}}),[e,m(e,r)]}function ve(t){return t.exception&&(delete t.exception.description,t.exception.message=he(255,t.exception.message)),t.frames=pe(t.frames,1),t}function me(t,e){var r=t.data.body;if(r.trace_chain){var n,o=r.trace_chain,i=ue(o.entries());try{for(i.s();!(n=i.n()).done;){var a=se(n.value,2),s=a[0],u=a[1];o[s]=ve(u)}}catch(t){i.e(t)}finally{i.f()}}else r.trace&&(r.trace=ve(r.trace));return[t,m(t,e)]}function be(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 ge={truncate:function(t,e,r){r=void 0===r?524288:r;for(var n,o,i,a=[fe,de,ye.bind(null,1024),ye.bind(null,512),ye.bind(null,256),me];n=a.shift();)if(t=(o=n(t,e))[0],(i=o[1]).error||!be(i.value,r))return i;return i},raw:fe,truncateFrames:de,truncateStrings:ye,maybeTruncateValue:he};function we(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 ke(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 Se(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 _e(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 Oe(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?_e(Object(r),!0).forEach(function(e){xe(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_e(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function xe(t,e,r){return(e=Ae(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Ee(t){return Ee="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},Ee(t)}function je(){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 Ie(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]())):(Ie(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,Ie(t,o,"GeneratorFunction")),t.prototype=Object.create(f),t}return u.prototype=l,Ie(f,"constructor",l),Ie(l,"constructor",u),u.displayName="GeneratorFunction",Ie(l,o,"GeneratorFunction"),Ie(f),Ie(f,o,"Generator"),Ie(f,n,function(){return this}),Ie(f,"toString",function(){return"[object Generator]"}),(je=function(){return{w:i,m:p}})()}function Ie(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}Ie=function(t,e,r,n){function i(e,r){Ie(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))},Ie(t,e,r,n)}function Te(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 Pe(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,Ae(n.key),n)}}function Ae(t){var e=function(t,e){if("object"!=Ee(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ee(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ee(e)?e:e+""}var Re={hostname:"api.rollbar.com",path:"/api/1/item/",search:null,version:"1",protocol:"https:",port:443},Ce={hostname:"api.rollbar.com",path:"/api/1/session/",search:null,version:"1",protocol:"https:",port:443},Le=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=qe(e,n),this.OTLPTransportOptions=Ne(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=Se(this.transportOptions,"POST"),o=we(t);setTimeout(function(){r.transport.post({accessToken:r.accessToken,options:n,payload:o,callback:e})},0)}},{key:"postSpans",value:(n=je().m(function t(e){var r,n,o=arguments;return je().w(function(t){for(;;)if(0===t.n)return r=o.length>1&&void 0!==o[1]?o[1]:{},n=Se(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){Te(i,r,o,a,s,"next",t)}function s(t){Te(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=we(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=Se(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=qe(this.options,this.url),this.OTLPTransportOptions=Ne(this.options,this.url),void 0!==this.options.accessToken&&(this.accessToken=this.options.accessToken),this}}],e&&Pe(t.prototype,e),r&&Pe(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();function qe(t,e){return ke(t,Re,e)}function Ne(t,e){var r;return ke(t=Oe(Oe({},t),{},{endpoint:null===(r=t.tracing)||void 0===r?void 0:r.endpoint}),Ce,e)}var De=Le,Me="3.1.0",Ue="api.rollbar.com/api/1/item/",He="debug",Fe="debug",Je="error",Ve=/(^|@)\S+:\d+/,Be=/^\s*at .*(\S+:\d+|\(native\))/m,We=/^(eval@)?(\[native code\])?$/;function $e(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 ze(o,e)}(t):t.stack?function(t,e){var r=ze(t.stack.split("\n").filter(function(t){return!!t.match(Ve)&&!t.match(/^Error created at/)}),e);return r.map(function(t){var e,r=t.split("@"),n=Ge(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 ze(o,e)}(t)}(t,e);if(t.stack&&t.stack.match(Be))return function(t,e){return Xe(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 Ge(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 ze(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 Xe(t,e){return ze(t.split("\n").filter(function(t){return!!t.match(Be)}),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=Ge(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 ze(t.split("\n").filter(function(t){return!t.match(We)}),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=Ge(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 Qe(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 Ke=new RegExp("^(([a-zA-Z0-9-_$ ]*): *)?(Uncaught )?([a-zA-Z0-9-_$ ]*): ");function Ye(){return null}function tr(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 er(t,e){return{stack:function(){var r=[];e=e||0;try{r=function(t,e){return Qe($e(t,e))}(t)}catch(t){r=[]}for(var n=[],o=e;o<r.length;o++)n.push(new tr(r[o]));return n}(),message:t.message,name:rr(t),rawStack:t.stack,rawException:t}}function rr(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 nr={guessFunctionName:function(){return"?"},guessErrorClass:function(t){if(!t||!t.match)return["Unknown error. There was no error message to display.",""];var e=t.match(Ke),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:Ye,parse:function(t,e){var r=t;if(r.nested||r.cause){for(var n=[];r;)n.push(new er(r,e)),r=r.nested||r.cause,e=0;return n[0].traceChain=n,n[0]}return new er(r,e)},Stack:er,Frame:tr};function or(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 ir(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)?ir(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 ir(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 ar(t,e){var r=t.level,n=d[r]||0,o=e.reportLevel;return!(n<(d[o]||0))}function sr(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 ur(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(sr(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 lr(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=or(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 cr(t){return cr="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},cr(t)}function fr(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,pr(n.key),n)}}function pr(t){var e=function(t,e){if("object"!=cr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=cr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==cr(e)?e:e+""}var dr=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&&fr(t.prototype,e),r&&fr(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();function hr(t){return hr="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},hr(t)}function yr(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,vr(n.key),n)}}function vr(t){var e=function(t,e){if("object"!=hr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=hr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hr(e)?e:e+""}var mr,br,gr,wr=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&&yr(e.prototype,r),n&&yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,n}();mr=wr,gr=["ECONNRESET","ENOTFOUND","ESOCKETTIMEDOUT","ETIMEDOUT","ECONNREFUSED","EHOSTUNREACH","EPIPE","EAI_AGAIN"],(br=vr(br="RETRIABLE_ERRORS"))in mr?Object.defineProperty(mr,br,{value:gr,enumerable:!0,configurable:!0,writable:!0}):mr[br]=gr;var kr=wr;function Sr(t){return Sr="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},Sr(t)}function _r(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"!=Sr(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Sr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Sr(e)?e:e+""}var xr=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&&_r(t.prototype,e),r&&_r(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(Er(e,o,this.counter))return jr(this.platform,this.platformOptions,"".concat(o," max items reached"),!1);if(Er(e,i,this.perMinCounter))return jr(this.platform,this.platformOptions,"".concat(i," items per minute reached"),!1);this.counter+=1,this.perMinCounter+=1;var a=!Er(e,o,this.counter),s=a,u=a&&!Er(e,i,this.perMinCounter);return jr(this.platform,this.platformOptions,null,u,o,i,s)}},{key:"setPlatformOptions",value:function(t,e){this.platform=t,this.platformOptions=e}}])}();function Er(t,e,r){return!t.ignoreRateLimit&&e>=1&&r>e}function jr(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=Or(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}(xr,"globalSettings",{startTime:Date.now(),maxItems:void 0,itemsPerMinute:void 0});var Ir=xr;function Tr(t,e,r,n,o,i,a){this.options=A(t),this.logger=r,Tr.rateLimiter.configureGlobal(this.options),Tr.rateLimiter.setPlatformOptions(a,this.options),this.api=e,this.queue=new kr(Tr.rateLimiter,e,r,this.options,i),this.tracing=o;var s=this.options.tracer||null;Ar(s)?(this.tracer=s,this.options.tracer="opentracing-tracer-enabled",this.options._configuredOptions.tracer="opentracing-tracer-enabled"):this.tracer=null,this.notifier=new dr(this.queue,this.options),this.telemeter=n,Pr(t),this.lastError=null,this.lastErrorHash="none"}function Pr(t){t.stackTraceLimit&&(Error.stackTraceLimit=t.stackTraceLimit)}function Ar(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)}Tr.rateLimiter=new Ir({maxItems:0,itemsPerMinute:60}),Tr.prototype.global=function(t){return Tr.rateLimiter.configureGlobal(t),this},Tr.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 Ar(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),Pr(t),this.global(this.options),Ar(t.tracer)&&(this.tracer=t.tracer),this},Tr.prototype.log=function(t){var e=this._defaultLogLevel();return this._log(e,t)},Tr.prototype.debug=function(t){this._log("debug",t)},Tr.prototype.info=function(t){this._log("info",t)},Tr.prototype.warn=function(t){this._log("warning",t)},Tr.prototype.warning=function(t){this._log("warning",t)},Tr.prototype.error=function(t){this._log("error",t)},Tr.prototype.critical=function(t){this._log("critical",t)},Tr.prototype.wait=function(t){this.queue.wait(t)},Tr.prototype.captureEvent=function(t,e,r){return this.telemeter&&this.telemeter.captureEvent(t,e,r)},Tr.prototype.captureDomContentLoaded=function(t){return this.telemeter&&this.telemeter.captureDomContentLoaded(t)},Tr.prototype.captureLoad=function(t){return this.telemeter&&this.telemeter.captureLoad(t)},Tr.prototype.buildJsonPayload=function(t){return this.api.buildJsonPayload(t)},Tr.prototype.sendJsonPayload=function(t){this.api.postJsonPayload(t)},Tr.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)}},Tr.prototype._addItemAttributes=function(t){var e,r,n=null===(e=this.tracing)||void 0===e?void 0:e.getSpan(),o=[{key:"session_id",value:function(t){var e=t.asyncLocalStorage;if(!e||"function"!=typeof e.getStore)return null;var r=e.getStore();return(null==r?void 0:r.sessionId)||null}(this)||(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}])},Tr.prototype._defaultLogLevel=function(){return this.options.logLevel||"debug"},Tr.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)},Tr.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 Rr=Tr;function Cr(t,e,r){t._isUncaught&&(t.data._isUncaught=!0),t._originalArgs&&(t.data._originalArgs=t._originalArgs),r(null,t)}function Lr(t,e,r){var n=e.payload||{};n.body&&delete n.body,t.data=A(t.data,n),r(null,t)}function qr(t,e,r){t.telemetryEvents&&I(t,"data.body.telemetry",t.telemetryEvents),r(null,t)}function Nr(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 Dr(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 Mr(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 Ur(t,e){s(t[e])&&(t[e]=t[e].toString())}function Hr(t,e,r){var n=e._configuredOptions;Ur(n,"transform"),Ur(n,"checkIgnore"),Ur(n,"onSendCallback"),delete n.accessToken,t.data.notifier.configured_options=n,r(null,t)}function Fr(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 Jr(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 Vr=[].concat(function(t){return function(t){if(Array.isArray(t))return Jr(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 Jr(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)?Jr(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"]),Br={scrubFields:Vr};function Wr(t,e){return!j(e,"plugins.jquery.ignoreAjaxErrors")||!j(t,"body.message.extra.isAjax")}function $r(t,e,r){if(t.err&&"DOMException"===nr.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 Gr(t,e,n){if(t.data=t.data||{},t.err)try{t.stackInfo=t.err._savedStackTrace||nr.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){Rt.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 zr(t,e,r){t.message||t.stackInfo||t.custom||r(new Error("No message, stack info, or custom data"),null),r(null,t)}function Xr(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=Yr(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=Kr(t);if(n){I(t,"data.body",{trace:Yr(t,t.stackInfo,e)}),r(null,t)}else{var o=t.stackInfo,i=nr.guessErrorClass(o.message),a=tn(o,i[0],e),s=i[1];t.message=a+": "+s,Qr(t,e,r)}}(t,e,r):Qr(t,e,r)}function Qr(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 Kr(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 Yr(t,e,r){var n=t&&t.data.description,o=t&&t.custom,i=Kr(t,e),a=nr.guessErrorClass(e.message),s={exception:{class:tn(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 tn(t,e,r){return t.name?t.name:r.guessErrorClass?e:"(unknown)"}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=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 nn(t,e,r){return(e=function(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+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var on=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?rn(Object(r),!0).forEach(function(e){nn(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rn(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){Rt.error(t.message),u(t)})};function an(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 sn(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)?sn(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 sn(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 un(t,e){var r=new Error(t);return r.code=e||"ENOTFOUND",r}var ln=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;Rt.error(o)}u(new Error(String(e.status)))}else{u(un("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=an(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(un("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 cn(t){this.truncation=t}cn.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})},cn.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})},cn.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})},cn.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)},cn.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?on(t):ln(t)};var fn,pn=cn;function dn(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 hn(t){return hn="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},hn(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){bn(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){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 bn(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 gn(t){var e=function(t,e){if("object"!=hn(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==hn(e)?e:e+""}var wn=null,kn=function(){function t(r,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),Rt.init({logLevel:r.logLevel||"error"}),this.options=P(_n,r,null,Rt),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 pn(a),f=new De(this.options,c,e,a);if(u&&(this.tracing=new u(Sn(),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 Rr(this.options,f,Rt,this.telemeter,this.tracing,this.replay,"browser");var d=Sn(),h="undefined"!=typeof document&&document;this.isChrome=d.chrome&&d.chrome.runtime,this.anonymousErrorsPending=0,function(t,e,r){t.addTransform($r).addTransform(Gr).addTransform(zr).addTransform(Xr).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(Nr).addTransform(qr).addTransform(Mr).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(Lr).addTransform(Dr(Rt)).addTransform(Hr).addTransform(Fr).addTransform(Cr);var n}(this.client.notifier,this,d),function(t){t.addPredicate(ar).addPredicate(Wr).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}}(Rt)).addPredicate(function(t){return function(e,r){return!ur(e,r,"blocklist",t)}}(Rt)).addPredicate(function(t){return function(e,r){return ur(e,r,"safelist",t)}}(Rt)).addPredicate(lr(Rt))}(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&&mn(t.prototype,e),r&&mn(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&&Rt.init({logLevel:t.logLevel}),this.setSessionAttributesFromOptions(t);var i=this.options,a={};return e&&(a={payload:e}),this.options=P(i,t,a,Rt),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(vn({type:"direct"},t))}},{key:"triggerReplay",value:function(t){return this.replay?this.replay.triggerReplay(t):null}},{key:"setupUnhandledCapture",value:function(){var t=Sn();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",nr);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","",nr),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=vn({},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(){Rt.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,Rt,this)}}],[{key:"init",value:function(e,r){return wn?wn.global(e).configure(e):wn=new t(e,r)}},{key:"setComponents",value:function(e){t.prototype.components=e}},{key:"callInstance",value:function(t,e){if(wn)return wn[t].apply(wn,e);var r="Rollbar is not initialized";Rt.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 Sn(){return"undefined"!=typeof window&&window||"undefined"!=typeof self&&self}fn=kn,bn(kn,"global",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("global",e)}),bn(kn,"configure",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("configure",e)}),bn(kn,"lastError",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("lastError",e)}),bn(kn,"log",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("log",e)}),bn(kn,"debug",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("debug",e)}),bn(kn,"info",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("info",e)}),bn(kn,"warn",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("warn",e)}),bn(kn,"warning",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("warning",e)}),bn(kn,"error",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("error",e)}),bn(kn,"critical",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("critical",e)}),bn(kn,"buildJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("buildJsonPayload",e)}),bn(kn,"sendJsonPayload",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("sendJsonPayload",e)}),bn(kn,"wrap",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("wrap",e)}),bn(kn,"captureEvent",function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return fn.callInstance("captureEvent",e)});var _n={environment:"unknown",version:Me,scrubFields:Br.scrubFields,logLevel:He,reportLevel:Fe,uncaughtErrorLevel:Je,endpoint:Ue,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/"}},On=kn;function xn(t){return"string"!=typeof t&&(t=String(t)),t.toLowerCase()}function En(t){this.map={},t instanceof En?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)}En.prototype.append=function(t,e){t=xn(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},En.prototype.get=function(t){return t=xn(t),this.has(t)?this.map[t]:null},En.prototype.has=function(t){return l(this.map,xn(t))},En.prototype.forEach=function(t,e){for(var r in this.map)l(this.map,r)&&t.call(e,this.map[r],r,this)},En.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 jn=function(t){return"undefined"==typeof Headers?new En(t):new Headers(t)};var In=function(t,e,r,n,o){var i=t[e];t[e]=r(i),n&&n[o].push([t,e,i])};function Tn(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 Pn(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)?Pn(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 Pn(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){return function(t){for(var e,r,n=[],o=0,i=t.length-1;i>=0;i--){if(e=Rn(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=Cn(t))&&"html"!==e.tagName;n++)r.unshift(e),t=t.parentNode;return r}(t))}function Rn(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=Tn(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 Cn(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 Ln(t){return Ln="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},Ln(t)}function qn(t){return function(t){if(Array.isArray(t))return Hn(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Un(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 Nn(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,Dn(n.key),n)}}function Dn(t){var e=function(t,e){if("object"!=Ln(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!=Ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==Ln(e)?e:e+""}function Mn(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=Un(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 Un(t,e){if(t){if("string"==typeof t)return Hn(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)?Hn(t,e):void 0}}function Hn(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 Fn={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 Jn(t,e){for(var r;t[e].length;)(r=t[e].shift())[0][r[1]]=r[2]}function Vn(t){var e,r=[],n=Mn(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=Mn(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 Bn=function(){return function(t,e,r){return e&&Nn(t.prototype,e),r&&Nn(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=Dn(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=Fn),this.autoInstrument=A(Fn,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=Vn(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=Fn),this.autoInstrument=A(Fn,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(){Jn(this.replacements,"network")}},{key:"instrumentNetwork",value:function(){var t=this;function e(e,r){e in r&&s(r[e])&&In(r,e,function(e){return t.rollbar.wrap(e)})}if("XMLHttpRequest"in this._window){var r=this._window.XMLHttpRequest.prototype;In(r,"open",function(t){return function(e,r){var n=Wn(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"),In(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"),In(r,"send",function(r){return function(n){var o,i,a=this,u=null===(o=t.rollbar)||void 0===o?void 0:o.tracing;if(R(t.options,u,null===(i=a.__rollbar_xhr)||void 0===i?void 0:i.url))try{a.setRequestHeader("baggage","rollbar.session.id=".concat(u.sessionId))}catch(t){}function l(){if(a.__rollbar_xhr&&(null===a.__rollbar_xhr.status_code&&(a.__rollbar_xhr.status_code=0,t.autoInstrument.networkRequestBody&&(a.__rollbar_xhr.request=n),a.__rollbar_event=t.captureNetwork(a.__rollbar_xhr,"xhr",void 0)),a.readyState<2&&(a.__rollbar_xhr.start_time_ms=T()),a.readyState>3)){var e=T();a.__rollbar_xhr.end_time_ms=e;var r=null;if(a.__rollbar_xhr.response_content_type=a.getResponseHeader("Content-Type"),t.autoInstrument.networkResponseHeaders){var o=t.autoInstrument.networkResponseHeaders;r={};try{var i;if(!0===o){var s=a.getAllResponseHeaders();if(s){var u,l,c,f=Mn(s.trim().split(/[\r\n]+/));try{for(f.s();!(c=f.n()).done;){i=(u=c.value.split(": ")).shift(),l=u.join(": "),r[i]=l}}catch(t){f.e(t)}finally{f.f()}}}else{var p,d=Mn(o);try{for(d.s();!(p=d.n()).done;){var h=p.value;r[h]=a.getResponseHeader(h)}}catch(t){d.e(t)}finally{d.f()}}}catch(t){}}var y=null;if(t.autoInstrument.networkResponseBody)try{y=a.responseText}catch(t){}var v=null;(y||r)&&(v={},y&&(t.isJsonContentType(a.__rollbar_xhr.response_content_type)?v.body=t.scrubJson(y):v.body=y),r&&(v.headers=r)),v&&(a.__rollbar_xhr.response=v);try{var m=a.status;m=1223===m?204:m,a.__rollbar_xhr.status_code=m,t.addOtelNetworkResponse(a.__rollbar_event,e,m),a.__rollbar_event.level=t.telemeter.levelFromStatus(m),t.errorOnHttpStatus(a.__rollbar_xhr)}catch(t){}}}return e("onload",a),e("onerror",a),e("onprogress",a),"onreadystatechange"in a&&s(a.onreadystatechange)?In(a,"onreadystatechange",function(e){return t.rollbar.wrap(e,void 0,l)}):a.onreadystatechange=l,a.__rollbar_xhr&&t.trackHttpErrors()&&(a.__rollbar_xhr.stack=(new Error).stack),r.apply(this,arguments)}},this.replacements,"network")}"fetch"in this._window&&In(this._window,"fetch",function(e){return function(r,n){var o,a,s=Array.prototype.slice.call(arguments),u=s[0],l="GET",c=Wn(u);i(u,"string")||c?a=c?u.toString():u:u&&(a=u.url,u.method&&(l=u.method)),s[1]&&s[1].method&&(l=s[1].method);var f=null===(o=t.rollbar)||void 0===o?void 0:o.tracing;R(t.options,f,a)&&C(s,{baggage:"rollbar.session.id=".concat(f.sessionId)});var p={method:l,url:a,status_code:null,start_time_ms:T(),end_time_ms:null};if(s[1]&&s[1].headers){var d=jn(s[1].headers);p.request_content_type=d.get("Content-Type"),t.autoInstrument.networkRequestHeaders&&(p.request_headers=t.fetchHeaders(d,t.autoInstrument.networkRequestHeaders))}t.autoInstrument.networkRequestBody&&(s[1]&&s[1].body?p.request=s[1].body:s[0]&&!i(s[0],"string")&&s[0].body&&(p.request=s[0].body));var h=t.captureNetwork(p,"fetch",void 0);return t.trackHttpErrors()&&(p.stack=(new Error).stack),e.apply(this,s).then(function(e){var r=T();p.end_time_ms=r,p.status_code=e.status,t.addOtelNetworkResponse(h,r,e.status),p.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)&&(p.response={},o&&("function"==typeof o.then?o.then(function(e){e&&t.isJsonContentType(p.response_content_type)?p.response.body=t.scrubJson(e):p.response.body=e}):p.response.body=o),n&&(p.response.headers=n)),t.errorOnHttpStatus(p),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(H(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=Mn(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){Rt.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:An(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":An(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=Mn([].concat(qn(t.dataTransfer.files),qn(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:An(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=Cn(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=Tn(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=Tn(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=Tn(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:An(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&&Jn(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;In(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"),In(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=dn(this._location.href),n=dn(e),o=dn(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=Mn(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 Wn(t){return"undefined"!=typeof URL&&t instanceof URL}var $n=Bn;function Gn(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 zn=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&&Gn(e,t[o].prototype,r)}};On.setComponents({telemeter:K,instrumenter:$n,wrapGlobals:zn,scrub:H,truncation:ge,tracing:ae});var Xn=On,Zn="undefined"!=typeof window&&window._rollbarConfig,Qn=Zn&&Zn.globalAlias||"Rollbar",Kn="undefined"!=typeof window&&window[Qn]&&"function"==typeof window[Qn].shimId&&void 0!==window[Qn].shimId();if("undefined"==typeof window||window._rollbarStartTime||(window._rollbarStartTime=(new Date).getTime()),!Kn&&Zn){var Yn=new Xn(Zn);window[Qn]=Yn}else"undefined"!=typeof window?(window.rollbar=Xn,window._rollbarDidLoad=!0):"undefined"!=typeof self&&(self.rollbar=Xn,self._rollbarDidLoad=!0)}();